moved -dw dump to edg/firm_opt.c
[libfirm] / ir / external / read_t.h
1 /* -*- c -*- */
2 /*
3  * Project:     libFIRM
4  * File name:   ir/external/read.h
5  * Purpose:     Read descriptions of external effects
6  * Author:      Florian
7  * Modified by: Boris Boesler
8  * Created:     11.10.2004
9  * CVS-ID:      $Id$
10  * Copyright:   (c) 1999-2004 Universität Karlsruhe
11  * Licence:     This file is protected by GPL -  GNU GENERAL PUBLIC LICENSE.
12  */
13
14 #ifndef _READ_T_H_
15 #define _READ_T_H_
16
17 #include "firm_types.h"
18
19 /* first, the xml structures */
20
21 typedef struct type_str
22 {
23   const ident *type_ident;
24   const ident *id;              /* id for references */
25   ir_type *f_tp;                /* firm type */
26   struct type_str *prev;
27 } type_t;
28
29 typedef struct entity_str
30 {
31   const ident *ent_ident;        /* name of entity */
32   const ident *tp_ident;         /* name of type/class */
33   const ident *id;               /* id for references */
34   const ident *owner;            /* id of owner */
35   entity *f_ent;                 /* firm entity */
36   struct entity_str *prev;
37 } entity_t;
38
39 /* now the xml nodes */
40 typedef enum eff_node_kind {
41   eff_arg,      // done
42   eff_valref,   // eliminated
43   eff_select,   // eliminated
44   eff_load,     // done
45   eff_store,    // done
46   eff_alloc,    // done
47   eff_call,     // done
48   eff_unknown,  // done
49   eff_join,     // TODO
50   eff_raise,    // TODO
51   eff_ret       // done
52 } eff_node_kind_t;
53
54
55 typedef struct arg_str
56 {
57   const ident *type_ident;
58   int num;
59 } arg_t;
60
61 typedef struct valref_str
62 {
63   int dummy;
64 } valref_t;
65
66 typedef struct select_str
67 {
68   entity_t *ent;
69 } select_t;
70
71 typedef struct load_str
72 {
73   const ident *ptrrefid;     /* id of valref node enclosed in select, or -1 */
74   entity_t *ent;
75 } load_t;
76
77 typedef struct store_str
78 {
79   const ident *ptrrefid;     /* id of ptr valref node enclosed in select, or -1 */
80   const ident *valrefid;     /* id of val valref node enclosed in select, or -1 */
81   entity_t *ent;
82 } store_t;
83
84 typedef struct alloc_str
85 {
86   const ident *tp_id;
87 } alloc_t;
88
89 typedef struct call_str
90 {
91   const ident *valrefid;     /* id of enclosed valref node, or -1 */
92   entity_t *ent;             /* called entity */
93   int n_args;
94   const ident **args;
95 } call_t;
96
97 typedef struct unknown_str
98 {
99   int dummy;
100 } unknown_t;
101
102 typedef struct join_str
103 {
104   int n_ins;
105   const ident **ins;
106 } join_t;
107
108 typedef struct ret_str
109 {
110   const ident *ret_id;
111 } ret_t;                     /* returned value, or NO_ID */
112
113 typedef struct raise_str
114 {
115   const ident *valref;       /* what was that one for? */
116   const ident *tp_id;
117 } raise_t;
118
119 /* dummy type for all other effects */
120 typedef struct eff_str
121 {
122   eff_node_kind_t kind;
123   const ident *id;           /* identifier to access this node */
124   union {
125     arg_t arg;
126     valref_t valref;
127     select_t select;
128     load_t load;
129     store_t store;
130     alloc_t alloc;
131     call_t call;
132     unknown_t unknown;
133     join_t join;
134     ret_t ret;
135     raise_t raise;
136   } effect;
137   ir_node *firmnode;
138   struct eff_str *next; /* effects with values are stored in proc.values */
139 } eff_t;
140
141 typedef struct proc_str
142 {
143   const ident *proc_ident;   /* name of procedure */
144   const ident *ownerid;
145   int n_effs;
146   eff_t **effs;
147   struct proc_str *next;
148   eff_t *values;             /* @@@ TODO hash set */
149 } proc_t;
150
151
152 typedef struct mod_str
153 {
154   const ident *id;
155   type_t *types;             /* types in module *//* @@@ TODO hash set */
156   entity_t *entities;        /* entities in module *//* @@@ TODO hash set */
157   proc_t *procs;             /* methods with effects */
158   struct mod_str *next;      /* unused - only one module possible */
159 } module_t;
160
161
162 #endif /* defined _READ_T_H_ */
163
164 /*
165   $Log$
166   Revision 1.3  2006/06/09 11:26:35  firm
167   renamed type to ir_type
168
169   Revision 1.2  2004/12/10 15:14:16  beck
170   Removed unused header files
171   move xml macros to read.c, freeing the header from libxml depency
172
173   Revision 1.1  2004/10/25 13:52:24  boesler
174   seperated read.h (public interface) and read_t.h (types)
175
176   Revision 1.6  2004/10/22 13:13:27  boesler
177   replaced char* by idents, minor fix in Firm codegen for call
178
179   Revision 1.5  2004/10/21 15:31:55  boesler
180   added lots of stuff:
181   - build abstract syntax trees
182   - build Firm graphs for many effects, still todos
183
184   Revision 1.1  2004/10/11 09:31:06  liekweg
185   First Import of XML reading procs --flo
186
187 */