PIPS
|
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdarg.h>
#include "linear.h"
#include "genC.h"
#include "ri.h"
#include "database.h"
#include "misc.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include "resources.h"
#include "phases.h"
#include "properties.h"
#include "pipsmake.h"
#include "text-util.h"
#include "top-level.h"
#include <Python.h>
Go to the source code of this file.
Functions | |
statement | find_loop_from_label (statement, entity) |
hmmm... More... | |
static void | pyps_log_handler (const char *fmt, va_list *args) |
static void | pyps_error_handler (const char *calling_function_name, const char *a_message_format, va_list *args) |
void | close_log_buffer (void) |
void | open_log_buffer (void) |
char * | get_log_buffer (void) |
void | verbose (bool on) |
DEFINE_LOCAL_STACK (properties, property) | |
stack of properties, so that the previous value can be reinstated when going out of a phase. More... | |
void | set_property (const char *propname, const char *value) |
void | push_property (const char *name, const char *value) |
void | pop_property (const char *name) |
void | atinit (void) |
void | create (char *workspace_name, char **filenames) |
create a new workspace... More... | |
char * | info (char *about) |
void | apply (char *phasename, char *target) |
apply a transformation on a module More... | |
void | capply (char *phasename, char **targets) |
apply a transformation on a set of modules, concurrently More... | |
void | display (char *rname, char *mname) |
display resource rname about module mname More... | |
char * | show (char *rname, char *mname) |
return the rname[mname] resource, which must be a string containing a file name More... | |
char * | get_callers_of (char *module_name) |
Returns the list of the modules that call that specific module, separated by ' '. More... | |
char * | get_callees_of (char *module_name) |
Returns the list of the modules called by that specific module, separated by ' '. More... | |
char * | pyps_get_stubs (void) |
Returns the list of the modules called by that specific module, separated by ' '. More... | |
void | setenviron (char *name, char *value) |
add an environment variable of a given value More... | |
char * | getenviron (char *name) |
get environment variable More... | |
bool | add_a_file (string file) |
Add a source file to the workspace We wrap process_user_file() here with a hack to define the workspace language so that some pipsmake activate specific to the language will be defined. More... | |
char * | get_module_language (string mod_name) |
static string | get_stub_from_broker (string str) |
void | set_python_missing_module_resolver_handler (PyObject *PyObj) |
bool | get_loop_execution_parallel (const char *module_name, const char *loop_label) |
Read execution mode for a loop. More... | |
void | set_loop_execution_parallel (const char *module_name, const char *loop_label, bool exec_parallel_p) |
Change execution mode for a loop. More... | |
Variables | |
static FILE * | logstream = NULL |
static list | log_list = list_undefined |
char * | pyps_last_error = NULL |
static PyObject * | stub_broker = NULL |
Add a source file to the workspace We wrap process_user_file() here with a hack to define the workspace language so that some pipsmake activate specific to the language will be defined.
This function will be removed when pipsmake will be improved to handle multilanguage workspace !
Definition at line 466 of file pypips.c.
References activate_language(), free_language(), gen_array_append(), gen_array_free(), gen_array_make(), pips_user_error, process_user_file(), and workspace_language().
void apply | ( | char * | phasename, |
char * | target | ||
) |
apply a transformation on a module
Definition at line 324 of file pypips.c.
References asprintf, pyps_last_error, safe_apply(), THROW, and user_exception_error.
void atinit | ( | void | ) |
init various composants
Definition at line 222 of file pypips.c.
References entity_local_name(), initialize_newgen(), initialize_sc(), pips_error_handler, pips_log_handler, pop_pips_context(), push_pips_context(), pyps_error_handler(), pyps_log_handler(), set_exception_callbacks(), and set_pips_meta_informations().
void capply | ( | char * | phasename, |
char ** | targets | ||
) |
apply a transformation on a set of modules, concurrently
Definition at line 336 of file pypips.c.
References asprintf, gen_array_append(), gen_array_free(), gen_array_make(), ok, pyps_last_error, safe_concurrent_apply(), THROW, and user_exception_error.
void close_log_buffer | ( | void | ) |
Definition at line 137 of file pypips.c.
References gen_free_string_list(), list_undefined, list_undefined_p, and log_list.
Referenced by open_log_buffer().
void create | ( | char * | workspace_name, |
char ** | filenames | ||
) |
create a new workspace...
FC: what about opening an existing one?
Definition at line 239 of file pypips.c.
References create_workspace(), db_close_workspace(), db_create_workspace(), db_get_current_workspace_name(), gen_array_append(), gen_array_free(), gen_array_make(), pips_user_error, and workspace_exists_p().
DEFINE_LOCAL_STACK | ( | properties | , |
property | |||
) |
stack of properties, so that the previous value can be reinstated when going out of a phase.
void display | ( | char * | rname, |
char * | mname | ||
) |
display resource rname about module mname
Definition at line 358 of file pypips.c.
References build_view_file(), db_get_current_module_name(), db_reset_current_module_name(), db_set_current_module_name(), free(), pips_user_error, safe_display(), and strdup().
hmmm...
when all header files are not yet generated cproto may silently fail to generate these headers. this few declarations allow to generate headers without anything else. ri needed for statement_mapping in pipsdbm...
label | abel |
Definition at line 218 of file util.c.
Referenced by get_loop_execution_parallel(), and set_loop_execution_parallel().
char* get_callees_of | ( | char * | module_name | ) |
Returns the list of the modules called by that specific module, separated by ' '.
Definition at line 420 of file pypips.c.
References gen_array_free(), get_callees(), module_name(), safe_make(), strdup(), and string_array_join().
char* get_callers_of | ( | char * | module_name | ) |
Returns the list of the modules that call that specific module, separated by ' '.
Definition at line 408 of file pypips.c.
References gen_array_free(), get_callers(), module_name(), safe_make(), strdup(), and string_array_join().
char* get_log_buffer | ( | void | ) |
Definition at line 153 of file pypips.c.
References assert, gen_copy_seq(), gen_free_list(), gen_nreverse(), list_undefined_p, log_list, ret, and words_to_string().
bool get_loop_execution_parallel | ( | const char * | module_name, |
const char * | loop_label | ||
) |
Read execution mode for a loop.
Definition at line 561 of file pypips.c.
References db_get_memory_resource(), entity_undefined_p, execution_parallel_p, find_label_entity(), find_loop_from_label(), get_current_module_statement(), loop_execution, loop_label, module_name(), module_name_to_entity(), pips_user_error, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), statement_loop(), and statement_undefined_p.
char* get_module_language | ( | string | mod_name | ) |
Definition at line 487 of file pypips.c.
References is_language_c, is_language_fortran, is_language_fortran95, language_tag, module_language, and module_name_to_entity().
Definition at line 514 of file pypips.c.
References fprintf(), strdup(), and stub_broker.
Referenced by set_python_missing_module_resolver_handler().
char* getenviron | ( | char * | name | ) |
char* info | ( | char * | about | ) |
Definition at line 278 of file pypips.c.
References db_get_current_module_name(), db_get_current_workspace_name(), db_get_module_list(), fprintf(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), MAXPATHLEN, same_string_p, strdup(), and string_array_join().
Referenced by constraints_sort_info(), constraints_sort_with_compare(), sc_build_triang_elim_redund(), and sc_triang_elim_redund().
void open_log_buffer | ( | void | ) |
Definition at line 146 of file pypips.c.
References close_log_buffer(), list_undefined_p, log_list, and NIL.
void pop_property | ( | const char * | name | ) |
Definition at line 209 of file pypips.c.
References property_bool, property_bool_p, property_int, property_string, property_string_p, set_bool_property(), set_int_property(), and set_string_property().
void push_property | ( | const char * | name, |
const char * | value | ||
) |
Definition at line 202 of file pypips.c.
References copy_property(), get_property(), set_property(), and strdup().
|
static |
Definition at line 111 of file pypips.c.
References asprintf, free(), pyps_last_error, and vasprintf().
Referenced by atinit().
char* pyps_get_stubs | ( | void | ) |
Returns the list of the modules called by that specific module, separated by ' '.
Definition at line 435 of file pypips.c.
References gen_array_free(), get_stubs(), strdup(), and string_array_join().
|
static |
Definition at line 85 of file pypips.c.
References CONS, list_undefined_p, log_list, logstream, STRING, and vasprintf().
Referenced by atinit().
void set_loop_execution_parallel | ( | const char * | module_name, |
const char * | loop_label, | ||
bool | exec_parallel_p | ||
) |
Change execution mode for a loop.
Definition at line 586 of file pypips.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, entity_undefined_p, execution_tag, find_label_entity(), find_loop_from_label(), get_current_module_statement(), is_execution_parallel, is_execution_sequential, loop_execution, loop_label, module_name(), module_name_to_entity(), pips_user_error, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), statement_loop(), and statement_undefined_p.
void set_property | ( | const char * | propname, |
const char * | value | ||
) |
Definition at line 176 of file pypips.c.
References asprintf, buf, free(), pips_user_error, safe_set_property(), and STDERR_FILENO.
Referenced by push_property().
void set_python_missing_module_resolver_handler | ( | PyObject * | PyObj | ) |
Dispose of previous callback
Remember new callback
Record of new callback
Definition at line 550 of file pypips.c.
References get_stub_from_broker(), set_internal_missing_module_resolver_handler(), and stub_broker.
void setenviron | ( | char * | name, |
char * | value | ||
) |
char* show | ( | char * | rname, |
char * | mname | ||
) |
return the rname[mname] resource, which must be a string containing a file name
Definition at line 388 of file pypips.c.
References db_get_memory_resource(), db_resource_p(), displayable_file_p(), pips_user_warning, and strdup().
void verbose | ( | bool | on | ) |
|
static |
Definition at line 83 of file pypips.c.
Referenced by close_log_buffer(), get_log_buffer(), open_log_buffer(), and pyps_log_handler().
|
static |
Definition at line 82 of file pypips.c.
Referenced by pyps_log_handler(), and verbose().
char* pyps_last_error = NULL |
Definition at line 109 of file pypips.c.
Referenced by apply(), capply(), and pyps_error_handler().
|
static |
Definition at line 506 of file pypips.c.
Referenced by get_stub_from_broker(), and set_python_missing_module_resolver_handler().