libFirm
irgraph.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 
25 #ifndef FIRM_IR_IRGRAPH_H
26 #define FIRM_IR_IRGRAPH_H
27 
28 #include <stddef.h>
29 
30 #include "firm_types.h"
31 #include "begin.h"
32 
149 FIRM_API ir_graph *new_ir_graph(ir_entity *ent, int n_loc);
150 
159 FIRM_API void free_ir_graph(ir_graph *irg);
160 
169 FIRM_API int is_ir_graph(const void *thing);
170 
174 FIRM_API void set_irg_entity(ir_graph *irg, ir_entity *ent);
175 
180 
184 FIRM_API void set_irg_start_block(ir_graph *irg, ir_node *node);
185 
189 FIRM_API void set_irg_start(ir_graph *irg, ir_node *node);
190 
194 FIRM_API void set_irg_end_block(ir_graph *irg, ir_node *node);
195 
197 FIRM_API ir_node *get_irg_end(const ir_graph *irg);
199 FIRM_API void set_irg_end(ir_graph *irg, ir_node *node);
200 
206 
210 FIRM_API void set_irg_frame(ir_graph *irg, ir_node *node);
211 
215 FIRM_API void set_irg_initial_mem(ir_graph *irg, ir_node *node);
216 
220 FIRM_API void set_irg_args(ir_graph *irg, ir_node *node);
221 
225 FIRM_API void set_irg_no_mem(ir_graph *irg, ir_node *node);
226 
229 
231 FIRM_API long get_irg_graph_nr(const ir_graph *irg);
232 
238 FIRM_API size_t get_irg_idx(const ir_graph *irg);
239 
249 FIRM_API ir_node *get_idx_irn(const ir_graph *irg, unsigned idx);
250 
259 
267 typedef enum {
268  irg_callee_info_none,
269  irg_callee_info_consistent,
270  irg_callee_info_inconsistent
272 
275 
278 
280 FIRM_API void set_irg_link(ir_graph *irg, void *thing);
282 FIRM_API void *get_irg_link(const ir_graph *irg);
283 
298 FIRM_API void set_max_irg_visited(int val);
302 
312 
318 typedef enum ir_resources_t {
328 
329 #ifndef NDEBUG
330 
339 FIRM_API void ir_free_resources(ir_graph *irg, ir_resources_t resources);
342 #else
343 #define ir_reserve_resources(irg,resources) (void)0
344 #define ir_free_resources(irg,resources) (void)0
345 #define ir_resources_reserved(irg) 0
346 #endif
347 
394 
395 
397  ir_graph_constraints_t constraints);
400  ir_graph_constraints_t constraints);
402 FIRM_API int irg_is_constrained(const ir_graph *irg,
403  ir_graph_constraints_t constraints);
404 
410 typedef enum ir_graph_properties_t {
411  IR_GRAPH_PROPERTIES_NONE = 0,
445 
458 
470 
473 
474 
479 FIRM_API int irg_has_properties(const ir_graph *irg,
480  ir_graph_properties_t props);
481 
483 FIRM_API void set_irg_loc_description(ir_graph *irg, int n, void *description);
484 
486 FIRM_API void *get_irg_loc_description(ir_graph *irg, int n);
487 
491 FIRM_API unsigned get_irg_estimated_node_cnt(const ir_graph *irg);
492 
494 FIRM_API unsigned get_irg_last_idx(const ir_graph *irg);
495 
497 FIRM_API unsigned get_irg_fp_model(const ir_graph *irg);
498 
500 FIRM_API void set_irg_fp_model(ir_graph *irg, unsigned model);
501 
507 
514 
524 #define get_irg_data(graph,type,off) \
525  (assert(off > 0 && "Invalid graph data offset"), (type *) ((char *) (graph) - (off)))
526 
533 #define get_irg_data_base(data,off) \
534  (assert(off > 0 && "Invalid graph data offset"), (ir_graph *) ((char *) (data) + (off)))
535 
543 FIRM_API size_t register_additional_graph_data(size_t size);
544 
547 #include "end.h"
548 
549 #endif