libFirm
irprog.h
Go to the documentation of this file.
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 
29 #ifndef FIRM_IR_IRPROG_H
30 #define FIRM_IR_IRPROG_H
31 
32 #include <stddef.h>
33 #include "firm_types.h"
34 #include "irgraph.h"
35 #include "begin.h"
36 
60 typedef enum ir_segment_t {
61  IR_SEGMENT_FIRST,
63  IR_SEGMENT_GLOBAL = IR_SEGMENT_FIRST,
74 
75  IR_SEGMENT_LAST = IR_SEGMENT_DESTRUCTORS
76 } ir_segment_t;
78 
79 
87 
91 typedef enum irp_resources_t {
104 
105 #ifndef NDEBUG
106 
118 #else
119 #define irp_reserve_resources(irp, resources) (void)0
120 #define irp_free_resources(irp, resources) (void)0
121 #define irp_resources_reserved(irp) 0
122 #endif
123 
130 FIRM_API ir_prog *get_irp(void);
131 
133 FIRM_API void set_irp(ir_prog *irp);
134 
141 FIRM_API ir_prog *new_ir_prog(const char *name);
142 
145 FIRM_API void free_ir_prog(void);
146 
149 FIRM_API void set_irp_prog_name(ident *name);
150 
153 
156 
158 FIRM_API const char *get_irp_name(void);
159 
162 
164 FIRM_API void set_irp_main_irg(ir_graph *main_irg);
165 
167 FIRM_API size_t get_irp_last_idx(void);
168 
170 FIRM_API size_t get_irp_n_irgs(void);
171 
173 FIRM_API ir_graph *get_irp_irg(size_t pos);
174 
176 FIRM_API void set_irp_irg(size_t pos, ir_graph *irg);
177 
184 
189 FIRM_API void set_segment_type(ir_segment_t segment, ir_type *new_type);
190 
197 
204 
209 FIRM_API size_t get_irp_n_types(void);
210 
215 FIRM_API ir_type *get_irp_type(size_t pos);
216 
221 FIRM_API void set_irp_type(size_t pos, ir_type *typ);
222 
235 
242 
245 
247 FIRM_API void add_irp_asm(ident *asm_string);
248 
250 FIRM_API size_t get_irp_n_asms(void);
251 
253 FIRM_API ident *get_irp_asm(size_t pos);
254 
257 #include "end.h"
258 
259 #endif