PIPS
|
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "misc.h"
#include "ri-util.h"
Go to the source code of this file.
Functions | |
static void | set_current_function (entity function) |
static bool | local_entity_of_current_function_p (entity e) |
void | GenericCleanEntities (list el, entity function, bool fortran_p) |
Useful when the user edit a source file and parse it again or when a program transformation is performed by prettyprinting and reparsing. More... | |
void | GenericCleanLocalEntities (entity function, bool fortran_p) |
void | CleanLocalEntities (entity function) |
Fortran version. More... | |
void | CCleanLocalEntities (entity function) |
C language version. More... | |
void | RemoveLocalEntities (entity function) |
Useful for ParserError()? More... | |
Variables | |
static entity | current_function = entity_undefined |
static const char * | current_function_local_name = NULL |
void CCleanLocalEntities | ( | entity | function | ) |
C language version.
function | unction |
Definition at line 146 of file clean.c.
References GenericCleanLocalEntities().
Referenced by MakeCurrentModule().
void CleanLocalEntities | ( | entity | function | ) |
Fortran version.
function | unction |
Definition at line 140 of file clean.c.
References GenericCleanLocalEntities().
Referenced by AbortEntries(), c_parser_error(), MakeCurrentFunction(), and ParserError().
Useful when the user edit a source file and parse it again or when a program transformation is performed by prettyprinting and reparsing.
FI: A memory leak is better than a dangling pointer?
My explanation: CleanLocalEntities is called by MakeCurrentFunction when the begin_inst rule is reduced; by that time, the module entity and its formal parameters have already been parsed and allocated... but they are not yet fully initialized; thus the gen_full_free is a killer while the undefinitions are ok.
en_full_free_list(function_local_entities);
In C, parameter typing may have already occured and the return entity may be already defined. They must be preserved.
free_type(entity_type(e));
free_storage(entity_storage(e));
free_value(entity_initial(e));
In C, the entity must be removed from the declarations and from the symbol table
el | l |
function | unction |
fortran_p | ortran_p |
Definition at line 63 of file clean.c.
References area_layout, CAR, code_declarations, ENDP, ENTITY, entity_initial, entity_local_name(), entity_storage, entity_type, free_entity(), gen_remove(), list_undefined, pips_assert, pips_debug, POP, ram_section, storage_formal_p, storage_ram, storage_ram_p, storage_return_p, storage_undefined, storage_undefined_p, type_area, type_area_p, type_undefined, type_undefined_p, value_code, value_undefined, and value_undefined_p.
Referenced by clean_up_points_to_stubs(), and GenericCleanLocalEntities().
function | unction |
fortran_p | ortran_p |
Definition at line 123 of file clean.c.
References entity_domain, gen_filter_tabulated(), gen_free_list(), GenericCleanEntities(), local_entity_of_current_function_p(), NIL, and set_current_function().
Referenced by CCleanLocalEntities(), and CleanLocalEntities().
Definition at line 53 of file clean.c.
References current_function_local_name, entity_module_name(), and same_string_p.
Referenced by GenericCleanLocalEntities(), and RemoveLocalEntities().
void RemoveLocalEntities | ( | entity | function | ) |
Useful for ParserError()?
FI: dangling pointers? Some variables may be referenced in area_layouts of global common entities!
gen_full_free_list(function_local_entities);
A gen_multi_recurse would be required but it's hard to be at the list level to remove the elements?!?
function | unction |
Definition at line 152 of file clean.c.
References entity_domain, gen_filter_tabulated(), local_entity_of_current_function_p(), pips_assert, and set_current_function().
|
static |
Definition at line 42 of file clean.c.
References compilation_unit_p(), current_function, current_function_local_name, entity_module_name(), module_local_name(), pips_assert, and top_level_entity_p().
Referenced by GenericCleanLocalEntities(), and RemoveLocalEntities().
|
static |
Definition at line 38 of file clean.c.
Referenced by set_current_function().
|
static |
Definition at line 39 of file clean.c.
Referenced by local_entity_of_current_function_p(), and set_current_function().