PIPS
control.c File Reference
#include "local.h"
+ Include dependency graph for control.c:

Go to the source code of this file.

Functions

void modify_blocks (control c)
 – control.c More...
 
void atom_get_blocs (c, l)
 =========================================================================== More...
 
control find_control_block (control c)
 =========================================================================== More...
 

Function Documentation

◆ atom_get_blocs()

void atom_get_blocs ( ,
 
)

===========================================================================

void atom_get_blocs(control c, cons **l): Almost the get_blocs() of the file control/control.h; the only modification is the call to modify_blocks() which adds a node to the control graph that will contain the instructions created by the translation of the statement contained in "c".

Definition at line 85 of file control.c.

88 {
89 MAPL( cs, {if( CONTROL( CAR( cs )) == c ) return ;}, *l ) ;
90 *l = CONS( CONTROL, c, *l ) ;
91 
92 modify_blocks(c);
93 
94 MAPL( cs, {atom_get_blocs( CONTROL( CAR( cs )), l );},
95  control_successors( c )) ;
96 
97 MAPL( ps, {atom_get_blocs( CONTROL( CAR( ps )), l );},
98  control_predecessors( c )) ;
99 }
void atom_get_blocs(c, l)
===========================================================================
Definition: control.c:85
void modify_blocks(control c)
– control.c
Definition: control.c:51
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
#define control_predecessors(x)
Definition: ri.h:943
#define CONTROL(x)
CONTROL.
Definition: ri.h:910
#define control_successors(x)
Definition: ri.h:945

References CAR, CONS, CONTROL, control_predecessors, control_successors, MAPL, and modify_blocks().

+ Here is the call graph for this function:

◆ find_control_block()

control find_control_block ( control  c)

===========================================================================

control find_control_block(control c): Returns the current control found in the static variable "cont_block".

The use of this function is: _ first, in order to initialize the static "cont_block" this function is called with the control we want to memorize. _ then, when we need to get this control, this function is called with the argument "control_undefined".

This is used by atomizer_of_statement() when we generate new statements.

Definition at line 115 of file control.c.

117 {
118 static control cont_block;
119 
120 if(c != control_undefined)
121  {
124  cont_block = CONTROL(CAR(control_predecessors(c)));
125  else
126  cont_block = control_undefined;
127  }
128 
129 return(cont_block);
130 }
#define is_instruction_block
soft block->sequence transition
#define control_undefined
Definition: ri.h:916
#define instruction_tag(x)
Definition: ri.h:1511
#define statement_instruction(x)
Definition: ri.h:2458
#define control_statement(x)
Definition: ri.h:941

References CAR, CONTROL, control_predecessors, control_statement, control_undefined, instruction_tag, is_instruction_block, and statement_instruction.

Referenced by atomizer_of_statement(), and atomizer_of_unstructured().

+ Here is the caller graph for this function:

◆ modify_blocks()

void modify_blocks ( control  c)

– control.c

control.c

package atomizer : Alexis Platonoff, juillet 91

Functions for the manipulations and modifications of the control graph. =========================================================================== void modify_blocks(control c): Adds a node to the control graph when the statement of "c" is not an "instruction_block".

This node is added just before "c". "c" predecessor became the new node. The latter's predecessors are those of "c", its successor is "c".

"l_inst" keep the reference to the instructions for which a new node is added. It is a global variable that will be used when we will generate new statements (see atomizer_of_statement(), in atomizer.c).

Called functions : _ make_empty_statement() : ri-util/statement.c

Definition at line 51 of file control.c.

53 {
54 extern list l_inst;
55 
56 control nc;
58 
60  {
61  if (! instruction_in_list_p(inst, l_inst))
62  {
65 
68 
70 
71  l_inst = CONS(INSTRUCTION, inst, l_inst);
72  }
73  }
74 }
control make_control(statement a1, list a2, list a3)
Definition: ri.c:523
list l_inst
The list "first" is a truncated list from the first to the current statement (not included).
Definition: atomizer.h:87
bool instruction_in_list_p(instruction, list)
utils.c
Definition: utils.c:50
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define make_empty_statement
An alias for make_empty_block_statement.
#define INSTRUCTION(x)
INSTRUCTION.
Definition: ri.h:1448
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References CONS, CONTROL, control_predecessors, control_statement, control_successors, INSTRUCTION, instruction_in_list_p(), instruction_tag, is_instruction_block, l_inst, make_control(), make_empty_statement, NIL, and statement_instruction.

Referenced by atom_get_blocs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: