27 #if defined(BUILDER_CHECK_INITIALIZE_VLA_WITH_EFFECTS) || \
28 defined(BUILDER_CHECK_INITIALIZE_VLA_WITH_PRECONDITIONS) || \
29 defined(BUILDER_CHECK_INITIALIZE_VLA_WITH_REGIONS) || \
30 defined(BUILDER_INITIALIZE_VLA_WITH_EFFECTS) || \
31 defined(BUILDER_INITIALIZE_VLA_WITH_PRECONDITIONS) || \
32 defined(BUILDER_INITIALIZE_VLA_WITH_REGIONS)
35 #include "pips_config.h"
122 typedef struct ctx_initvla {
123 bool error_on_uninitialize_p;
124 bool warning_on_uninitialize_p;
125 bool semantics_analyze_constant_path_p;
142 static void add_dependence_reference(ctx_initvla_t *ctx,
reference dep_ref,
entity decl,
string message,
bool need_initialize_p) {
144 if (need_initialize_p) {
147 ctx->to_initialize =
CONS(
REFERENCE, dep_ref, ctx->to_initialize);
155 if (ctx->warning_on_uninitialize_p) {
159 if (ctx->error_on_uninitialize_p) {
168 static void statement_check_initialize_vla_with_preconditions(
statement s, ctx_initvla_t *ctx) {
172 pips_debug(2,
"declaration statement to analyze:\n");
203 if (!
ENDP(dep_arg)) {
205 if (ctx->semantics_analyze_constant_path_p) {
207 pips_internal_error(
"management of semantics_analyze_constant_path, not implemented yet.\n");
212 add_dependence_reference(ctx, dep_ref, decl,
213 "Detection of a dependence with an array that can't be analyze.\n"
214 "Try to set SEMANTICS_ANALYZE_CONSTANT_PATH at true.\n",
231 add_dependence_reference(ctx, dep_ref, decl, mess,
true);
237 add_dependence_reference(ctx, dep_ref, decl, mess,
false);
245 pips_user_error(
"This case must never happen.\n It mean the precondition system is unconsistent?\n");
269 static bool check_initialize_vla_generic(
const char*
module_name,
bool with_preconditions_p,
bool with_efects_p,
bool with_regions_p) {
272 bool good_result_p =
false;
274 pips_assert(
"with_preconditions_p or with_efects_p or with_regions_p must be true.\n",
275 with_preconditions_p || with_efects_p || with_regions_p);
277 debug_on(
"INITIALIZE_VLA_DEBUG_LEVEL");
293 if (with_preconditions_p) {
310 ctx.to_initialize =
NIL;
313 ctx.semantics_analyze_constant_path_p =
get_bool_property(
"SEMANTICS_ANALYZE_CONSTANT_PATH");
318 if (with_preconditions_p) {
319 good_result_p = check_initialize_vla_with_preconditions_on_statement(
module_statement, &ctx);
328 if (with_preconditions_p) {
338 return (good_result_p);
345 return check_initialize_vla_generic(
module_name,
true,
false,
false);
409 entity init_value = ctx->init_value;
432 if (!
ENDP(ctx->to_initialize)) {
440 if (!
ENDP(ctx->to_initialize)) {
450 static bool initialize_vla_generic(
const char*
module_name,
bool with_preconditions_p,
bool with_efects_p,
bool with_regions_p) {
453 bool good_result_p =
false;
455 pips_assert(
"with_preconditions_p or with_efects_p or with_regions_p must be true.\n",
456 with_preconditions_p || with_efects_p || with_regions_p);
458 debug_on(
"INITIALIZE_VLA_DEBUG_LEVEL");
476 if (with_preconditions_p) {
493 ctx.to_initialize =
NIL;
494 ctx.warning_on_uninitialize_p =
false;
495 ctx.error_on_uninitialize_p =
false;
496 ctx.semantics_analyze_constant_path_p =
get_bool_property(
"SEMANTICS_ANALYZE_CONSTANT_PATH");
504 if (with_preconditions_p) {
505 check_initialize_vla_with_preconditions_on_statement(
module_statement, &ctx);
509 if (ctx.to_initialize !=
NIL) {
524 if (with_preconditions_p) {
534 return (good_result_p);
541 return initialize_vla_generic(
module_name,
true,
false,
false);
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
int get_int_property(const string)
value make_value_expression(expression _field_)
void free_reference(reference p)
bool statement_consistent_p(statement p)
static reference ref
Current stmt (an integer)
static statement module_statement
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....
#define gen_chunk_undefined_p(c)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
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
void * gen_chunk_identity(gen_chunk x)
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
#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 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)
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.
void * gen_find(const void *item, const list seq, gen_filter2_func_t test, gen_extract_func_t extract)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
#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
bool(* gen_filter2_func_t)(const void *, const void *)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
void print_references(list rl)
string reference_to_string(reference r)
void print_statement(statement)
Print a statement on stderr.
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
bool reference_equal_p(reference r1, reference r2)
list dependence_of_dependent_type(type)
similar to dependent_type_p but return a list of reference on which the type depend.
entity make_integer_constant_entity(_int)
entity make_integer_constant_entity(int c) make entity for integer constant c
#define REFERENCE(x)
REFERENCE.
#define reference_variable(x)
#define value_unknown_p(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define entity_undefined_p(x)
#define transformer_relation(x)
#define reference_indices(x)
#define statement_declarations(x)
#define predicate_system(x)
#define entity_initial(x)
Psysteme sc_copy(Psysteme ps)
Psysteme sc_copy(Psysteme ps): duplication d'un systeme (allocation et copie complete des champs sans...
bool sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour tr...
transformer load_statement_precondition(statement)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
The structure used to build lists in NewGen.