25 #include "pips_config.h"
54 #include "resources.h"
67 #define PREC_FORESYS_PREFIX "C$PREC"
68 #define TRAN_FORESYS_PREFIX "C$TRAN"
230 (
"PRETTYPRINT_UNSTRUCTURED_AS_A_GRAPH") ?
240 DBR_GRAPH_PRINTED_FILE :
277 debug_on(
"SEMANTICS_PRINT_DEBUG_LEVEL");
294 DBR_TOTAL_PRECONDITIONS : DBR_PRECONDITIONS),
300 DBR_SUMMARY_TOTAL_PRECONDITION: DBR_SUMMARY_PRECONDITION),
314 pips_debug(7,
"summary text consistent? %s\n",
329 if (give_code_p ==
true) {
424 if(is_equal==0 && !
vect_equal(*pvarval1, *pvarval2))
433 #define append(s) add_to_current_line(crt_line, s, str_prefix, txt)
438 bool is_inferior =
true;
489 append(
" TRANSFORMER: TRANSFORMER_UNDEFINED");
491 append(
" TOTAL PRECONDITION: TRANSFORMER_UNDEFINED");
493 append(
" PRECONDITION: TRANSFORMER_UNDEFINED");
560 #define MAX_PRED_COMMENTARY_STRLEN 70
572 string comment_prefix;
575 string str_suiv = NULL;
576 string str_prefix = comment_prefix;
578 int len, new_str_pred_len, longueur_max;
579 bool premiere_ligne =
true;
587 while((len = strlen(str_pred)) > 0) {
588 if (len > longueur_max) {
593 (void) strncat(str_tmp, str_pred, longueur_max);
596 str_suiv = strrchr(str_tmp,
')');
598 str_suiv = strrchr(str_tmp,
',');
600 new_str_pred_len = (strlen(str_tmp) - strlen(str_suiv)) + 1;
601 str_suiv =
strdup(&(str_pred[new_str_pred_len]));
605 (void) strcat(str_tmp,
" ");
606 (void) strncat(str_tmp, str_pred, new_str_pred_len);
618 (void) strcat(str_tmp,
" ");
619 (void) strcat(str_tmp, str_pred);
627 if (premiere_ligne) {
628 premiere_ligne =
false;
629 longueur_max = longueur_max - 1;
632 int nb_espaces = strlen(str_prefix) -
635 str_prefix =
strdup(str_prefix);
636 str_prefix[0] =
'\0';
638 for (i=1; i <= nb_espaces; i++)
639 (
void) strcat(str_prefix,
" ");
655 string comment_prefix;
680 string comment_prefix;
691 char * str_tmp = NULL;
732 #include "pips-libs.h"
733 #ifdef HAVE_PIPS_icfg_LIBRARY
sentence make_sentence_formatted(string _field_)
bool text_consistent_p(text p)
sentence make_sentence(enum sentence_utype tag, void *val)
void attach_transformers_decoration_to_text(text t)
Attach a transformers decoration:
void attach_preconditions_decoration_to_text(text t)
Attach a preconditions decoration:
void attach_decoration_to_text(text t)
Attach a decoration:
void begin_attachment_prettyprint(void)
The translation functions between unique names and objects:
void end_attachment_prettyprint(void)
Clean the things related with the attachment of properties:
void attach_total_preconditions_decoration_to_text(text __attribute__((unused)) t)
Attach a total preconditions decoration:
bool print_decorated_call_graph(const string, text(*)(const string))
struct _newgen_struct_statement_ * statement
void entity_list_text_format(string line, string continuation, text t, list le, const char *(*var_name)(entity))
appends the list of entity...
void system_text_format(string line, string prefix, text txt, Psysteme ps, string(*variable_name)(Variable), bool a_la_fortran)
appends ps to line/txt with prefix continuations.
void sc_syst_debug(Psysteme s)
constraint_to_text.c
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
list load_cumulated_rw_effects_list(statement)
void reset_cumulated_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
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 NIL
The empty list (nil in Lisp)
#define list_undefined
Undefined list definition :-)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
statement apply_number_to_statement(hash_table, _int)
hash_table allocate_number_to_statement(void)
hash_table build_number_to_statement(hash_table, statement)
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
bool generic_print_icfg(const string, bool, bool, bool, text(*)(const string))
bool generic_print_icfg_precise(const string, bool, bool, bool, text(*)(entity, entity, statement, call))
static statement mod_stat
We want to keep track of the current statement inside the recurse.
bool vect_equal(Pvecteur v1, Pvecteur v2)
bool vect_equal(Pvecteur v1, Pvecteur v2): test a egalite de deux vecteurs
#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
const char * entity_minimal_name(entity e)
Do preserve scope informations.
#define DEFINE_CURRENT_MAPPING(name, type)
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define hash_table_undefined
Value of an undefined hash_table.
string get_comment_sentinel()
Start a single line comment.
string get_comment_continuation()
Start a single line comment with continuation (blank spaces)
void close_prettyprint()
because some prettyprint functions may be used for debug, so the last hook set by somebody may have s...
void init_prettyprint(text(*hook)(entity, int, statement))
checks that the prettyprint hook was actually reset...
text text_module(entity, statement)
void print_number_to_statement(hash_table)
bool make_text_resource(const char *, const char *, const char *, text)
print.c
void set_bool_property(const char *, bool)
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.
#define transformer_undefined
#define transformer_undefined_p(x)
#define transformer_relation(x)
#define transformer_arguments(x)
struct _newgen_struct_transformer_ * transformer
#define statement_undefined_p(x)
#define statement_number(x)
#define predicate_system(x)
#define statement_undefined
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Psysteme sc_copy(Psysteme ps)
Psysteme sc_copy(Psysteme ps): duplication d'un systeme (allocation et copie complete des champs sans...
void sc_lexicographic_sort(Psysteme sc, int(*compare)(Pvecteur *, Pvecteur *))
Minimize first the lexico-graphic weight of each constraint according to the comparison function "com...
#define SEQUENTIAL_PRECONDITION_SUFFIX
#define SEQUENTIAL_TOTAL_PRECONDITION_SUFFIX
#define USER_TOTAL_PRECONDITION_SUFFIX
#define USER_PRECONDITION_SUFFIX
#define SEQUENTIAL_TRANSFORMER_SUFFIX
#define USER_TRANSFORMER_SUFFIX
void translate_global_values(entity m, transformer tf)
text call_site_to_module_precondition_text(entity caller, entity callee, statement s, call c)
This function does everything needed.
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
static bool is_total_precondition
static bool is_transformer
static int semantics_is_inferior_pvarval(Pvecteur *pvarval1, Pvecteur *pvarval2)
The strange argument type is required by qsort(), deep down in the calls.
bool print_source_transformers(const char *module_name)
bool print_code_total_preconditions(const char *module_name)
#define PREC_FORESYS_PREFIX
text text_for_a_transformer(transformer tran, bool is_a_transformer)
call this one from outside.
bool print_call_graph_with_total_preconditions(const string module_name)
void set_prettyprint_transformer(void)
sentence make_pred_commentary_sentence(string str_pred, string comment_prefix)
sentence make_pred_commentary_sentence(string str_pred, string comment_prefix) input : a substring fo...
text get_text_total_preconditions(const string module_name)
bool print_call_graph_with_transformers(const string module_name)
bool print_code_as_a_graph_total_preconditions(const string mod_name)
bool print_code_transformers(const char *module_name)
text string_predicate_to_commentary(string str_pred, string comment_prefix)
text string_predicate_to_commentary(string str_pred, string comment_prefix) input : a string,...
bool print_call_graph_with_preconditions(const string module_name)
static text get_semantic_text(const char *, bool)
bool print_code_as_a_graph_transformers(const string mod_name)
bool print_source_preconditions(const char *module_name)
text semantic_to_text(entity module, int margin, statement stmt)
this function name is VERY misleading - it should be changed, sometime FI
bool print_code_preconditions(const char *module_name)
bool print_code_as_a_graph_preconditions(const string mod_name)
static bool is_transformer_filtered
text words_predicate_to_commentary(list w_pred, string comment_prefix)
text words_predicate_to_commentary(list w_pred, string comment_prefix) input : a list of strings,...
#define TRAN_FORESYS_PREFIX
text text_transformer(transformer tran)
text text_transformer(transformer tran) input : a transformer representing a transformer or a precond...
bool print_source_total_preconditions(const char *module_name)
text get_text_preconditions(const string module_name)
text get_text_transformers(const string module_name)
static bool print_code_semantics()
static bool __attribute__((unused))
#define MAX_PRED_COMMENTARY_STRLEN
to convert strings containing predicates to text of commentaries
bool print_icfg_with_loops_total_preconditions(const string)
transformer load_statement_semantic(statement)
bool print_icfg_with_preconditions(const string)
bool print_icfg_with_total_preconditions(const string)
void set_semantic_map(statement_mapping)
bool print_icfg_with_control_preconditions(const string)
bool print_icfg_with_control_transformers(const string)
void reset_semantic_map(void)
bool print_icfg_with_loops_transformers(const string)
bool print_icfg_with_loops_preconditions(const string)
bool print_icfg_with_transformers(const string)
bool print_icfg_with_control_total_preconditions(const string)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define FORESYS_CONTINUATION_PREFIX
#define MERGE_TEXTS(r, t)
#define ADD_SENTENCE_TO_TEXT(t, p)
#define MAX_LINE_LENGTH
maximum length of a line when prettyprinting...
string words_to_string(cons *lw)
void dump_text(text t)
FI: print_text() should be fprint_text() and dump_text(), print_text()
void close_current_line(string, text, string)
#define sentence_undefined
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....