PIPS
|
#include "linear.h"
#include "genC.h"
#include "text.h"
#include "newgen.h"
#include "naming.h"
#include "ri.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include "workspace-util.h"
Go to the source code of this file.
Functions | |
void | add_new_compilation_unit (const char *, bool, entity) |
Warning! Do not modify this file that is automatically generated! More... | |
bool | add_new_module_from_text (const char *, text, bool, const char *) |
Add the new resource files associated to a module with its more-or-less correct code. More... | |
bool | add_new_module (const char *, entity, statement, bool) |
Add the new resource files associated to a module with its more-or-less correct code. More... | |
void | set_internal_missing_module_resolver_handler (string(*)(const char *)) |
bool | fortran_initializer (const string) |
Create a module with its related file resources when there is no Fortran source for it. More... | |
bool | initializer (const string) |
A phase that creates a module with its related file resources when there is no Fortran source for it. More... | |
bool | c_initializer (const string) |
A phase that creates a module with its related file resources when there is no C source for it. More... | |
bool | clone_on_argument (const string) |
clone.c More... | |
bool | clone (const string) |
bool | clone_substitute (const string) |
bool | clone_only (const string) |
void add_new_compilation_unit | ( | const char * | compilation_unit_name, |
bool | is_fortran, | ||
entity | module | ||
) |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/syntheses/syntheses-local.h instead, to add your own modifications. header file built by cproto syntheses-local.h SYNTHESES Library: Passes and functions generating new modules, or removing modules, such as initializer, clone, inlining and outlining cproto-generated files initializer.c
Add the compilation unit files
Builds the compilation unit stub: it can be empty or include module_name declaration as an extern function.
Put it in the source file and link the initial file.
compilation_unit_name | ompilation_unit_name |
is_fortran | s_fortran |
module | odule |
Definition at line 367 of file initializer.c.
References asprintf, compilation_unit_name, compilation_unit_text(), db_build_file_resource_name(), db_get_current_workspace_directory(), db_make_subdirectory, DB_PUT_FILE_RESOURCE, entity_undefined_p, f(), file_exists_p(), file_name, FindEntity(), free(), free_text(), full_name, make_text(), MakeCompilationUnitEntity(), module, NIL, pips_assert, print_text(), safe_fclose(), safe_fopen(), strdup(), string_undefined_p, TOP_LEVEL_MODULE_NAME, user_log(), and WORKSPACE_TMP_SPACE.
Referenced by add_new_module_from_text(), and outliner_compilation_unit().
Add the new resource files associated to a module with its more-or-less correct code.
The idea is to prettyprint the module to some file resources and to parse it later in order to have a full-fledge module with all the PIPS structured up-to-date.
Useful for code generation, out-lining...
There is still some redundancy with module_name, module and stat
Get a text code for the new module
module_name | odule_name |
module | odule |
stat | tat |
is_fortran | text heading |
Definition at line 553 of file initializer.c.
References add_new_module_from_text(), free_text(), module, module_name(), ret, string_undefined, and text_module().
Referenced by create_module_with_statement().
bool add_new_module_from_text | ( | const char * | module_name, |
text | code_text, | ||
bool | is_fortran, | ||
const char * | compilation_unit_name | ||
) |
Add the new resource files associated to a module with its more-or-less correct code.
The idea is to prettyprint the module to some file resources and to parse it later in order to have a full-fledge module with all the PIPS data structures up-to-date.
Useful for code generation, out-lining, stub generation...
Should be checked with different module with the same name... Maybe a conflict in WORKSPACE_TMP_SPACE ?
relative to the current directory
For C only: compilation unit cu and compilation unit name cun
depending on output language, build compilation unit, select prettyprinter choose out file name
pips' current directory is just above the workspace
Put the code text in the temporary source file
A PIPS database may be partly incoherent after a core dump but still usable (Cathare 2, FI). So delete a previously finit_name file.
The initial file is linked to the newly generated temporary file:
Add the new generated file as a file resource with its local name... should only put a new user file, I guess?
The user file dwells in the WORKSPACE_TMP_SPACE
module_name | odule_name |
code_text | ode_text |
is_fortran | s_fortran |
compilation_unit_name | ompilation_unit_name |
Definition at line 431 of file initializer.c.
References add_new_compilation_unit(), asprintf, compilation_unit_name, compilation_unit_of_module(), db_build_file_resource_name(), db_get_current_workspace_directory(), db_make_subdirectory, DB_PUT_FILE_RESOURCE, entity_local_name(), entity_undefined, entity_undefined_p, f(), file_exists_p(), file_name, FILE_SEP, FILE_SEP_STRING, FindEntity(), free(), full_name, is_language_c, is_language_fortran, local_name_to_top_level_entity(), MakeCompilationUnitEntity(), module_name(), module_name_to_entity(), pips_user_error, print_text(), safe_fclose(), safe_fopen(), safe_link(), safe_unlink(), set_prettyprint_language_tag(), strdup(), string_undefined, string_undefined_p, strndup(), TOP_LEVEL_MODULE_NAME, user_log(), and WORKSPACE_TMP_SPACE.
Referenced by add_new_module(), create_module_with_statement(), missing_file_initializer(), outliner_file(), outliner_independent_recursively(), and simd_memory_packing().
bool c_initializer | ( | const | string | ) |
A phase that creates a module with its related file resources when there is no C source for it.
string | odule_name |
Definition at line 853 of file initializer.c.
References debug_off, debug_on, generic_initializer(), and module_name().
bool clone | ( | const | string | ) |
string | ame |
Referenced by get_private_entities(), and insert_rwt().
bool clone_only | ( | const | string | ) |
string | od_name |
bool clone_substitute | ( | const | string | ) |
string | ame |
bool fortran_initializer | ( | const | string | ) |
Create a module with its related file resources when there is no Fortran source for it.
string | odule_name |
Definition at line 831 of file initializer.c.
References generic_initializer(), and module_name().
bool initializer | ( | const | string | ) |
A phase that creates a module with its related file resources when there is no Fortran source for it.
string | odule_name |
Definition at line 839 of file initializer.c.
References debug_off, debug_on, generic_initializer(), and module_name().
void set_internal_missing_module_resolver_handler | ( | string(*)(const char *) | _internal_resolver | ) |
Definition at line 612 of file initializer.c.
References internal_resolver.
Referenced by set_python_missing_module_resolver_handler().