PIPS
|
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "misc.h"
#include "ri.h"
#include "ri-util.h"
Go to the source code of this file.
Functions | |
bool | allocatable_area_p (entity aire) |
bool | dynamic_area_p (entity aire) |
bool | static_area_p (entity aire) |
bool | heap_area_p (entity aire) |
bool | formal_area_p (entity aire) |
bool | stack_area_p (entity aire) |
bool | pointer_dummy_targets_area_p (entity aire) |
entity | module_to_heap_area (entity f) |
Returns the heap area "a" associated to module "f". More... | |
entity | module_to_dynamic_area (entity f) |
bool | entity_area_p (entity e) |
bool | entity_special_area_p (entity e) |
int | current_offset_of_area (entity a, entity v) |
bool | empty_static_area_p (entity e) |
void | print_common_layout (FILE *fd, entity c, bool debug_p) |
Variables | |
entity | DynamicArea = entity_undefined |
Pot-pourri of utilities for entities of kind "area". More... | |
entity | StaticArea = entity_undefined |
entity | HeapArea = entity_undefined |
entity | StackArea = entity_undefined |
entity | AllocatableArea = entity_undefined |
aire | ire |
Definition at line 64 of file area.c.
References ALLOCATABLE_AREA_LOCAL_NAME, module_local_name(), and same_string_p.
the local areas are StaticArea, DynamicArea, HeapArea, StackArea
Varying Length Arrays (VLA) in C or Fortran must be allocated in the stack area, where offsets are not computed in the same way.
a | area |
v | scalar or array variable |
Definition at line 174 of file area.c.
References area_layout, area_size, CONS, ENTITY, entity_type, gen_nconc(), NIL, pips_assert, pips_internal_error, SizeOfArray(), stack_area_p(), and type_area.
Referenced by ComputeAddresses(), GenericAddLocalEntityToDeclarations(), make_nlc_entity(), make_nsp_entity(), make_nub_entity(), replace_indices_region(), replace_indices_region_com(), and save_all_entities().
aire | ire |
Definition at line 68 of file area.c.
References DYNAMIC_AREA_LOCAL_NAME, ENTITY_DYNAMIC_AREA, entity_kind, module_local_name(), pips_assert, and same_string_p.
Referenced by AnalyzeData(), common_regions_forward_translation(), compute_region_variables(), entity_dynamic_p(), entity_locations_max(), entity_special_area_p(), fix_storage(), new_add_any_variable_to_area(), region_dynamic_var_elim(), regions_dynamic_elim(), sentence_area(), text_entity_declaration(), variable_dynamic_p(), and variable_to_abstract_location().
Definition at line 201 of file area.c.
References area_layout, ENDP, entity_type, static_area_p(), and type_area.
Referenced by text_entity_declaration().
Definition at line 149 of file area.c.
References entity_type, type_area_p, and type_undefined_p.
Referenced by check_common_inclusion(), common_members_of_module(), entity_special_area_p(), inline_expression_call(), normalize_microcode(), and wipeout_entity().
Definition at line 154 of file area.c.
References dynamic_area_p(), entity_area_p(), heap_area_p(), pointer_dummy_targets_area_p(), stack_area_p(), and static_area_p().
Referenced by declaration_supporting_references(), entity_in_common_p(), formal_variable_add_aliases(), init_host_and_node_entities(), regions_dynamic_elim(), text_entity_declaration(), text_equivalences(), update_common_layout(), update_user_common_layouts(), and variable_in_common_p().
aire | ire |
Definition at line 95 of file area.c.
References ENTITY_FORMAL_AREA, entity_kind, FORMAL_AREA_LOCAL_NAME, module_local_name(), pips_assert, and same_string_p.
Referenced by entity_in_formal_area_p(), entity_stub_sink_p(), formal_context_variable_p(), and variable_to_abstract_location().
aire | ire |
Definition at line 86 of file area.c.
References ENTITY_HEAP_AREA, entity_kind, HEAP_AREA_LOCAL_NAME, module_local_name(), pips_assert, and same_string_p.
Referenced by common_members_of_module(), common_regions_forward_translation(), dump_common_layout(), entity_heap_location_p(), entity_locations_max(), entity_special_area_p(), fortran_relevant_area_entity_p(), new_add_any_variable_to_area(), print_common_layout(), sentence_area(), strict_constant_path_p(), text_entity_declaration(), variable_entities_may_conflict_p(), variable_heap_p(), variable_to_abstract_location(), xml_Array(), and xml_Scalar().
Definition at line 139 of file area.c.
References DYNAMIC_AREA_LOCAL_NAME, entity_local_name(), entity_undefined_p, f(), FindEntity(), and pips_assert.
Returns the heap area "a" associated to module "f".
Area "a" is always a defined entity.
Assumes that f is defined, as well as its heap area.
Definition at line 129 of file area.c.
References entity_local_name(), entity_undefined_p, f(), FindEntity(), HEAP_AREA_LOCAL_NAME, and pips_assert.
Referenced by entity_flow_or_context_sentitive_heap_location().
aire | ire |
Definition at line 113 of file area.c.
References entity_kind, ENTITY_POINTER_DUMMY_TARGETS_AREA, module_local_name(), pips_assert, POINTER_DUMMY_TARGETS_AREA_LOCAL_NAME, and same_string_p.
Referenced by entity_special_area_p(), sentence_area(), and text_entity_declaration().
list members = area_layout(type_area(entity_type(c)));
list members = common_members_of_module(c, mod , true);
for debugging only
Look for variables declared in this common by some procedures which declares it. The procedures involved depend on the ordering of the parser steps by pipsmake and the user. Maybe, the list should be filtered and restricted to the current module: YES!
Consistency check between the area layout and the ram section
Look for variables aliased with a variable in this common
fd | d |
debug_p | ebug_p |
Definition at line 207 of file area.c.
References area_size, arguments_difference(), arguments_union(), array_size(), common_members_of_module(), ENDP, ENTITY, entity_local_name(), entity_module_name(), entity_name, entity_storage, entity_type, FOREACH, fprintf(), gen_free_list(), get_current_module_entity(), heap_area_p(), HeapArea, module_local_name(), NIL, pips_assert, pips_internal_error, pips_user_warning, ram_function, ram_offset, ram_section, ram_shared, SizeOfArray(), sort_list_of_entities(), stack_area_p(), StackArea, storage_ram, storage_ram_p, and type_area.
Referenced by fprint_any_environment(), MakeEntryCommon(), and update_user_common_layouts().
aire | ire |
Definition at line 104 of file area.c.
References entity_kind, ENTITY_STACK_AREA, module_local_name(), pips_assert, same_string_p, and STACK_AREA_LOCAL_NAME.
Referenced by common_members_of_module(), common_regions_forward_translation(), current_offset_of_area(), dump_common_layout(), entity_locations_max(), entity_special_area_p(), fortran_relevant_area_entity_p(), new_add_any_variable_to_area(), print_common_layout(), regions_dynamic_elim(), sentence_area(), text_entity_declaration(), variable_entities_may_conflict_p(), variable_stack_p(), variable_to_abstract_location(), xml_Array(), and xml_Scalar().
aire | ire |
Definition at line 77 of file area.c.
References entity_kind, ENTITY_STATIC_AREA, module_local_name(), pips_assert, same_string_p, and STATIC_AREA_LOCAL_NAME.
Referenced by AnalyzeData(), c_text_related_entities(), empty_static_area_p(), entity_locations_max(), entity_special_area_p(), entity_static_variable_p(), fix_storage(), live_in_paths_of_statement(), new_add_any_variable_to_area(), sentence_area(), sequence_to_post_pv(), variable_static_p(), and variable_to_abstract_location().
entity AllocatableArea = entity_undefined |
entity DynamicArea = entity_undefined |
Pot-pourri of utilities for entities of kind "area".
area.c
These global variables are declared in ri-util/util.c.
functions for areas Four areas used to allocate variables which are not stored in a Fortran common. These areas are just like Fortran commons, but the dynamic area is the only non-static area according to Fortran standard. The heap and the stack area are used to deal with Fortran ANSI extensions and C, pointers and allocatable arrays, and adjustable arrays (VLA in C). The dynamic area is stack allocated by most compilers but could be statically allocated since the array sizes are known.
Areas are declared for each module. These four global variables are managed by the Fortran and C parsers and used to allocate variables in the current module. Note that the C parser uses more areas at the same time to cope with global variables.
Definition at line 57 of file area.c.
Referenced by ComputeAddresses(), EndOfProcedure(), gfc2pips_code2instruction__TOP(), gfc2pips_computeAdressesDynamic(), gfc2pips_computeAdressesOfArea(), gfc2pips_expr2entity(), gfc2pips_expr2expression(), gfc2pips_vars_(), init_c_areas(), init_c_implicit_variables(), InitAreas(), make_empty_module(), MakeStorageRam(), MakeVariableStatic(), ParserError(), save_all_entities(), and SaveEntity().
entity HeapArea = entity_undefined |
Definition at line 59 of file area.c.
Referenced by ComputeAddresses(), DeclarePointer(), dump_common_layout(), gfc2pips_computeAdressesHeap(), gfc2pips_computeAdressesOfArea(), gfc2pips_vars_(), init_c_areas(), InitAreas(), make_empty_module(), ParserError(), and print_common_layout().
entity StackArea = entity_undefined |
Definition at line 60 of file area.c.
Referenced by CModuleMemoryAllocation(), ComputeAddresses(), dump_common_layout(), gfc2pips_computeAdressesOfArea(), gfc2pips_parameters(), gfc2pips_vars_(), init_c_areas(), InitAreas(), make_empty_module(), MakeStorageRam(), and print_common_layout().
entity StaticArea = entity_undefined |
Definition at line 58 of file area.c.
Referenced by AnalyzeData(), ComputeAddresses(), EndOfProcedure(), fix_storage(), gfc2pips_code2instruction__TOP(), gfc2pips_computeAdressesOfArea(), gfc2pips_computeAdressesStatic(), gfc2pips_namespace(), init_c_areas(), InitAreas(), make_common_entity(), make_empty_module(), make_new_common(), MakeStorageRam(), MakeVariableStatic(), ParserError(), ProcessEntry(), save_all_entities(), and SaveEntity().