*** empty log message ***
[libfirm] / ir / debug / dbginfo.h
1 /*
2 **  Copyright (C) 2001 by Universitaet Karlsruhe
3 **  All rights reserved.
4 **
5 **  Authors: Goetz Lindenmaier
6 **
7 **  dbginfo: 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
18 /* $Id$ */
19
20 # ifndef _DBGINFO_H_
21 # define _DBGINFO_H_
22
23 #include "irnode.h"
24 #include "ident.h"
25
26 #ifndef _IR_NODE_TYPEDEF_
27 #define _IR_NODE_TYPEDEF_
28 typedef struct ir_node ir_node;
29 #endif
30
31 /* A datastructure containing information for debugging.  */
32 typedef struct dbg_info dbg_info;
33 /* Every Firm node contains a reference to a dbg_info struct. This reference
34    can be accessed by the debug support module by
35    dbg_info *get_irn_dbg_info(irnode *n);
36    void      set_irn_dbg_info(irnode *n, dbg_info *d);.
37    The module may not touch or change anything else in the Firm data structure.
38 */
39 inline void set_irn_dbg_info(ir_node *n, dbg_info* db);
40 inline dbg_info *get_irn_dbg_info(ir_node *n);
41
42 /** The following routines are called by firm optmizations.  The optimization
43     passes an ident representing a string that describes the optimization
44     performed.  **/
45 /* dbg_info_copy() is called in the following situation:
46    The optimization replaced the old node by the new one.  The new node
47    might be a recent allocated node not containing any debug information,
48    or just another node from somewhere in the graph with the same
49    semantics. */
50 void dbg_info_copy(ir_node *nw, ir_node *old, ident *info);
51
52 /* dbg_info_merge() is called in the following situation:
53    The optimization replaced a subgraph by another subgraph.  There is no
54    obviouse mapping between single nodes in both subgraphs.  The optimization
55    simply passes two lists to the debug module, one containing the nodes in
56    the old subgraph, the other containing the nodes in the new subgraph.  */
57 void dbg_info_merge(ir_node **new_nodes, ir_node **old_nodes, ident *info);
58
59
60
61
62 #endif /* _DBGINFO_H_ */