Use separate code to emit suffixes for integer and floating point instructions, becau...
[libfirm] / ir / external / read_t.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief    Read descriptions of external effects, private header
23  * @author   Florian, Boris Boesler
24  * @date     11.10.2004
25  * @version  $Id$
26  */
27 #ifndef FIRM_EXTERNAL_READ_T_H
28 #define FIRM_EXTERNAL_READ_T_H
29
30 #include "firm_types.h"
31
32 /* first, the xml structures */
33
34 typedef struct type_str
35 {
36   ident *type_ident;
37   ident *id;                    /* id for references */
38   ir_type *f_tp;                /* firm type */
39   struct type_str *prev;
40 } type_t;
41
42 typedef struct entity_str
43 {
44   ident *ent_ident;            /* name of entity */
45   ident *tp_ident;             /* name of type/class */
46   ident *id;                   /* id for references */
47   ident *owner;                /* id of owner */
48   ir_entity *f_ent;            /* firm entity */
49   struct entity_str *prev;
50 } entity_t;
51
52 /* now the xml nodes */
53 typedef enum eff_node_kind {
54   eff_arg,      // done
55   eff_valref,   // eliminated
56   eff_select,   // eliminated
57   eff_load,     // done
58   eff_store,    // done
59   eff_alloc,    // done
60   eff_call,     // done
61   eff_unknown,  // done
62   eff_join,     // TODO
63   eff_raise,    // TODO
64   eff_ret       // done
65 } eff_node_kind_t;
66
67
68 typedef struct arg_str
69 {
70   ident *type_ident;
71   int num;
72 } arg_t;
73
74 typedef struct valref_str
75 {
76   int dummy;
77 } valref_t;
78
79 typedef struct select_str
80 {
81   entity_t *ent;
82 } select_t;
83
84 typedef struct load_str
85 {
86   ident *ptrrefid;     /* id of valref node enclosed in select, or -1 */
87   entity_t *ent;
88 } load_t;
89
90 typedef struct store_str
91 {
92   ident *ptrrefid;     /* id of ptr valref node enclosed in select, or -1 */
93   ident *valrefid;     /* id of val valref node enclosed in select, or -1 */
94   entity_t *ent;
95 } store_t;
96
97 typedef struct alloc_str
98 {
99   ident *tp_id;
100 } alloc_t;
101
102 typedef struct call_str
103 {
104   ident *valrefid;     /* id of enclosed valref node, or -1 */
105   entity_t *ent;       /* called entity */
106   int n_args;
107   ident **args;
108 } call_t;
109
110 typedef struct unknown_str
111 {
112   int dummy;
113 } unknown_t;
114
115 typedef struct join_str
116 {
117   int n_ins;
118   ident **ins;
119 } join_t;
120
121 typedef struct ret_str
122 {
123   ident *ret_id;
124 } ret_t;                     /* returned value, or NO_ID */
125
126 typedef struct raise_str
127 {
128   ident *valref;       /* what was that one for? */
129   ident *tp_id;
130 } raise_t;
131
132 /* dummy type for all other effects */
133 typedef struct eff_str
134 {
135   eff_node_kind_t kind;
136   ident *id;           /* identifier to access this node */
137   union {
138     arg_t arg;
139     valref_t valref;
140     select_t select;
141     load_t load;
142     store_t store;
143     alloc_t alloc;
144     call_t call;
145     unknown_t unknown;
146     join_t join;
147     ret_t ret;
148     raise_t raise;
149   } effect;
150   ir_node *firmnode;
151   struct eff_str *next; /* effects with values are stored in proc.values */
152 } eff_t;
153
154 typedef struct proc_str
155 {
156   ident *proc_ident;         /* name of procedure */
157   ident *ownerid;
158   int n_effs;
159   eff_t **effs;
160   struct proc_str *next;
161   eff_t *values;             /* @@@ TODO hash set */
162 } proc_t;
163
164
165 typedef struct mod_str
166 {
167   ident *id;
168   type_t *types;             /* types in module *//* @@@ TODO hash set */
169   entity_t *entities;        /* entities in module *//* @@@ TODO hash set */
170   proc_t *procs;             /* methods with effects */
171   struct mod_str *next;      /* unused - only one module possible */
172 } module_t;
173
174 #endif
175
176 /*
177   $Log$
178   Revision 1.5  2007/02/02 12:38:35  matze
179   entity is ir_entity now
180
181   Revision 1.4  2006/12/15 12:37:40  matze
182   fix warnings
183
184   Revision 1.3  2006/06/09 11:26:35  firm
185   renamed type to ir_type
186
187   Revision 1.2  2004/12/10 15:14:16  beck
188   Removed unused header files
189   move xml macros to read.c, freeing the header from libxml depency
190
191   Revision 1.1  2004/10/25 13:52:24  boesler
192   seperated read.h (public interface) and read_t.h (types)
193
194   Revision 1.6  2004/10/22 13:13:27  boesler
195   replaced char* by idents, minor fix in Firm codegen for call
196
197   Revision 1.5  2004/10/21 15:31:55  boesler
198   added lots of stuff:
199   - build abstract syntax trees
200   - build Firm graphs for many effects, still todos
201
202   Revision 1.1  2004/10/11 09:31:06  liekweg
203   First Import of XML reading procs --flo
204
205 */