PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "properties.h"
#include "ri-util.h"
#include "workspace-util.h"
Go to the source code of this file.
Functions | |
const char * | entity_module_unambiguous_user_name (entity e, entity m) |
Functions using simultaneously pipsdbm, which is based on strings, and ri-util, which contains basic methods for the objects of the internal representation. More... | |
const char * | entity_unambiguous_user_name (entity e) |
static const char * | entity_more_or_less_minimal_name (entity e, bool strict_p) |
In interprocedural context, returns the shortest non-ambiguous name for a variable. More... | |
const char * | entity_minimal_name (entity e) |
Do preserve scope informations. More... | |
const char * | entity_minimal_user_name (entity e) |
Do not preserve scope information. More... | |
void | print_arguments (list args) |
entity | string_to_entity (const char *s, entity module) |
very simple conversion from string to expression only handles entities and numeric values at the time being More... | |
list | string_to_entities (const char *str, const char *seed, entity module) |
split a string using seed as separator and call string_to_entity on each chunk More... | |
const char* entity_minimal_name | ( | entity | e | ) |
Do preserve scope informations.
This function does not allocate a new string, which implies to keep the scope information in the name of extraprocedural variables and functions.
Definition at line 214 of file naming.c.
References entity_more_or_less_minimal_name().
Referenced by DisplayDad(), effect_words_reference(), flint_check_uninitialized_variables_in_statement(), flint_initialize_statement_def_use_variables(), generic_value_name(), pips_region_user_name(), pips_user_value_name(), print_arguments(), print_value_mappings(), region_translation(), text_transformer(), and variable_local_name().
const char* entity_minimal_user_name | ( | entity | e | ) |
Do not preserve scope information.
A new string is allocated.
Definition at line 223 of file naming.c.
References entity_more_or_less_minimal_name().
Referenced by equal_must_vreference(), is_entity_in_list(), opkill_may_vreference(), opkill_must_vreference(), points_to_compare_cell(), points_to_compare_cells(), points_to_compare_location(), points_to_compare_ptr_cell(), points_to_words_reference(), remove_from_effective_parameters(), and remove_from_formal_parameters().
Functions using simultaneously pipsdbm, which is based on strings, and ri-util, which contains basic methods for the objects of the internal representation.
Warning! Do not modify this file that is automatically generated!
Based on entity_user_name, but preserves scoping information when needed to avoid ambiguity between two or more variables with the same name.
A variable or function name can be used for an external or static entity in the compilation unit, it can be used as function parameter, and then declared within the function at any scope level.
This function cannot directly be used in an interprocedural setting as it is only related to one module.
It is assumed that no new string is allocated, but a pointer to an existing string is returned.
The current implementation is extremely ineffective, especially for a very unlikely, although mystifying, problem.
FI: this function does not seem to be used in Libs or Passes. Its implementation is based on module_entities(), which is not in ri-util...
No problem in Fortran
Definition at line 68 of file naming.c.
References c_module_p(), ENTITY, entity_local_name(), entity_user_name(), FOREACH, gen_free_list(), module_entities(), and same_string_p.
Referenced by entity_unambiguous_user_name().
In interprocedural context, returns the shortest non-ambiguous name for a variable.
If it is local to the current module, use the user name. If not return entity_name(), which is not fully satisfying for C variables because it includes scope information.
Note also that this function assumes the existence of a current module.
FI: why is this function in preprocessor and not in ri-util?
in pipsmake library...
gen_in_list_p() would/should be sufficient...
The variable is declared in the current module
The variable is declared in the compilation unit of the current module
The variable is a union or struct field. No need to disambiguate.
Formal parameters should always be unambiguous?
The variable is a dummy parameter entity, used in a function declaration
In analysis results, let's know when dummy parameters are used...
The variable is a ???
The variable is a PHI entity
The variable is a stub entity for formal and global pointers
must be used to prettyprint interprocedural information...
Definition at line 107 of file naming.c.
References c_module_p(), code_declarations, compilation_unit_of_module(), compilation_unit_p(), DUMMY_PARAMETER_PREFIX, entity_field_p(), entity_formal_p(), entity_initial, entity_local_name(), entity_module_name(), entity_name, entity_unambiguous_user_name(), entity_undefined, entity_undefined_p, entity_user_name(), FindEntity(), free(), gen_in_list_p(), get_current_module_entity(), list_undefined, list_undefined_p, module_local_name(), pips_assert, POINTS_TO_MODULE_NAME, REGIONS_MODULE_NAME, strdup(), string_undefined, TOP_LEVEL_MODULE_NAME, and value_code.
Referenced by entity_minimal_name(), and entity_minimal_user_name().
const char* entity_unambiguous_user_name | ( | entity | e | ) |
Definition at line 91 of file naming.c.
References entity_module_unambiguous_user_name(), and get_current_module_entity().
Referenced by entity_more_or_less_minimal_name().
void print_arguments | ( | list | args | ) |
args | rgs |
Definition at line 228 of file naming.c.
References entity_minimal_name(), and print_homogeneous_arguments().
Referenced by ComputeAddresses(), fuse_sequences_in_unstructured(), MakeEntryCommon(), recompute_loop_transformer(), TestDependence(), and update_common_layout().
split a string using seed
as separator and call string_to_entity on each chunk
str | tr |
seed | eed |
module | odule |
Definition at line 276 of file naming.c.
References CONS, ENTITY, entity_undefined_p, FOREACH, free(), gen_free_list(), gen_map(), gen_nreverse(), module, NIL, STRING, string_to_entity(), and strsplit().
very simple conversion from string to expression only handles entities and numeric values at the time being
try float conversion
no negative integer entity in pips
first find all relevant entities
this an heuristic to find the one with a suiting scope error prone
try at the compilation unit level
try at top level
module | odule |
Definition at line 237 of file naming.c.
References compilation_unit_of_module(), empty_string_p(), ENTITY, entity_declarations, entity_name, entity_undefined, entity_undefined_p, entity_user_name(), f(), FindEntity(), float_to_entity(), FOREACH, int_to_entity(), module, module_local_name(), module_name(), same_string_p, and TOP_LEVEL_MODULE_NAME.
Referenced by do_solve_hardware_constraints(), string_to_entities(), and string_to_expression().