remove extended basic block support
[libfirm] / ir / ir / irgraph.c
1 /*
2  * Copyright (C) 1995-2011 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    Entry point to the representation of procedure code.
23  * @author   Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
24  */
25 #include "config.h"
26
27 #include <string.h>
28 #include <stddef.h>
29
30 #include "xmalloc.h"
31 #include "ircons_t.h"
32 #include "irgraph_t.h"
33 #include "irprog_t.h"
34 #include "irgraph_t.h"
35 #include "irnode_t.h"
36 #include "iropt_t.h"
37 #include "irflag_t.h"
38 #include "array.h"
39 #include "irgmod.h"
40 #include "irouts.h"
41 #include "irhooks.h"
42 #include "irtools.h"
43 #include "util.h"
44 #include "irgwalk.h"
45 #include "irbackedge_t.h"
46 #include "iredges_t.h"
47 #include "type_t.h"
48 #include "irmemory.h"
49
50 #define INITIAL_IDX_IRN_MAP_SIZE 1024
51
52 /**
53  * Indicates, whether additional data can be registered to graphs.
54  * If set to 1, this is not possible anymore.
55  */
56 static int forbid_new_data = 0;
57
58 /**
59  * The amount of additional space for custom data to be allocated upon
60  * creating a new graph.
61  */
62 static size_t additional_graph_data_size = 0;
63
64 ir_graph *current_ir_graph;
65 ir_graph *get_current_ir_graph(void)
66 {
67         return current_ir_graph;
68 }
69
70 void set_current_ir_graph(ir_graph *graph)
71 {
72         current_ir_graph = graph;
73 }
74
75 /** contains the suffix for frame type names */
76 static ident *frame_type_suffix = NULL;
77
78 void firm_init_irgraph(void)
79 {
80         frame_type_suffix = new_id_from_str(FRAME_TP_SUFFIX);
81         forbid_new_data   = 1;
82 }
83
84 /**
85  * Allocate a new IR graph.
86  * This function respects the registered graph data. The only reason for
87  * this function is, that there are two locations, where graphs are
88  * allocated (new_r_ir_graph, new_const_code_irg).
89  * @return Memory for a new graph.
90  */
91 static ir_graph *alloc_graph(void)
92 {
93         ir_graph *res;
94         size_t   size = sizeof(ir_graph) + additional_graph_data_size;
95         char     *ptr = XMALLOCNZ(char, size);
96
97         res = (ir_graph *)(ptr + additional_graph_data_size);
98         res->kind = k_ir_graph;
99
100         /* initialize the idx->node map. */
101         res->idx_irn_map = NEW_ARR_F(ir_node *, INITIAL_IDX_IRN_MAP_SIZE);
102         memset(res->idx_irn_map, 0, INITIAL_IDX_IRN_MAP_SIZE * sizeof(res->idx_irn_map[0]));
103
104         return res;
105 }
106
107 /**
108  * Frees an allocated IR graph
109  */
110 static void free_graph(ir_graph *irg)
111 {
112         char           *ptr = (char *)irg;
113         ir_edge_kind_t  i;
114
115         for (i = EDGE_KIND_FIRST; i < EDGE_KIND_LAST; ++i)
116                 edges_deactivate_kind(irg, i);
117         DEL_ARR_F(irg->idx_irn_map);
118         free(ptr - additional_graph_data_size);
119 }
120
121 void irg_set_nloc(ir_graph *res, int n_loc)
122 {
123         assert(res->phase_state == phase_building);
124
125         res->n_loc = n_loc + 1;     /* number of local variables that are never
126                                        dereferenced in this graph plus one for
127                                        the store. This is not the number of
128                                        parameters to the procedure!  */
129
130         if (res->loc_descriptions) {
131                 xfree(res->loc_descriptions);
132                 res->loc_descriptions = NULL;
133         }
134 }
135
136 ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc)
137 {
138         ir_graph *res;
139         ir_node  *first_block;
140         ir_node  *start, *start_block, *initial_mem, *projX;
141
142         res = alloc_graph();
143
144         /* inform statistics here, as blocks will be already build on this graph */
145         hook_new_graph(res, ent);
146
147         /*-- initialized for each graph. --*/
148         res->kind = k_ir_graph;
149         res->obst = XMALLOC(struct obstack);
150         obstack_init(res->obst);
151
152         res->phase_state = phase_building;
153         irg_set_nloc(res, n_loc);
154
155         /* descriptions will be allocated on demand */
156         res->loc_descriptions = NULL;
157
158         res->visited       = 0; /* visited flag, for the ir walker */
159         res->block_visited = 0; /* visited flag, for the 'block'-walker */
160
161         res->last_node_idx = 0;
162
163         new_identities(res);
164         res->outs = NULL;
165
166         res->inline_property       = irg_inline_any;
167         res->additional_properties = mtp_property_inherited;  /* inherited from type */
168
169         res->irg_pinned_state    = op_pin_state_pinned;
170         res->typeinfo_state      = ir_typeinfo_none;
171         set_irp_typeinfo_inconsistent();           /* there is a new graph with typeinfo_none. */
172         res->callee_info_state   = irg_callee_info_none;
173         res->class_cast_state    = ir_class_casts_transitive;
174         res->fp_model            = fp_model_precise;
175         res->mem_disambig_opt    = aa_opt_inherited;
176
177         /*-- Type information for the procedure of the graph --*/
178         res->ent = ent;
179         set_entity_irg(ent, res);
180
181         /*--  a class type so that it can contain "inner" methods as in Pascal. --*/
182         res->frame_type = new_type_frame();
183
184         /* the Anchor node must be created first */
185         res->anchor = new_r_Anchor(res);
186
187         /*-- Nodes needed in every graph --*/
188         set_irg_end_block(res, new_r_immBlock(res));
189         set_irg_end(res, new_r_End(res, 0, NULL));
190
191         start_block = new_r_Block_noopt(res, 0, NULL);
192         set_irg_start_block(res, start_block);
193         set_irg_no_mem     (res, new_r_NoMem(res));
194         start = new_r_Start(res);
195         set_irg_start      (res, start);
196
197         /* Proj results of start node */
198         projX                   = new_r_Proj(start, mode_X, pn_Start_X_initial_exec);
199         set_irg_initial_exec    (res, projX);
200         set_irg_frame           (res, new_r_Proj(start, mode_P_data, pn_Start_P_frame_base));
201         set_irg_args            (res, new_r_Proj(start, mode_T,      pn_Start_T_args));
202         initial_mem             = new_r_Proj(start, mode_M, pn_Start_M);
203         set_irg_initial_mem(res, initial_mem);
204
205         res->index       = get_irp_new_irg_idx();
206 #ifdef DEBUG_libfirm
207         res->graph_nr    = get_irp_new_node_nr();
208 #endif
209
210         set_r_cur_block(res, start_block);
211         set_r_store(res, initial_mem);
212
213         /*-- Make a block to start with --*/
214         first_block = new_r_Block(res, 1, &projX);
215         set_r_cur_block(res, first_block);
216
217         res->method_execution_frequency = -1.0;
218         res->estimated_node_count       = 0;
219
220         return res;
221 }
222
223 ir_graph *new_ir_graph(ir_entity *ent, int n_loc)
224 {
225         ir_graph *res = new_r_ir_graph(ent, n_loc);
226         add_irp_irg(res);          /* remember this graph global. */
227         return res;
228 }
229
230 ir_graph *new_const_code_irg(void)
231 {
232         ir_graph *res = alloc_graph();
233         ir_node  *body_block;
234         ir_node  *end;
235         ir_node  *end_block;
236         ir_node  *no_mem;
237         ir_node  *projX;
238         ir_node  *start_block;
239         ir_node  *start;
240
241         /* inform statistics here, as blocks will be already build on this graph */
242         hook_new_graph(res, NULL);
243
244         res->n_loc         = 1; /* Only the memory. */
245         res->visited       = 0; /* visited flag, for the ir walker */
246         res->block_visited = 0; /* visited flag, for the 'block'-walker */
247         res->obst          = XMALLOC(struct obstack);
248         obstack_init(res->obst);
249
250         res->last_node_idx = 0;
251
252         res->phase_state      = phase_building;
253         res->irg_pinned_state = op_pin_state_pinned;
254         res->fp_model         = fp_model_precise;
255
256         /* value table for global value numbering for optimizing use in iropt.c */
257         new_identities(res);
258         res->ent         = NULL;
259         res->frame_type  = NULL;
260
261         /* the Anchor node must be created first */
262         res->anchor = new_r_Anchor(res);
263
264         /* -- The end block -- */
265         end_block = new_r_Block_noopt(res, 0, NULL);
266         set_irg_end_block(res, end_block);
267         end = new_r_End(res, 0, NULL);
268         set_irg_end(res, end);
269
270         /* -- The start block -- */
271         start_block = new_r_Block_noopt(res, 0, NULL);
272         set_irg_start_block(res, start_block);
273         no_mem = new_r_NoMem(res);
274         set_irg_no_mem(res, no_mem);
275         start = new_r_Start(res);
276         set_irg_start(res, start);
277
278         /* Proj results of start node */
279         set_irg_initial_mem(res, new_r_Proj(start, mode_M, pn_Start_M));
280         projX = new_r_Proj(start, mode_X, pn_Start_X_initial_exec);
281
282         body_block = new_r_Block(res, 1, &projX);
283
284         set_r_cur_block(res, body_block);
285
286         /* Set the visited flag high enough that the blocks will never be visited. */
287         set_irn_visited(body_block, -1);
288         set_Block_block_visited(body_block, -1);
289         set_Block_block_visited(start_block, -1);
290         set_irn_visited(start_block, -1);
291
292         return res;
293 }
294
295 /**
296  * Pre-Walker: Copies blocks and nodes from the original method graph
297  * to the copied graph.
298  *
299  * @param n    A node from the original method graph.
300  * @param env  The copied graph.
301  */
302 static void copy_all_nodes(ir_node *node, void *env)
303 {
304         ir_graph *irg      = (ir_graph*)env;
305         ir_node  *new_node = irn_copy_into_irg(node, irg);
306
307         set_irn_link(node, new_node);
308
309         /* fix access to entities on the stack frame */
310         if (is_Sel(new_node)) {
311                 ir_entity *ent = get_Sel_entity(new_node);
312                 ir_type   *tp  = get_entity_owner(ent);
313
314                 if (is_frame_type(tp)) {
315                         /* replace by the copied entity */
316                         ent = (ir_entity*)get_entity_link(ent);
317
318                         assert(is_entity(ent));
319                         assert(get_entity_owner(ent) == get_irg_frame_type(irg));
320                         set_Sel_entity(new_node, ent);
321                 }
322         }
323 }
324
325 /**
326  * Post-walker: Set the predecessors of the copied nodes.
327  * The copied nodes are set as link of their original nodes. The links of
328  * "irn" predecessors are the predecessors of copied node.
329  */
330 static void rewire(ir_node *irn, void *env)
331 {
332         (void) env;
333         irn_rewire_inputs(irn);
334 }
335
336 static ir_node *get_new_node(const ir_node *old_node)
337 {
338         return (ir_node*) get_irn_link(old_node);
339 }
340
341 ir_graph *create_irg_copy(ir_graph *irg)
342 {
343         ir_graph *res;
344
345         res = alloc_graph();
346
347         res->n_loc = 0;
348         res->visited = 0;       /* visited flag, for the ir walker */
349         res->block_visited = 0; /* visited flag, for the 'block'-walker */
350         res->obst       = XMALLOC(struct obstack);
351         obstack_init(res->obst);
352
353         res->last_node_idx = 0;
354
355         res->phase_state      = irg->phase_state;
356         res->irg_pinned_state = irg->irg_pinned_state;
357         res->fp_model         = irg->fp_model;
358
359         new_identities(res);
360
361         /* clone the frame type here for safety */
362         irp_reserve_resources(irp, IRP_RESOURCE_ENTITY_LINK);
363         res->frame_type  = clone_frame_type(irg->frame_type);
364
365         res->phase_state = irg->phase_state;
366
367         ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
368
369         /* copy all nodes from the graph irg to the new graph res */
370         irg_walk_anchors(irg, copy_all_nodes, rewire, res);
371
372         /* copy the Anchor node */
373         res->anchor = get_new_node(irg->anchor);
374
375         /* -- The end block -- */
376         set_irg_end_block (res, get_new_node(get_irg_end_block(irg)));
377         set_irg_end       (res, get_new_node(get_irg_end(irg)));
378
379         /* -- The start block -- */
380         set_irg_start_block(res, get_new_node(get_irg_start_block(irg)));
381         set_irg_no_mem     (res, get_new_node(get_irg_no_mem(irg)));
382         set_irg_start      (res, get_new_node(get_irg_start(irg)));
383
384         /* Proj results of start node */
385         set_irg_initial_mem(res, get_new_node(get_irg_initial_mem(irg)));
386
387         /* Copy the node count estimation. Would be strange if this
388            is different from the original one. */
389         res->estimated_node_count = irg->estimated_node_count;
390
391         ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
392         irp_free_resources(irp, IRP_RESOURCE_ENTITY_LINK);
393
394         return res;
395 }
396
397 void free_ir_graph(ir_graph *irg)
398 {
399         assert(is_ir_graph(irg));
400
401         edges_deactivate(irg);
402
403         hook_free_graph(irg);
404         free_irg_outs(irg);
405         del_identities(irg);
406         if (irg->ent) {
407                 set_entity_irg(irg->ent, NULL);  /* not set in const code irg */
408         }
409
410         free_End(get_irg_end(irg));
411         obstack_free(irg->obst, NULL);
412         free(irg->obst);
413         if (irg->loc_descriptions)
414                 free(irg->loc_descriptions);
415         irg->kind = k_BAD;
416         free_graph(irg);
417 }
418
419 int (is_ir_graph)(const void *thing)
420 {
421         return is_ir_graph_(thing);
422 }
423
424 #ifdef DEBUG_libfirm
425 long get_irg_graph_nr(const ir_graph *irg)
426 {
427         return irg->graph_nr;
428 }
429 #else
430 long get_irg_graph_nr(const ir_graph *irg)
431 {
432         return PTR_TO_INT(irg);
433 }
434 #endif
435
436 size_t get_irg_idx(const ir_graph *irg)
437 {
438         return irg->index;
439 }
440
441 ir_node *(get_idx_irn)(const ir_graph *irg, unsigned idx)
442 {
443         return get_idx_irn_(irg, idx);
444 }
445
446 ir_node *(get_irg_start_block)(const ir_graph *irg)
447 {
448         return get_irg_start_block_(irg);
449 }
450
451 void (set_irg_start_block)(ir_graph *irg, ir_node *node)
452 {
453         set_irg_start_block_(irg, node);
454 }
455
456 ir_node *(get_irg_start)(const ir_graph *irg)
457 {
458         return get_irg_start_(irg);
459 }
460
461 void (set_irg_start)(ir_graph *irg, ir_node *node)
462 {
463         set_irg_start_(irg, node);
464 }
465
466 ir_node *(get_irg_end_block)(const ir_graph *irg)
467 {
468         return get_irg_end_block_(irg);
469 }
470
471 void (set_irg_end_block)(ir_graph *irg, ir_node *node)
472 {
473         set_irg_end_block_(irg, node);
474 }
475
476 ir_node *(get_irg_end)(const ir_graph *irg)
477 {
478         return get_irg_end_(irg);
479 }
480
481 void (set_irg_end)(ir_graph *irg, ir_node *node)
482 {
483         set_irg_end_(irg, node);
484 }
485
486 ir_node *(get_irg_initial_exec)(const ir_graph *irg)
487 {
488         return get_irg_initial_exec_(irg);
489 }
490
491 void (set_irg_initial_exec)(ir_graph *irg, ir_node *node)
492 {
493         set_irg_initial_exec_(irg, node);
494 }
495
496 ir_node *(get_irg_frame)(const ir_graph *irg)
497 {
498         return get_irg_frame_(irg);
499 }
500
501 void (set_irg_frame)(ir_graph *irg, ir_node *node)
502 {
503         set_irg_frame_(irg, node);
504 }
505
506 ir_node *(get_irg_initial_mem)(const ir_graph *irg)
507 {
508         return get_irg_initial_mem_(irg);
509 }
510
511 void (set_irg_initial_mem)(ir_graph *irg, ir_node *node)
512 {
513         set_irg_initial_mem_(irg, node);
514 }
515
516 ir_node *(get_irg_args)(const ir_graph *irg)
517 {
518         return get_irg_args_(irg);
519 }
520
521 void (set_irg_args)(ir_graph *irg, ir_node *node)
522 {
523         set_irg_args_(irg, node);
524 }
525
526 ir_node *(get_irg_no_mem)(const ir_graph *irg)
527 {
528         return get_irg_no_mem_(irg);
529 }
530
531 void (set_irg_no_mem)(ir_graph *irg, ir_node *node)
532 {
533         set_irg_no_mem_(irg, node);
534 }
535
536 ir_entity *(get_irg_entity)(const ir_graph *irg)
537 {
538         return get_irg_entity_(irg);
539 }
540
541 void (set_irg_entity)(ir_graph *irg, ir_entity *ent)
542 {
543         set_irg_entity_(irg, ent);
544 }
545
546 ir_type *(get_irg_frame_type)(ir_graph *irg)
547 {
548         return get_irg_frame_type_(irg);
549 }
550
551 void (set_irg_frame_type)(ir_graph *irg, ir_type *ftp)
552 {
553         set_irg_frame_type_(irg, ftp);
554 }
555
556 int get_irg_n_locs(ir_graph *irg)
557 {
558         return irg->n_loc - 1;
559 }
560
561 struct obstack *(get_irg_obstack)(const ir_graph *irg)
562 {
563         return get_irg_obstack_(irg);
564 }
565
566 int node_is_in_irgs_storage(const ir_graph *irg, const ir_node *n)
567 {
568         struct _obstack_chunk *p;
569
570         /*
571          * checks weather the ir_node pointer is on the obstack.
572          * A more sophisticated check would test the "whole" ir_node
573          */
574         for (p = irg->obst->chunk; p; p = p->prev) {
575                 if (((char *)p->contents <= (char *)n) && ((char *)n < (char *)p->limit))
576                         return 1;
577         }
578
579         return 0;
580 }
581
582 irg_phase_state (get_irg_phase_state)(const ir_graph *irg)
583 {
584         return get_irg_phase_state_(irg);
585 }
586
587 void (set_irg_phase_state)(ir_graph *irg, irg_phase_state state)
588 {
589         set_irg_phase_state_(irg, state);
590 }
591
592 op_pin_state (get_irg_pinned)(const ir_graph *irg)
593 {
594         return get_irg_pinned_(irg);
595 }
596
597 void (set_irg_pinned)(ir_graph *irg, op_pin_state p)
598 {
599         set_irg_pinned_(irg, p);
600 }
601
602 irg_callee_info_state (get_irg_callee_info_state)(const ir_graph *irg)
603 {
604         return get_irg_callee_info_state_(irg);
605 }
606
607 void (set_irg_callee_info_state)(ir_graph *irg, irg_callee_info_state s)
608 {
609         set_irg_callee_info_state_(irg, s);
610 }
611
612 irg_inline_property (get_irg_inline_property)(const ir_graph *irg)
613 {
614         return get_irg_inline_property_(irg);
615 }
616
617 void (set_irg_inline_property)(ir_graph *irg, irg_inline_property s)
618 {
619         set_irg_inline_property_(irg, s);
620 }
621
622 mtp_additional_properties (get_irg_additional_properties)(const ir_graph *irg)
623 {
624         return get_irg_additional_properties_(irg);
625 }
626
627 void (set_irg_additional_properties)(ir_graph *irg, mtp_additional_properties property_mask)
628 {
629         set_irg_additional_properties_(irg, property_mask);
630 }
631
632 void (add_irg_additional_properties)(ir_graph *irg, mtp_additional_properties flag)
633 {
634         add_irg_additional_properties_(irg, flag);
635 }
636
637 void (set_irg_link)(ir_graph *irg, void *thing)
638 {
639         set_irg_link_(irg, thing);
640 }
641
642 void *(get_irg_link)(const ir_graph *irg)
643 {
644         return get_irg_link_(irg);
645 }
646
647 ir_visited_t (get_irg_visited)(const ir_graph *irg)
648 {
649         return get_irg_visited_(irg);
650 }
651
652 /** maximum visited flag content of all ir_graph visited fields. */
653 static ir_visited_t max_irg_visited = 0;
654
655 void set_irg_visited(ir_graph *irg, ir_visited_t visited)
656 {
657         irg->visited = visited;
658         if (irg->visited > max_irg_visited) {
659                 max_irg_visited = irg->visited;
660         }
661 }
662
663 void inc_irg_visited(ir_graph *irg)
664 {
665         ++irg->visited;
666         if (irg->visited > max_irg_visited) {
667                 max_irg_visited = irg->visited;
668         }
669 }
670
671 ir_visited_t get_max_irg_visited(void)
672 {
673         return max_irg_visited;
674 }
675
676 void set_max_irg_visited(int val)
677 {
678         max_irg_visited = val;
679 }
680
681 ir_visited_t inc_max_irg_visited(void)
682 {
683 #ifndef NDEBUG
684         size_t i;
685         for (i = 0; i < get_irp_n_irgs(); i++)
686                 assert(max_irg_visited >= get_irg_visited(get_irp_irg(i)));
687 #endif
688         return ++max_irg_visited;
689 }
690
691 ir_visited_t (get_irg_block_visited)(const ir_graph *irg)
692 {
693         return get_irg_block_visited_(irg);
694 }
695
696 void (set_irg_block_visited)(ir_graph *irg, ir_visited_t visited)
697 {
698         set_irg_block_visited_(irg, visited);
699 }
700
701 void (inc_irg_block_visited)(ir_graph *irg)
702 {
703   inc_irg_block_visited_(irg);
704 }
705
706 unsigned (get_irg_fp_model)(const ir_graph *irg)
707 {
708         return get_irg_fp_model_(irg);
709 }
710
711 void set_irg_fp_model(ir_graph *irg, unsigned model)
712 {
713         irg->fp_model = model;
714 }
715
716 void set_irg_loc_description(ir_graph *irg, int n, void *description)
717 {
718         assert(0 <= n && n < irg->n_loc);
719
720         if (! irg->loc_descriptions)
721                 irg->loc_descriptions = XMALLOCNZ(void*, irg->n_loc);
722
723         irg->loc_descriptions[n] = description;
724 }
725
726 void *get_irg_loc_description(ir_graph *irg, int n)
727 {
728         assert(0 <= n && n < irg->n_loc);
729         return irg->loc_descriptions ? irg->loc_descriptions[n] : NULL;
730 }
731
732 #ifndef NDEBUG
733 void ir_reserve_resources(ir_graph *irg, ir_resources_t resources)
734 {
735         assert((irg->reserved_resources & resources) == 0);
736         irg->reserved_resources |= resources;
737 }
738
739 void ir_free_resources(ir_graph *irg, ir_resources_t resources)
740 {
741         assert((irg->reserved_resources & resources) == resources);
742         irg->reserved_resources &= ~resources;
743 }
744
745 ir_resources_t ir_resources_reserved(const ir_graph *irg)
746 {
747         return irg->reserved_resources;
748 }
749 #endif
750
751 unsigned (get_irg_estimated_node_cnt)(const ir_graph *irg)
752 {
753         return get_irg_estimated_node_cnt_(irg);
754 }
755
756 unsigned get_irg_last_idx(const ir_graph *irg)
757 {
758         return irg->last_node_idx;
759 }
760
761 size_t register_additional_graph_data(size_t size)
762 {
763         assert(!forbid_new_data && "Too late to register additional node data");
764
765         if (forbid_new_data)
766                 return 0;
767
768         return additional_graph_data_size += size;
769 }
770
771 void (set_irg_state)(ir_graph *irg, ir_graph_state_t state)
772 {
773         set_irg_state_(irg, state);
774 }
775
776 void (clear_irg_state)(ir_graph *irg, ir_graph_state_t state)
777 {
778         clear_irg_state_(irg, state);
779 }
780
781 int (is_irg_state)(const ir_graph *irg, ir_graph_state_t state)
782 {
783         return is_irg_state_(irg, state);
784 }