27 #ifdef BUILDER_CLEAN_UNUSED_DYNAMIC_VARIABLES
30 #include "pips_config.h"
57 #define expr_var(e) reference_variable(expression_reference(e))
59 #define call_assign_p(c) \
60 same_string_p(entity_local_name(call_function(c)), ASSIGN_OPERATOR_NAME)
65 const char* func_malloc;
66 const char* func_free;
71 static bool ignore_call_flt(
call c,
struct helper * ctx)
99 static bool reference_flt(
reference r,
struct helper * ctx)
114 static bool unused_local_variable_p(
entity var,
set used,
const char*
module)
128 static void cleanup_call(
call c,
struct helper * ctx)
132 bool replace =
false;
142 unused_local_variable_p(expr_var(arg), ctx->referenced, ctx->module))
157 unused_local_variable_p(expr_var(arg), ctx->referenced, ctx->module))
179 static void cleanup_stat_decls(
statement s,
struct helper * ctx)
183 if (!unused_local_variable_p(var, ctx->referenced, ctx->module))
205 help.removed_vars = 0;
236 if (unused_local_variable_p(var,
help.referenced,
module))
254 }
while (
help.removed_vars>0);
value make_value_unknown(void)
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
entity int_to_entity(_int c)
char * get_string_property(const char *)
void gen_full_free_list(list l)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define same_string_p(s1, s2)
set set_clear(set)
Assign the empty set to s s := {}.
bool set_belong_p(const set, const void *)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
static bool loop_flt(loop l, extract_expr_p context)
static list referenced
returns the list of referenced variables
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define entity_declarations(e)
MISC: newgen shorthands.
#define CONTINUE_FUNCTION_NAME
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
static int init
Maximal value set for Fortran 77.
const char * entity_module_name(entity e)
See comments about module_name().
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
bool expression_call_p(expression e)
call expression_call(expression e)
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool formal_parameter_p(entity)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define statement_domain
newgen_sizeofexpression_domain_defined
#define instruction_domain
newgen_functional_domain_defined
#define call_domain
newgen_callees_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define reference_domain
newgen_range_domain_defined
struct _newgen_struct_instruction_ * instruction
#define instruction_call_p(x)
#define statement_declarations(x)
#define instruction_call(x)
#define call_arguments(x)
#define value_expression_p(x)
#define type_variable_p(x)
#define entity_initial(x)
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.