PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "pipsdbm.h"
#include "ri-util.h"
#include "control.h"
Go to the source code of this file.
Data Structures | |
struct | acc_ctx |
Add Control Counter recursion context. More... | |
Functions | |
static statement | make_increment_statement (entity module, entity var) |
generate: var = var + 1 (Fortran) or var++ (C) More... | |
static entity | create_counter (entity module, const string name) |
create a new integer local variable in module using name as a prefix More... | |
static void | add_counter (acc_ctx *c, string name, statement s) |
add a new counter at entry of statement s More... | |
static void | test_rwt (test t, acc_ctx *c) |
add a counter to each branch of the test More... | |
static void | loop_rwt (loop l, acc_ctx *c) |
add a counter to the loop body More... | |
static void | whileloop_rwt (whileloop w, acc_ctx *c) |
add a counter to the loop body More... | |
static void | forloop_rwt (forloop f, acc_ctx *c) |
add a counter to the loop body More... | |
static void | add_counters (entity module, statement root) |
add control counter instrumentation assumes current module entity & statement are okay. More... | |
bool | add_control_counters (const string module_name) |
instrument a module with control structure counters for test & loops More... | |
instrument a module with control structure counters for test & loops
module_name | odule_name |
Definition at line 137 of file control_counters.c.
References add_counters(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, module, module_name(), module_name_to_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), and set_current_module_statement().
add a new counter at entry of statement s
Definition at line 85 of file control_counters.c.
References create_counter(), insert_statement(), make_increment_statement(), and acc_ctx::module.
Referenced by forloop_rwt(), loop_rwt(), test_rwt(), and whileloop_rwt().
add control counter instrumentation assumes current module entity & statement are okay.
Definition at line 123 of file control_counters.c.
References forloop_domain, forloop_rwt(), gen_context_multi_recurse(), gen_true(), loop_domain, loop_rwt(), module, test_domain, test_rwt(), whileloop_domain, and whileloop_rwt().
Referenced by add_control_counters().
create a new integer local variable in module using name as a prefix
Definition at line 66 of file control_counters.c.
References AddEntityToCurrentModule(), concatenate(), entity_initial, free(), free_value(), full, int_to_expression(), make_basic_int(), make_new_scalar_variable_with_prefix(), make_value_expression(), module, and strdup().
Referenced by add_counter().
add a counter to the loop body
Definition at line 115 of file control_counters.c.
References add_counter(), f(), and forloop_body.
Referenced by add_counters().
add a counter to the loop body
Definition at line 101 of file control_counters.c.
References add_counter(), and loop_body.
Referenced by add_counters().
generate: var = var + 1 (Fortran) or var++ (C)
Definition at line 49 of file control_counters.c.
References CONS, empty_comments, entity_intrinsic(), entity_to_expression(), entity_undefined, fortran_module_p(), int_to_expression(), make_assign_statement(), make_call_statement(), MakeBinaryCall(), module, NIL, PLUS_OPERATOR_NAME, and POST_INCREMENT_OPERATOR_NAME.
Referenced by add_counter().
add a counter to each branch of the test
Definition at line 93 of file control_counters.c.
References add_counter(), test_false, and test_true.
Referenced by add_counters().
add a counter to the loop body
Definition at line 108 of file control_counters.c.
References add_counter(), and whileloop_body.
Referenced by add_counters().