3 * Copyright (C) 2002-2007, The Perl Foundation.
9 /* Two-way linked list of predecessors and successors */
10 #ifndef PARROT_CFG_H_GUARD
11 #define PARROT_CFG_H_GUARD
13 typedef struct _edge
{
14 struct _basic_block
*from
;
15 struct _edge
*pred_next
;
17 struct _basic_block
*to
;
18 struct _edge
*succ_next
;
23 typedef struct _basic_block
{
24 Instruction
*start
; /* First instruction in basic block */
25 Instruction
*end
; /* Last instruction in basic block */
29 int index
; /*on bb_list*/
33 EXTERN
enum block_enum_flags_t
{
38 typedef struct _loop_info
{
39 Set
* loop
; /* loop set containg bb's */
40 Set
* exits
; /* blocks that exit the loop */
41 int depth
; /* depth of this loop */
42 int n_entries
; /* nr of entries to this loop */
43 int header
; /* header block of loop */
44 int preheader
; /* preheader block of loop, if 1 entry point */
45 int size
; /* no of blocks in loop */
52 /* HEADERIZER BEGIN: compilers/imcc/cfg.c */
53 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
55 PARROT_WARN_UNUSED_RESULT
56 int blocks_are_connected(
57 ARGIN(const Basic_block
*from
),
58 ARGIN(const Basic_block
*to
))
59 __attribute__nonnull__(1)
60 __attribute__nonnull__(2);
62 void build_cfg(PARROT_INTERP
, ARGMOD(struct _IMC_Unit
*unit
))
63 __attribute__nonnull__(1)
64 __attribute__nonnull__(2)
67 void clear_basic_blocks(ARGMOD(struct _IMC_Unit
*unit
))
68 __attribute__nonnull__(1)
71 void compute_dominance_frontiers(PARROT_INTERP
,
72 ARGMOD(struct _IMC_Unit
*unit
))
73 __attribute__nonnull__(1)
74 __attribute__nonnull__(2)
77 void compute_dominators(PARROT_INTERP
, ARGMOD(struct _IMC_Unit
*unit
))
78 __attribute__nonnull__(1)
79 __attribute__nonnull__(2)
82 PARROT_WARN_UNUSED_RESULT
83 int edge_count(ARGIN(const struct _IMC_Unit
*unit
))
84 __attribute__nonnull__(1);
86 void find_basic_blocks(PARROT_INTERP
,
87 ARGMOD(struct _IMC_Unit
*unit
),
89 __attribute__nonnull__(1)
90 __attribute__nonnull__(2)
93 void find_loops(PARROT_INTERP
, ARGMOD(struct _IMC_Unit
*unit
))
94 __attribute__nonnull__(1)
95 __attribute__nonnull__(2)
98 void free_life_info(ARGIN(const struct _IMC_Unit
*unit
), ARGMOD(SymReg
*r
))
99 __attribute__nonnull__(1)
100 __attribute__nonnull__(2)
103 void life_analysis(PARROT_INTERP
, ARGIN(const struct _IMC_Unit
*unit
))
104 __attribute__nonnull__(1)
105 __attribute__nonnull__(2);
108 PARROT_CANNOT_RETURN_NULL
109 Life_range
* make_life_range(ARGMOD(SymReg
*r
), int idx
)
110 __attribute__nonnull__(1)
113 PARROT_WARN_UNUSED_RESULT
114 int natural_preheader(
115 ARGIN(const struct _IMC_Unit
*unit
),
116 ARGIN(const Loop_info
* loop_info
))
117 __attribute__nonnull__(1)
118 __attribute__nonnull__(2);
120 void search_predecessors_not_in(
121 ARGIN(const Basic_block
*node
),
123 __attribute__nonnull__(1)
124 __attribute__nonnull__(2)
127 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
128 /* HEADERIZER END: compilers/imcc/cfg.c */
130 #endif /* PARROT_CFG_H_GUARD */
135 * c-file-style: "parrot"
137 * vim: expandtab shiftwidth=4: