PIPS
|
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "pipsdbm.h"
#include "misc.h"
#include "properties.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "effects-util.h"
#include "effects-generic.h"
#include "control.h"
#include "transformations.h"
Go to the source code of this file.
Data Structures | |
struct | entity_used_somewhere_param |
Functions | |
static void | remove_unread_variable (statement s, entity e) |
static bool | entity_may_conflict_with_a_formal_parameter_p (entity e, entity module) |
static void | entity_used_somewhere_walker (statement s, entity_used_somewhere_param *p) |
static bool | entity_read_somewhere_p (entity e, statement in) |
static void | remove_unread_variables (statement s) |
void | module_clean_declarations (entity module, statement module_statement) |
declarations.c More... | |
bool | clean_declarations (const string module_name) |
A phase to remove the declaration of useless variables. More... | |
A phase to remove the declaration of useless variables.
It recursively calls statement_remove_unused_declarations on all module statement
[in] | module_name | is the name of the module to process |
prelude
first remove any statement that writes only variable that are never read
body
ostlude
module_name | odule_name |
Definition at line 155 of file declarations.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, gen_recurse, gen_true(), get_current_module_entity(), get_current_module_statement(), module_clean_declarations(), module_name(), module_name_to_entity(), remove_unread_variables(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), and statement_domain.
Definition at line 91 of file declarations.c.
References entities_may_conflict_p(), entity_declarations, FOREACH, formal_parameter_p(), and module.
Referenced by remove_unread_variables().
Definition at line 110 of file declarations.c.
References entity_used_somewhere_walker(), gen_context_recurse, gen_true2(), entity_used_somewhere_param::result, and statement_domain.
Referenced by remove_unread_variables().
|
static |
Definition at line 103 of file declarations.c.
References entity_used_somewhere_param::e, effects_read_variable_p(), gen_recurse_stop(), load_cumulated_rw_effects_list(), and entity_used_somewhere_param::result.
Referenced by entity_read_somewhere_p().
declarations.c
module | odule |
module_statement | odule_statement |
Definition at line 140 of file declarations.c.
References entity_clean_declarations(), gen_recurse, gen_true(), module, module_statement, statement_clean_declarations(), and statement_domain.
Referenced by clean_declarations(), and do_scalar_renaming().
we only manage written entity in the form of e binary_op something else
Definition at line 50 of file declarations.c.
References binary_call_lhs, binary_call_rhs, call_arguments, call_function, call_undefined, CDR, CONTINUE_FUNCTION_NAME, copy_expression(), declaration_statement_p(), EFFECT, effect_any_reference, effect_write_p, ENDP, entities_may_conflict_p(), entities_must_conflict_p(), entity_intrinsic(), exp, expression_call(), expression_call_p(), expression_reference(), expression_reference_p(), expression_syntax, FOREACH, free_call(), free_instruction(), instruction_call, load_cumulated_rw_effects_list(), make_instruction_expression(), pips_internal_error, reference_variable, statement_call(), statement_call_p(), statement_instruction, and syntax_call.
Referenced by remove_unread_variables().
|
static |
it is useless to try to remove formal parameters
and we cannot afford removing something that may implies aliasing
the entity is never read, it is disposable
Definition at line 116 of file declarations.c.
References ENTITY, entity_may_conflict_with_a_formal_parameter_p(), entity_name, entity_read_somewhere_p(), entity_scalar_p(), entity_variable_p, FOREACH, gen_context_recurse, gen_true2(), get_current_module_entity(), pips_debug, remove_unread_variable(), statement_block_p, statement_declarations, and statement_domain.
Referenced by clean_declarations().