25 #include "pips_config.h"
34 #include "constants.h"
70 pips_debug(8,
"Current module declarations:\n");
139 string lufn = strrchr(aufn,
'/')+1;
142 string n = strstr(lufn, PP_C_ED);
161 pips_assert(
"If defined, cu is a compilation unit",
178 string n = strstr(aufn, lid);
361 string source_file_name =
363 string simpler_file_name =
pips_basename(source_file_name, PP_C_ED);
369 free(simpler_file_name);
387 string source_file_name =
389 string simpler_file_name =
pips_basename(source_file_name, PP_C_ED);
395 free(simpler_file_name);
398 return input_file_name;
bool db_resource_p(const char *rname, const char *oname)
true if exists and in loaded or stored state.
bool db_resource_required_or_available_p(const char *rname, const char *oname)
from now on we must not know about the database internals?
bool db_touch_resource(const char *rname, const char *oname)
touch logical time for resource[owner], possibly behind the back of pipsdbm.
bool entity_is_argument_p(entity e, cons *args)
string compilation_unit_name
cproto-generated files
bool compilation_unit_parser(const char *module_name)
struct _newgen_struct_statement_ * statement
bool controlizer(const char *module_name)
The old controlizer user interface.
bool static_module_name_p(const char *name)
Check if the given name is a static module name.
const char * module_name(const char *s)
Return the module part of an entity name.
char * pips_basename(char *fullpath, char *suffix)
void set_current_module_declarations(list)
list get_current_module_declarations(void)
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
entity get_current_module_entity(void)
Get the entity of the current module.
#define list_undefined_p(c)
Return if a list is undefined.
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
#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
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.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
void db_put_or_update_memory_resource(const char *rname, const char *oname, void *p, bool update_is_ok)
Put a resource into the current workspace database.
statement remove_declaration_statement(statement, entity)
Declarations are not only lists of entities, but also statement to carry the line number,...
list statement_to_declarations(void *)
Get a list of all variables declared recursively within a statement.
#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 pips_internal_error
#define DUMMY_STRUCT_PREFIX
#define DUMMY_UNION_PREFIX
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define same_string_p(s1, s2)
void * gen_find_tabulated(const char *, int)
#define WORKSPACE_SRC_SPACE
string db_get_current_workspace_directory(void)
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define entity_declarations(e)
MISC: newgen shorthands.
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.
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.
bool c_module_p(entity m)
Test if a module "m" is written in C.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
bool typedef_entity_p(entity e)
const char * module_local_name(entity e)
Returns the module local user name.
void print_entities(list l)
bool entity_module_p(entity e)
bool compilation_unit_entity_p(entity e)
Check if the given module entity is a compilation unit.
void set_keyword_typedef_table(hash_table)
void AddLocalEntityToDeclarations(entity, entity, statement)
Add the variable entity e to the list of variables of the function module.
void declare_new_typedef(const string)
list type_supporting_entities(list, type)
#define code_declarations(x)
#define entity_undefined_p(x)
#define statement_declarations(x)
#define statement_undefined_p(x)
#define entity_domain
newgen_syntax_domain_defined
#define statement_undefined
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
static int lname(char *s, int look_for_entry)
check for keywords for subprograms return 0 if comment card, 1 if found name and put in arg string.
char * strndup(char const *s, size_t n)
A replacement function, for systems that lack strndup.
The structure used to build lists in NewGen.
list module_declarations(entity m)
High-level functions about modules, using pipsdbm and ri-util and some global variables assumed prope...
list module_to_all_declarations(entity m)
bool language_module_p(entity m, string lid)
string module_name_to_input_file_name(const char *module_name)
To be checked for static functions...
string compilation_unit_of_module(const char *module_name)
The output is undefined if the module is referenced but not defined in the workspace,...
list current_module_declarations()
void AddEntityToCompilationUnit(entity e, entity cu)
Add an entity to the current's module compilation unit declarations we have to generate its statement...
list module_entities(entity m)
Return a list of all variables and functions accessible somewhere in a module.
void RemoveEntityFromCompilationUnit(entity e, entity cu)
Remove an entity from the current's module compilation unit declarations.
void AddEntityToModuleCompilationUnit(entity e, entity module)
entity module_entity_to_compilation_unit_entity(entity m)
Retrieve the compilation unit containing a module definition.