25 #include "pips_config.h"
50 #include "resources.h"
61 const char * pips_func,
62 const char * pips_file,
85 pips_assert(
"consistent line numbers", 1 <= pln && pln <= cln);
94 "Source code after preprocessing:\n%s"
95 "Input source code, before preprocessing:\n%s",
100 (
const string) pips_func, (
const string) pips_file, pips_line,
101 NULL, uifn, pln, cln,
102 NULL, more, (
const string) format, args);
113 const char * pips_func,
114 const char * pips_file,
120 va_start(args, format);
343 pips_debug(4,
"Set current module entity for compilation unit %s\n",name);
352 if(is_compilation_unit_parser)
360 pips_debug(4,
"Reset current module entity for compilation unit \"%s\"\n",
394 pips_debug(8,
"Call to \"\%s\" with %zd argument(s)\n",
418 pips_assert(
"function's type is ultimately functional or pointer to functional",
426 pips_debug(6,
"Normal function or intrinsics call\n");
494 CParserError(
"Cannot find the field identifier from current type\n");
505 pips_debug(6,
"Find the struct/union of \"%s\" from expression:\n",m);
528 CParserError(
"Pointer arithmetic error, incompatible types");
646 CParserError(
"Cannot find the field identifier from current expression\n");
655 pips_debug(5,
"Identifier is \"%s\" and entity_name is \"\%s\"\n",
663 pips_debug(5,
"Create unparsed global function: %s\n",s);
743 pips_debug(6,
"Normal reference expression\n");
758 pips_debug(6,
"Subscripting array expression\n");
826 string ls =
strdup(scope);
897 string ls =
strdup(scope);
900 pips_debug(5,
"Entity local name is \"%s\" with prefix \"%s\" and scope \"%s\"\n",
949 pips_debug(8,
"Cannot find entity with local name \"%s\" with prefix \"%s\" at line %d\n",
984 #define FILE_LOCAL_USER_DEFINED_TYPES_P (true)
1006 pips_debug(5,
"Entity local name is %s with prefix %s and scope \"%s\"\n",
1029 pips_debug(5,
"Current module is undefined\n");
1038 pips_debug(8,
"Number of extern variables and functions: %zd\n",
1041 pips_debug(8,
"Last entity %s in cons %p with car=%p and cdr=%p\n",
1045 (
void *) (le->
cdr));
1069 pips_debug(5,
"Add typedef name %s to hash table\n",sname);
1081 pips_debug(5,
"Add typedef name %s to hash table\n",name);
1127 pips_debug(5,
"Entity local name \"%s\"\n",name);
1140 if (full_scope != NULL) {
1141 pips_debug(5,
"Current scope: \"%s\"\n",full_scope);
1142 pips_debug(5,
"Local declaration scope: \"%s\"\n",scope);
1143 pips_debug(5,
"Block scope: \"%s\"\n",block_scope);
1170 if (strcmp(scope,
"") != 0 && !is_formal)
1174 char * tname = name;
1197 pips_debug(8,
"Variable \"%s\" added to external declarations of \"%s\"\n",
1371 pips_debug(3,
"Update entity in parentheses \"%s\" with type \"%s\"\n",
1449 pips_debug(3,
"Update pointer entity %s with type pt=\"%s\"\n",
1493 pips_debug(3,
"Function returns a pointer \n");
1500 CParserError(
"Entity is neither an array of pointers nor a pointer to a function?\n");
1506 pips_debug(3,
"Ends with type \"%s\" for entity %s\n",
1626 (void)
fprintf(stderr,
"empty list");
1665 CParserError(
"This entity must have undefined type\n");
1668 pips_debug(3,
"Update function entity \"%s\" with type \"\%s\"\n",
1774 CParserError(
"void type to be updated by a non void type...\n");
1801 user_log(
"\n\nNo declaration of variable \"%s\" (\"%s\") in module \"%s\'\n",
1842 for(carg=args; !
ENDP(carg);
POP (carg)) {
1859 "Implicit declaration added\n",
1892 for(; !
ENDP(ld); ld =
CDR(ld)) {
1923 (
"Multiple declarations of variable \"%s\" in different files\n",
1987 for(; !
ENDP(ld); ld =
CDR(ld))
2036 for(cd = dl; !
ENDP(cd);
POP(cd)) {
2046 for(cd = formals; !
ENDP(cd);
POP(cd)) {
2098 for(cd = dl; !
ENDP(cd);
POP(cd)) {
2117 for(cd = formals; !
ENDP(cd);
POP(cd)) {
2129 pips_debug(8,
"Formal dummy parameter \"%s\" is replaced "
2130 "by standard formal parameter \"%s\"\n",
2145 pips_debug(8,
"reference %p to \"%s\" changed into reference to \"\%s\"\n",
2167 pips_debug(8,
"list of declared variables:\n");
2175 pips_debug(8,
"Substitution failed for reference %p and variable \"%s\"\n",
2247 for(cd = dl; !
ENDP(cd);
POP(cd)) {
2266 for(cformals=formals, cfp = fp; !
ENDP(cfp);
POP(cformals),
POP(cfp)) {
2278 pips_debug(8,
"Reference to \"\%s\" now refers \"\%s\"\n",
2288 else if(nformals>0) {
2290 for(cfp=fp, i= 1;!
ENDP(cfp);
POP(cfp), i++) {
2303 pips_debug(8,
"Reference to \"\%s\" now refers \"\%s\"\n",
2327 for(cd = formals; !
ENDP(cd);
POP(cd)) {
2333 pips_debug(8,
"Formal dummy parameter \"%s\" is removed from declarations\n",
2389 " Return value cannot be created.\n",
2402 " Return value cannot be created.\n",
2444 for(cl = dl; !
ENDP(cl);
POP(cl)) {
2555 pips_debug(3,
"Current storage context is %d\n",
2566 pips_debug(3,
"Create formal variable %s for function %s with offset %d\n",
2616 user_log(
"Multiple declarations of variable \"%s\" in file\"%s\".\n",
2640 "This is not supported by PIPS. Please rename \"%s\"\n",
2649 "function and an intrinsic\n");
2669 if(
true || !is_declaration) {
2675 if(is_declaration) {
2699 pips_assert(
"Although it's a pointer to a function, it has code...",
2708 for(cl=dl; !
ENDP(cl);
POP(cl)) {
2714 pips_debug(8,
"Change storage from \"formal\" to \"rom\" for entity \"%s\"\n",
2724 pips_debug(3,
"Update entity ends for \"%s\" with type \"%s\" and storage \"%s\"\n",
2777 for(ce=le; !
ENDP(ce);
POP(ce)) {
2788 for(de=d; !
ENDP(de);
POP(de)) {
2806 for(lde=ld; !
ENDP(lde);
POP(lde)) {
2907 pips_debug(5,
"Add entity %s to extern declaration %s \n",
2930 pips_debug(5,
"Add entity \"%s\" (\"%s\") to module %s\n",
3110 for(cem = lem; !
ENDP(cem);
POP(cem)) {
3275 pips_debug(3,
"Struc/union name is %s\n",derived);
3293 pips_debug(3,
"The struct/union member's scope is %s\n",s);
3389 if (strcmp(name,s)==0)
3417 bool already_here =
false;
3422 if (strcmp(n, s) == 0)
3424 already_here =
true;
3431 pips_debug(2,
"Adding %s to list of called modules\n", n);
3512 "double definition of initial"
3526 "Current initial value:\n%s",
3543 bool failure_p =
false;
3623 static char init_buffer[1024];
3634 if( strlen(
line)>=4) {
3635 int initial_C_line_number = -1;
3636 int items = sscanf(
line+1,
"%d %s", &initial_C_line_number,
buffer);
3652 (void) strcpy(init_buffer,
buffer+skip);
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
void user_log(const char *format,...)
void pips_log_alist(const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string format, va_list *args)
log entry with unprocessed format/alist arguments
string get_pips_current_pass_name(void)
Export this piece of information to customize warning functions in passes.
string get_pips_current_module(void)
dummy make_dummy_identifier(entity _field_)
syntax make_syntax_application(application _field_)
functional make_functional(list a1, type a2)
call make_call(entity a1, list a2)
constant make_constant(enum constant_utype tag, void *val)
value make_value_unknown(void)
value make_value_expression(expression _field_)
parameter make_parameter(type a1, mode a2, dummy a3)
syntax make_syntax_call(call _field_)
expression make_expression(syntax a1, normalized a2)
type make_type_union(list _field_)
application make_application(expression a1, list a2)
value make_value_code(code _field_)
bool symbolic_consistent_p(symbolic p)
subscript make_subscript(expression a1, list a2)
type make_type_variable(variable _field_)
basic make_basic(enum basic_utype tag, void *val)
storage make_storage_rom(void)
value make_value_constant(constant _field_)
type copy_type(type p)
TYPE.
basic copy_basic(basic p)
BASIC.
type make_type_struct(list _field_)
basic make_basic_int(intptr_t _field_)
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
type make_type_functional(functional _field_)
type make_type_void(list _field_)
basic make_basic_pointer(type _field_)
value make_value(enum value_utype tag, void *val)
reference make_reference(entity a1, list a2)
entity check_entity(entity p)
constant make_constant_int(intptr_t _field_)
dimension make_dimension(expression a1, expression a2, list a3)
symbolic make_symbolic(expression a1, constant a2)
variable make_variable(basic a1, list a2, list a3)
value copy_value(value p)
VALUE.
area make_area(intptr_t a1, list a2)
code make_code(list a1, string a2, sequence a3, list a4, language a5)
storage make_storage_formal(formal _field_)
void free_expression(expression p)
void free_storage(storage p)
language make_language_c(void)
type make_type_unknown(void)
storage copy_storage(storage p)
STORAGE.
dummy make_dummy_unknown(void)
type make_type_enum(list _field_)
storage make_storage_ram(ram _field_)
mode make_mode_value(void)
sequence make_sequence(list a)
storage make_storage_return(entity _field_)
bool entity_consistent_p(entity p)
type make_type(enum type_utype tag, void *val)
syntax make_syntax_subscript(subscript _field_)
formal make_formal(entity a1, intptr_t a2)
value make_value_symbolic(symbolic _field_)
syntax make_syntax_reference(reference _field_)
string list_to_string(list l)
Return the malloc()ed version of the concatenation of all the strings in the list.
bool entity_is_argument_p(entity e, cons *args)
bool c_parser_error(const char *func, const char *msg)
Output a parser message error.
string compilation_unit_name
cproto-generated files
stack get_from_entity_type_stack_table(entity key)
bool compilation_unit_parser_is_running_p
To pass down the information to functions used by the syntactical analyzer.
void remove_entity_type_stack(entity e)
void put_to_entity_type_stack_table(entity key, stack value)
list removable_extern_entities
string get_c_parser_current_user_input_file_name()
void remove_entity_type_stacks(list el)
string get_c_parser_current_input_file_name()
statement ModuleStatement
#define c_parser_context_storage(x)
#define c_parser_context_qualifiers(x)
#define c_parser_context_static(x)
#define c_parser_context_type(x)
struct _newgen_struct_type_ * type
#define c_parser_context_typedef(x)
#define c_parser_context_scope(x)
void remove_LFs_from_C_comment(int)
Remove "extra_LF" trailing LF from C_current_comment if they can be found at the end of the comment s...
entity DynamicArea
These global variables are declared in ri-util/util.c.
c_parser_context GetContext(void)
int get_previous_c_lineno(void)
#define c_parser_user_warning(...)
string get_c_parser_current_scope(void)
int get_current_C_line_number(void)
int C_line_increment
from "clex.l"
string scope_to_block_scope(string)
Allocate a new string containing only block scope information.
string GetParentScope(void)
string pop_block_scope(string)
The scope is moved up the scope tree and a NULL is return when there are no more scope to explore.
int get_previous_C_line_number(void)
Should be called just before get_current_C_line_number.
int get_declaration_counter(void)
int c_lineno
the file read in by the c_lexer
void CCompilationUnitMemoryReallocation(entity module)
void MakeCurrentCompilationUnitEntity(const char *name)
A compilation unit is also considered as a module.
list MakeParameterList(list l1, list l2, stack FunctionStack)
string CreateMemberScope(string derived, bool is_external)
void AddToDeclarations(entity e, entity mod)
FI: check the difference with AddEntityToDeclarations()
static bool declarationerror_p
void c_parser_user_warning_alist(const char *pips_func, const char *pips_file, const int pips_line, const char *format, va_list *args)
Compared to pips_user_warning(), the name of the calling function is lost, which does not help mainte...
void c_parser_user_warning_func(const char *pips_func, const char *pips_file, const int pips_line, const char *format,...)
static entity CleanUpEntity(entity e)
if returned entity != original entity, e must be freed, otherwise an invalid entity is still tabulate...
storage MakeStorageRam(entity v, bool is_external, bool is_static)
The storage part should not be called twice when reparsing compilation unit.
void MakeTopLevelEntity()
static bool buffer_initialized_p
expression MemberDerivedIdentifierToExpression(type t, string m)
entity FindEntityFromLocalNameAndPrefixAndScope(string name, string prefix, string scope)
The parameter "scope" is potentially destroyed.
int analyze_preprocessor_line(string line, int C_line_number)
Analyze information about user line number provided by the C preprocessor and by PIPS file splitter a...
expression MakeFunctionExpression(expression e, list le)
e is now owned by returned expression and must not be used any longer
void CCompilationUnitMemoryAllocations(entity module, bool first_p)
This function allocates the memory to the Current Compilation Unit.
entity FindOrCreateEntityFromLocalNameAndPrefix(string name, string prefix, bool is_external)
void CModuleMemoryAllocation(entity module)
This function is for MemoryAllocation for Module of C programs.
void NStackPop(stack s, int n)
Pop n times the stack s.
void UpdateArrayEntity(entity e, list lq, list le)
void CCompilationUnitMemoryAllocation(entity module)
expression MakeArrayExpression(expression exp, list lexp)
FI: this function is called for a bracketed comma expression.
void reset_preprocessor_line_analysis(void)
static int get_current_dummy_parameter_number(void)
void ResetCurrentCompilationUnitEntity(bool is_compilation_unit_parser)
entity FindOrCreateCurrentEntity(string name, stack ContextStack __attribute__((__unused__)), stack FormalStack, stack FunctionStack, bool is_external)
This function finds or creates the current entity.
void set_entity_initial(entity v, expression nie)
Be careful if the initial value has already been set.
entity MakeDerivedEntity(string name, list members, bool is_external, int i)
void put_new_typedef(const char *name)
This function is used by libraries "step"* and "task_parallelization".
entity get_current_compilation_unit_entity()
void UseDummyArguments(entity f)
If f has regular formal parameters, destroy them.
entity FindEntityFromLocalName(string name)
void UpdateDerivedEntity(list ld, entity e, stack ContextStack)
type UpdateFinalPointer(type pt, type t)
static void set_current_dummy_parameter_number(int n)
void UpdateEntities(list le, stack ContextStack, stack FormalStack, stack FunctionStack, stack OffsetStack, bool is_external, bool is_declaration)
void StackPop(stack OffsetStack)
The OffsetStack is poped n times, where n is the number of formal arguments of the actual function.
dimension MakeDimension(list le, list ql)
expression MemberIdentifierToExpression(expression e, string m)
void UpdatePointerEntity(entity e, type pt, list lq)
entity make_C_constant_entity(string name, tag bt, size_t size)
void InitializeEnumMemberValues(list lem)
void UpdateFunctionEntity(entity oe, list la)
The parser has found out that an entity is a function and partially sets its type.
void UseFormalArguments(entity f)
If f has dummy formal parameters, replace them by standard formal parameters.
static void nodecl_p(entity __attribute__((unused)) module, statement stat)
void CleanUpEntities(list le)
entity CreateEntityFromLocalNameAndPrefix(string name, string prefix, bool is_external)
static bool referencenodeclfilter(reference r)
entity get_top_level_entity()
void UpdateParenEntity(entity e, list lq)
void AddToExterns(entity e, entity mod)
parameter FindParameterEntity(string s, int offset, list l)
void SubstituteDummyParameters(entity f, list el)
static bool callnodeclfilter(call c)
void RemoveFromExterns(entity e)
void init_c_areas()
In C we have 4 areas.
static int current_dummy_parameter_number
The data structure to tackle the memory allocation problem due to reparsing of compilation unit.
bool check_declaration_uniqueness_p(statement s)
This is designed for standard C functions, not for compilation units.
void AddToCalledModules(entity e)
void init_c_implicit_variables(entity m)
void UpdateEntity(entity e, stack ContextStack, stack FormalStack, stack FunctionStack, stack OffsetStack, bool is_external, bool is_declaration)
Update the entity with final type, storage and initial value; and also (sometimes?...
list TakeDerivedEntities(list le)
int ComputeAreaOffset(entity a, entity v)
value MakeEnumeratorInitialValue(list enum_list, int counter)
entity FindEntityFromLocalNameAndPrefix(string name, string prefix)
void RemoveDummyArguments(entity f, list refs)
To chase formals in type declarations.
void UpdateDerivedEntities(list ld, list le, stack ContextStack)
void c_parser_put_new_typedef(const char *name)
Store named type for the lexical analyzer, which has to decide if a character string is the name of a...
void CreateReturnEntity(entity f)
If necessary, create the return entity, which is a hidden variable used in PIPS internal representati...
void UpdateAbstractEntity(entity e, stack ContextStack)
type UpdateType(type t1, type t2)
This function replaces the undefined field in t1 by t2.
#define FILE_LOCAL_USER_DEFINED_TYPES_P
void reset_current_dummy_parameter_number()
list insert_qualifier(list ql, qualifier nq)
if qualifier "nq" does not already belong to qualifier list "ql", add it in front of the list.
expression IdentifierToExpression(string s)
entity FindOrCreateEntityFromLocalNameAndPrefixAndScope(string name, string prefix, string scope, bool is_external)
void StackPush(stack OffsetStack)
The OffsetStack is pushed incrementally.
void UpdateEntity2(entity f, stack FormalStack __attribute__((__unused__)), stack OffsetStack __attribute__((__unused__)))
A subset of UpdateEntity, used when the function entity is already more defined because the return ty...
entity RenameFunctionEntity(entity oe)
Rename function oe if necessary.
static int C_line_number
To track the user line number, that is the one in the original user file.
entity make_C_or_Fortran_constant_entity(const char *name, tag bt, size_t size, bool is_fortran, bool(*error_manager)(const char *, const char *))
This function creates a constant.
static bool is_external
to know if the variable is declared inside or outside a function, so its scope is the current functio...
int dummy
A dummy file, to prevent empty libraries from breaking builds.
bool static_module_name_p(const char *name)
Check if the given name is a static module name.
bool compilation_unit_p(const char *module_name)
The names of PIPS entities carry information about their nature.
bool empty_string_p(const char *s)
const char * local_name(const char *s)
Does not take care of block scopes and returns a pointer.
const char * module_name(const char *s)
Return the module part of an entity name.
string safe_get_line_interval(const string fn, int f, int l)
return lines f-l from file fn as a string
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
void gen_free(gen_chunk *obj)
version without shared_pointers.
void CParserError(char *msg)
void reset_current_module_entity(void)
Reset the current module entity.
const char * get_current_module_name(void)
Get the name of the current module.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#define ENDP(l)
Test if a list is empty.
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#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)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#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
list gen_last(list l)
Return the last element of a list.
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#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.
bool gen_list_cyclic_p(const list ml)
int gen_occurences(const void *vo, const list l)
count occurences of vo in l
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
#define list_undefined
Undefined list definition :-)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
list gen_full_copy_list(list l)
Copy a list structure with element copy.
statement make_expression_statement(expression)
Build a statement from a given expression.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define DYNAMIC_AREA_LOCAL_NAME
#define MODULE_SEP
special characters to build entity names of various kinds
#define DUMMY_PARAMETER_PREFIX
For dmmmy parameters in functions declarations.
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define STACK_AREA_LOCAL_NAME
#define STATIC_AREA_LOCAL_NAME
#define MODULE_SEP_STRING
#define HEAP_AREA_LOCAL_NAME
#define MEMBER_SEP_STRING
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
void * gen_find_tabulated(const char *, int)
bool stack_empty_p(const stack)
stack stack_copy(const stack)
duplicate a stack with its contents.
void * stack_head(const stack)
returns the item on top of stack s
int stack_size(const stack)
observers
void stack_push(void *, stack)
stack use
void * stack_pop(stack)
POPs one item from stack s.
#define stack_undefined_p(s)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
list safe_c_words_entity(type t, list name)
list c_words_entity(type t, list name, list *ppdl)
void print_references(list rl)
void print_expressions(list le)
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
string expression_to_string(expression e)
bool same_entity_lname_p(entity, entity)
static int tc
Internal variables
static const char * prefix
#define ENTITY_ASSIGN_P(e)
#define ENTITY_DEREFERENCING_P(e)
#define DEFAULT_INTEGER_TYPE_SIZE
#define ENTITY_POINT_TO_P(e)
#define ENTITY_PRE_DECREMENT_P(e)
#define ENTITY_POST_DECREMENT_P(e)
#define DYNAMIC_RAM_OFFSET
FI: I would have assumed that it is used for the stack area, but I must be wrong.....
#define IMPLICIT_VARIABLE_NAME_1
Implicit variable names for C.
#define ENTITY_POST_INCREMENT_P(e)
#define ENTITY_CONDITIONAL_P(e)
#define UNKNOWN_RAM_OFFSET
#define ENTITY_PRE_INCREMENT_P(e)
#define UNDEFINED_RAM_OFFSET
#define entity_declarations(e)
MISC: newgen shorthands.
#define ENTITY_PLUS_C_P(e)
#define IMPLICIT_VARIABLE_NAME_2
#define ENTITY_FIELD_P(e)
C data structure and pointer management.
#define ENTITY_MINUS_C_P(e)
#define ENTITY_ADDRESS_OF_P(e)
#define MINUS_C_OPERATOR_NAME
void fprint_C_environment(FILE *fd, entity m)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool entity_list_p(list el)
Checks that el only contains entity.
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local 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 FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
bool dummy_parameter_entity_p(entity p)
is p a dummy parameter?
bool entity_formal_p(entity p)
is p a formal parameter?
bool string_block_scope_p(string s)
bool intrinsic_entity_p(entity e)
void update_dummy_parameter(parameter p, entity ep)
string empty_scope()
Functions used to manage the block scoping in conjunction with ContextStack and yco ntext.
string storage_to_string(storage s)
bool typedef_entity_p(entity e)
string local_name_to_scope(const char *ln)
allocates a new string
bool empty_scope_p(string s)
void print_entities(list l)
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
string safe_entity_name(entity e)
predicates and functions for entities
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
bool derived_entity_p(entity e)
const char * entity_module_name(entity e)
See comments about module_name().
bool member_entity_p(entity e)
entity MakeCompilationUnitEntity(const char *name)
This is useful for the C language only.
list extract_references_from_declarations(list decls)
FI: this function has not yet been extended for C types!!!
value EvalExpression(expression e)
Evaluate statically an expression.
bool expression_integer_value(expression e, intptr_t *pval)
expression reference_to_expression(reference r)
expression make_unbounded_expression()
expression MakeCommaExpression(list l)
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
list module_all_declarations(entity m)
The function itself is not in its declarations.
bool static_module_p(entity e)
Check if the given module entity is a static module.
bool compilation_unit_entity_p(entity e)
Check if the given module entity is a compilation unit.
list declaration_supporting_references(list dl)
Find all references in the declaration list.
entity find_ith_parameter(entity e, int i)
basic basic_of_expression(expression)
basic basic_of_expression(expression exp): Makes a basic of the same basic as the expression "exp".
bool call_compatible_type_p(type)
end of basic_concrete_types
bool SizeOfArray(entity, int *)
This function computes the total size of a variable in bytes, ie.
type make_char_array_type(int)
type expression_to_type(expression)
For an array declared as int a[10][20], the type returned for a[i] is int [20].
bool place_holder_variable_p(entity)
bool variable_entity_p(entity)
variable.c
void AddEntityToDeclarations(entity, entity)
END_EOLE.
type call_to_functional_type(call, bool)
The function called can have a functional type, or a typedef type or a pointer type to a functional t...
int add_C_variable_to_area(entity, entity)
string safe_type_to_string(const type)
bool type_equal_p(type, type)
type expression_to_user_type(expression)
Preserve typedef'ed types when possible.
bool check_C_function_type(entity, list)
Check that an effective parameter list is compatible with a function type.
type MakeIntegerResult(void)
bool pointer_type_p(type)
Check for scalar pointers.
string qualifier_to_string(qualifier)
type make_scalar_integer_type(_int)
bool formal_parameter_p(entity)
hash_table keyword_typedef_table
Because of typedefs, the C lexers need help to decide if a character string such as toto is a type na...
bool overloaded_type_p(type)
Returns true if t is a variable type with a basic overloaded.
bool qualifier_equal_p(qualifier, qualifier)
int CSafeSizeOfArray(entity)
BEGIN_EOLE.
#define type_functional_p(x)
#define value_undefined_p(x)
#define dummy_identifier(x)
#define normalized_undefined
#define functional_result(x)
#define REFERENCE(x)
REFERENCE.
struct _newgen_struct_value_ * value
#define storage_formal_p(x)
#define parameter_dummy(x)
#define parameter_type(x)
#define value_constant(x)
#define syntax_reference(x)
#define type_unknown_p(x)
#define code_undefined_p(x)
#define QUALIFIER(x)
QUALIFIER.
#define reference_variable(x)
#define value_intrinsic_p(x)
#define symbolic_constant(x)
#define type_functional(x)
#define value_unknown_p(x)
#define syntax_application(x)
#define parameter_undefined
#define constant_unknown_p(x)
#define dimension_lower(x)
#define basic_pointer_p(x)
#define entity_storage(x)
#define code_declarations(x)
@ is_syntax_sizeofexpression
#define value_constant_p(x)
#define call_domain
newgen_callees_domain_defined
#define storage_formal(x)
#define value_symbolic(x)
#define basic_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define type_undefined_p(x)
#define entity_undefined_p(x)
#define reference_domain
newgen_range_domain_defined
#define constant_int_p(x)
#define expression_undefined
#define value_symbolic_p(x)
#define functional_parameters(x)
#define code_initializations(x)
#define PARAMETER(x)
PARAMETER.
#define formal_function(x)
#define dimension_upper(x)
#define reference_indices(x)
#define variable_qualifiers(x)
#define expression_undefined_p(x)
#define application_function(x)
#define variable_dimensions(x)
#define statement_declarations(x)
#define call_arguments(x)
#define parameter_undefined_p(x)
#define value_expression_p(x)
#define expression_syntax(x)
#define entity_domain_number(x)
#define storage_return_p(x)
#define dummy_identifier_p(x)
#define type_variable_p(x)
#define symbolic_expression(x)
#define value_expression(x)
#define storage_undefined_p(x)
#define entity_domain
newgen_syntax_domain_defined
#define variable_basic(x)
#define STATEMENT(x)
STATEMENT.
#define storage_undefined
#define entity_initial(x)
Value b1
booleen indiquant quel membre est en cours d'analyse
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
static int line
FLEX_SCANNER.
The structure used to build lists in NewGen.
struct cons * cdr
The pointer to the next element.
gen_chunk car
The data payload of a list element.
void gen_clear_tabulated_element(gen_chunk *obj)
GEN_CLEAR_TABULATED_ELEMENT only clears the entry for object OBJ in the gen_tabulated_ and gen_tabula...
char * int2a(int i)
util.c
A gen_chunk is used to store every object.
#define exp
Avoid some warnings from "gcc -Wshadow".