Added unique ids for debugging, added access functions
[libfirm] / ir / ana2 / ecg.h
1 /* -*- c -*- */
2
3 #ifndef _EGC_H_
4 #define _EGC_H_
5
6 # include "irgraph.h"
7 # include "irnode.h"
8
9 /*
10   data
11 */
12
13 typedef struct ctx_info
14 {
15   ir_graph *graph;              /* The graph of the callR who created this ctx */
16   /* (which is redundant, since it's always == get_irn_graph (call)  */
17   ir_node *call;                /* The call through which this graph was called */
18   struct ctx_info *enc;         /* The ctx in which our callR was called */
19   int id;
20 } ctx_info_t;
21
22 typedef struct alloc_info
23 {
24   ir_graph *graph;
25   ir_node *alloc;
26   type *tp;
27   struct alloc_info *prev;
28 } alloc_info_t;
29
30 typedef struct callEd_info
31 {
32   ir_graph *callEd;
33   struct callEd_info *prev;
34 } callEd_info_t;
35
36 typedef struct call_info
37 {
38   ir_node *call;
39   callEd_info_t *callEds;
40   struct call_info *prev;
41 } call_info_t;
42
43 typedef struct graph_info
44 {
45   ir_graph *graph;
46   call_info_t *calls;
47   alloc_info_t *allocs;
48   ctx_info_t **ctxs;
49   int n_ctxs;
50   int ecg_seen;
51   int allocs_seen;
52   struct graph_info *prev;
53 } graph_info_t;
54
55 /* protos */
56 void ecg_print_ctx (ctx_info_t*, FILE *stream);
57
58 ctx_info_t *get_ctx (graph_info_t*, int);
59 ctx_info_t *get_main_ctx (void);
60
61 void ecg_init (int);
62 graph_info_t *ecg_get_info (ir_graph*);
63 alloc_info_t *ecg_get_alloc_info (ir_graph*);
64 callEd_info_t *ecg_get_callEd_info (ir_node*);
65
66 void ecg_cleanup (void);
67 void ecg_report (void);
68 void ecg_ecg (void);
69
70 #endif /* defined _EGC_H_ */
71
72 \f
73 /*
74 $Log$
75 Revision 1.2  2004/11/18 16:36:37  liekweg
76 Added unique ids for debugging, added access functions
77
78 Revision 1.1  2004/10/20 14:59:42  liekweg
79 Added ana2, added ecg and pto
80
81 Revision 1.3  2004/10/14 11:31:29  liekweg
82 SHUTUP_GCC
83
84 Revision 1.2  2004/10/12 11:02:03  liekweg
85 wtf?
86
87 Revision 1.1  2004/09/29 12:03:39  liekweg
88 Added ecg mod
89  */