c7ca37dad596334048fc002c76df318a59c88f2b
[libfirm] / ir / debug / debinfo.h
1 /*
2 **  Copyright (C) 2001 by Universitaet Karlsruhe
3 **  All rights reserved.
4 **
5 **  Authors: Goetz Lindenmaier
6 **
7 **  debinfo: This is the Firm interface to debugging support.  Firm requires
8 **  a debugging module fulfilling this interface.
9 **  The interface requires a datatype representing the debugging information.
10 **  Firm supports administrating a reference to the debug information
11 **  in every firm node.  Further Firm optimizations call routines to
12 **  propagate debug information from old nodes to new nodes if the optimization
13 **  replaces the old ones by the new ones.
14 **
15 **  This file does not belong to the interface of the firm library.
16 */
17 # ifndef _DEBINFO_H_
18 # define _DEBINFO_H_
19
20 #include "irnode.h"
21 #include "ident.h"
22
23 /* A datastructure containing information for debugging.  */
24 typedef struct deb_info deb_info;
25 /* Every Firm node contains a reference to a deb_info struct. This reference
26    can be accessed by the debug support module by
27    deb_info *get_irn_deb_info(irnode *n);
28    void      set_irn_deb_info(irnode *n, deb_info *d);.
29    The module may not touch or change anything else in the Firm data structure.
30 */
31
32 /** The following routines are called by firm optmizations.  The optimization
33     passes an ident representing a string that describes the optimization
34     performed.  **/
35 /* deb_info_copy() is called in the following situation:
36    The optimization replaced the old node by the new one.  The new node
37    might be a recent allocated node not containing any debug information,
38    or just another node from somewhere in the graph with the same
39    semantics. */
40 void deb_info_copy(ir_node *new, ir_node *old, ident *info);
41
42 /* deb_info_merge() is called in the following situation:
43    The optimization replaced a subgraph by another subgraph.  There is no
44    obviouse mapping between single nodes in both subgraphs.  The optimization
45    simply passes two lists to the debug module, one containing the nodes in
46    the old subgraph, the other containing the nodes in the new subgraph.  */
47 void deb_info_merge(ir_node **new_nodes, ir_node **old_nodes, ident *info);
48
49
50 #endif /* _DEBINFO_H_ */