PIPS
controlizer.c File Reference
#include <stdio.h>
#include <strings.h>
#include "linear.h"
#include "genC.h"
#include "ri.h"
#include "ri-util.h"
#include "control.h"
#include "properties.h"
#include "misc.h"
#include "constants.h"
+ Include dependency graph for controlizer.c:

Go to the source code of this file.

Macros

#define LABEL_TABLES_SIZE   10
 

Functions

static control make_conditional_control (statement st)
 In C, we can have some "goto" inside a block from outside, that translates as any complex control graph into an "unstructured" in the PIPS jargon. More...
 
static control get_label_control (string name)
 Get the control node associated to a label name. More...
 
static void update_used_labels (hash_table used_labels, string name, statement st)
 Mark a statement as related to a label. More...
 
static hash_table union_used_labels (hash_table l1, hash_table l2)
 Unions 2 hash maps that list statements referencing labels into one. More...
 
static bool covers_labels_p (statement st, hash_table used_labels)
 Compute whether all the label references in a statement are in a given label name to statement list local mapping. More...
 
static void create_statements_of_label (statement st)
 Update the global module-level Label_statements table according to the labels a statement references. More...
 
static void create_statements_of_labels (statement st)
 Initialize the global Label_statements mapping for the module that associates for any label in the module the statements that refer to it. More...
 
statement unsugared_loop_header (statement sl)
 LOOP_HEADER, LOOP_TEST and LOOP_INC build the desugaring phases of a do-loop L for the loop header (i=1), the test (i<10) and the increment (i=i+1). More...
 
statement unsugared_forloop_header (statement sl)
 
statement unsugared_whileloop_header (statement sl __attribute__((__unused__)))
 
statement unsugared_loop_test (statement sl)
 Do a crude test of end of do-loop for do-loop unsugaring. More...
 
statement unsugared_forloop_test (statement sl)
 
statement unsugared_whileloop_test (statement sl)
 
statement unsugared_loop_inc (statement sl)
 Do an index increment instruction for do-loop unsugaring. More...
 
statement unsugared_forloop_inc (statement sl)
 
static bool controlize_loop (control c_res, control succ, hash_table used_labels)
 Computes the control graph of a Fortran do-loop statement. More...
 
static bool controlize_forloop (control c_res, control succ, hash_table used_labels)
 Computes the control graph of a C for loop statement. More...
 
static bool controlize_whileloop (control c_res, control succ, hash_table used_labels)
 Computes the control graph of a Fortran or C while loop statement. More...
 
static bool controlize_repeatloop (control c_res, control succ, hash_table used_labels)
 Computes the control graph of a C repeat until loop statement. More...
 
static void move_declaration_control_node_declarations_to_statement (list ctls)
 Move all the declarations found in a list of control to a given statement. More...
 
control find_exit_control_node (list ctls, control succ)
 Find the exit node of a sub-CFG defined by the list of nodes ctls and by the first node to execute when finished. More...
 
control find_or_create_exit_control_node (list ctls, control succ)
 FI: remake of function above, incomplete backward approach, now obsolete because the forward approach works. More...
 
static bool controlize_sequence (control c_res, control succ, hash_table used_labels)
 Computes the control graph of a sequence statement. More...
 
static bool controlize_test (control c_res, control succ, hash_table used_labels)
 Builds the control node of a test statement. More...
 
static bool controlize_goto (control c_res, control succ, hash_table used_labels)
 Deal with "goto" when building the HCFG. More...
 
static bool controlize_call (control c_res, control succ)
 Controlize a call statement. More...
 
bool controlize_statement (control c_res, control succ, hash_table used_labels)
 Controlize a statement that is in a control node, that is restructure it to have a HCFG recursively (a hierarchical control flow graph). More...
 
statement hcfg (statement st)
 Compute the hierarchical control flow graph (HCFG) of a statement. More...
 

Variables

char vcid_control_controlizer [] = "$Id: controlizer.c 23065 2016-03-02 09:05:50Z coelho $"
 There are some TODO !!! RK. More...
 
static hash_table Label_statements
 This maps label names to the list of statements where they appear (either as definition or reference). More...
 
static hash_table Label_control
 This maps label names to their (possible forward) control nodes. More...
 

Variable Documentation

◆ vcid_control_controlizer

char vcid_control_controlizer[] = "$Id: controlizer.c 23065 2016-03-02 09:05:50Z coelho $"

There are some TODO !!! RK.

cproto-generated files

Definition at line 40 of file controlizer.c.