25 #include "pips_config.h"
71 ((s[0]==
'\'' && s[len-1]==
'\'') || (s[0]==
'"' && s[len-1]==
'"')))
78 while (len>0 && s[len-1]==
' ')
103 int l1, l2, i, c = 0;
111 for (i=0; c==0 && i<l1 && i<l2; i++)
113 if (
s1[i] < s2[i]) c = -i-1;
114 if (
s1[i] > s2[i]) c = i+1;
119 c = (l1<l2)? -l1-1: l2+1;
422 bool address_p =
false;
543 bool is_e_reference_to_v =
false;
550 return is_e_reference_to_v;
664 debug(2,
"logical expression",
" ends\n");
1152 for(i=1; i<n && !
ENDP(args); i++,
POP(args))
1154 if(i==n && !
ENDP(args))
1170 for(i=r, cle=le ; i>1 && !
ENDP(cle); i--,
POP(cle))
1190 bool negative_p = i<0;
1219 bool zero_p =
false;
1368 bool equal_or_opposite_p =
false;
1370 equal_or_opposite_p =
true;
1382 return equal_or_opposite_p;
1388 bool opposite_p =
false;
1407 bool equal_p =
true;
1408 list cl1 = l1, cl2 = l2;
1640 if (coeff == 1)
return(e2);
1691 for (v=v->succ; v!=NULL; v=v->succ)
1702 ( coef> 0 ? c_op_add : c_op_sub ) :
1703 ( coef> 0 ? op_add : op_sub ) ;
1890 bool do_not_conflict =
false;
1899 for(cs1=
s1, cs2=s2; !
ENDP(cs1) && !do_not_conflict;
POP(cs1),
POP(cs2)) {
1910 return do_not_conflict;
1924 pips_assert(
"list_to_binary_operator_call", len!=0);
2015 entity op_ent, unary_minus_ent;
2017 debug( 7,
"make_op_exp",
"doing\n");
2032 user_error(
"make_op_exp",
"operation must be : +, -, *, MOD, or /");
2038 debug(6,
"make_op_exp",
"Constant expressions\n");
2108 user_error(
"make_op_exp",
"division by zero");
2126 return (result_exp);
2151 debug( 7,
"make_lin_op_exp",
"doing\n");
2293 " in the sense of expression_constant_p()\n");
2330 " according to expression_constant_p()");
2335 " according to expression_constant_p()");
2414 return strndup(eun+1,strlen(eun)-2);
2428 if (s==0)
return(
true);
2429 if (s>1)
return(
false);
2584 bool is_rhs_p =
false;
2613 bool null_p =
false;
2631 #define ALREADY_SEEN(node) (hash_defined_p(seen, (char*)node))
2632 #define SEEN(node) (hash_put(seen, (char*) node, (char*) 1))
2634 #define DV_CIRCLE ",a(\"_GO\",\"circle\")"
2635 #define DV_YELLOW ",a(\"COLOR\",\"yellow\")"
2641 const char* name, *shape, *color;
2643 bool first =
true, something =
true;
2684 fprintf(
out,
"l(\"%zx\",n(\"\",[a(\"OBJECT\",\"%s\")%s%s],[",
2685 (
_uint) e, name, color, shape);
2691 fprintf(
out,
" l(\"%zx->%zx\",e(\"\",[],r(\"%zx\")))",
2817 bool can_be_substituted_p =
false;
2833 can_be_substituted_p =
false;
2845 can_be_substituted_p =
2852 pips_debug(9,
"Variable %s is an arithmetic variable: %s\n",
2868 can_be_substituted_p =
2879 can_be_substituted_p = can_be_substituted_p1 && can_be_substituted_p2;
2880 if(can_be_substituted_p) {
2904 can_be_substituted_p =
false;
2921 can_be_substituted_p =
2929 can_be_substituted_p =
false;
2933 can_be_substituted_p =
false;
2947 can_be_substituted_p =
false;
2955 can_be_substituted_p =
false;
2958 can_be_substituted_p =
false;
2962 return can_be_substituted_p;
2985 nb = upper_p? ib-1 : ib+1;
2993 nb = upper_p? ib-1 : ib+1;
3008 nb = upper_p? ib-1 : ib+1;
3050 for(sec = sel; !
ENDP(sec);
POP(sec)) {
3069 bool unbounded_p =
true;
3074 unbounded_p =
false;
3088 bool unbounded_p =
false;
3110 bool independent_p =
true;
3116 independent_p =
false;
3122 return independent_p;
3252 if(
ENDP(iter) ) { similar =
false;
break; }
3309 if(
ENDP(iter) ) { similar =
false;
break; }
3375 for(; number; number--)
3547 list l_src = l_exprs;
3699 if( (cl != 2) && (cl != 1) )
3857 return address_computation ;
4012 pips_assert(
"The reference dimension is strictly greater than "
4013 "the array of pointers dimension", r_d>p_d);
4021 for(i = 0; i<r_d; i++) {
4058 bool initialization_p =
false;
4064 initialization_p =
true;
4066 return initialization_p;
4075 pips_assert(
"rhs is a C initialization expression",
4138 for (i=1; i<= num_dim; i++)
4198 entity actual_array,
list l_actual_ref,
int i)
4204 for (j=i+1; j<= num_dim; j++)
4229 if (l_actual_ref!=
NIL)
4235 fprintf(stderr,
"\n actual argument is an array element name:");
4236 for (j=i+1; j<= num_dim; j++)
4351 for(i=0; i<d; i++) {
4436 for(
int i=0;i<nm && !
ENDP(il); i++) {
static hash_table seen
static function to store whether a module has been seen during the recursive generation of the daVinc...
void free_normalized(normalized p)
list gen_expression_cons(expression p, list l)
cast make_cast(type a1, expression a2)
call make_call(entity a1, list a2)
sizeofexpression make_sizeofexpression_expression(expression _field_)
syntax make_syntax_call(call _field_)
expression make_expression(syntax a1, normalized a2)
subscript make_subscript(expression a1, list a2)
syntax make_syntax_sizeofexpression(sizeofexpression _field_)
type copy_type(type p)
TYPE.
void free_reference(reference p)
basic copy_basic(basic p)
BASIC.
expression copy_expression(expression p)
EXPRESSION.
reference make_reference(entity a1, list a2)
sizeofexpression make_sizeofexpression_type(type _field_)
void free_expression(expression p)
syntax make_syntax_cast(cast _field_)
void free_syntax(syntax p)
syntax make_syntax(enum syntax_utype tag, void *val)
constant copy_constant(constant p)
CONSTANT.
syntax make_syntax_subscript(subscript _field_)
syntax make_syntax_reference(reference _field_)
struct _newgen_struct_entity_ * entity
static reference ref
Current stmt (an integer)
#define value_minus(v1, v2)
#define value_absolute(ref)
#define VALUE_TO_INT(val)
#define value_pdiv(v1, v2)
#define value_notzero_p(val)
void const char const char const int
#define value_negz_p(val)
#define value_zero_p(val)
#define ABS(x)
was: #define value_mult(v,w) value_direct_multiply(v,w) #define value_product(v,w) value_direct_produ...
#define value_posz_p(val)
bool constant_string_entity_p(entity e)
bool integer_constant_p(entity ent, int *int_p)
Returns the double value associated to a PIPS constant.
entity float_to_entity(float c)
entity MakeConstant(string name, tag bt)
Make a Fortran constant.
expression MakeComplexConstantExpression(expression r, expression i)
bool integer_symbolic_constant_p(entity ent, int *int_p)
(*int_p) gets integer constant if any
entity int_to_entity(_int c)
int compare_Pvecteur(Pvecteur *pv1, Pvecteur *pv2)
comparison function for Pvecteur in pips, to be used by qsort.
bool vect_constant_p(Pvecteur)
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
string make_entity_fullname(const char *module_name, const char *local_name)
END_EOLE.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
void gen_full_free_list(list l)
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define REFCAR(pc)
Get the adress of the first element of a list.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#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
#define CAR(pcons)
Get the value of the first element 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.
#define CDR(pcons)
Get the list less its first element.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
list gen_append(list l1, const list l2)
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
#define list_undefined
Undefined list definition :-)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
list gen_full_copy_list(list l)
Copy a list structure with element copy.
bool gen_equals(const list l0, const list l1, gen_eq_func_t equals)
compares two lists using the functor given in parameters returns true if for all n,...
statement make_assign_statement(expression, expression)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
static void term(Pproblem XX, int s, Value k, int x)
bool vect_equal(Pvecteur v1, Pvecteur v2)
bool vect_equal(Pvecteur v1, Pvecteur v2): test a egalite de deux vecteurs
int vect_size(Pvecteur v)
package vecteur - reductions
#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
#define user_error(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define LIST_DIRECTED_FORMAT_NAME
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define MODULE_SEP_STRING
#define message_assert(msg, ex)
string bool_to_string(bool)
#define HASH_DEFAULT_SIZE
#define same_string_p(s1, s2)
void * gen_find_tabulated(const char *, int)
bool(* gen_eq_func_t)(const void *, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
int f2(int off1, int off2, int w, int n, float r[n], float a[n], float b[n])
normalized normalize_reference(reference r)
void unnormalize_expression(void *st)
void unnormalize_expression(expression exp): puts all the normalized field of expressions in "st" to ...
Ppolynome make_polynome(float coeff, Variable var, Value expo)
Ppolynome make_polynome(float coeff, Variable var, Value expo) PRIVATE allocates space for,...
void polynome_rm(Ppolynome *ppp)
void polynome_rm(Ppolynome* ppp) frees space occupied by polynomial *ppp returns *ppp pointing to POL...
Ppolynome polynome_div(Ppolynome pp1, Ppolynome pp2)
Ppolynome polynome_div(Ppolynome pp1, Ppolynome pp2) returns p = pp1 / pp2.
Ppolynome polynome_mult(Ppolynome pp1, Ppolynome pp2)
Ppolynome polynome_mult(Ppolynome pp1, Ppolynome pp2) returns pp1 * pp2.
void polynome_add(Ppolynome *ppp, Ppolynome pp2)
void polynome_add(Ppolynome* ppp, Ppolynome pp2) (*ppp) = (*ppp) + pp2.
void polynome_negate(Ppolynome *ppp)
void polynome_negate(Ppolynome *ppp); changes sign of polynomial *ppp.
#define POLYNOME_UNDEFINED
#define POLYNOME_UNDEFINED_P(pp)
#define MONOME_UNDEFINED_P(pm)
#define polynome_monome(pp)
#define monome_coeff(pm)
Macros definitions.
#define POLYNOME_NUL_P(pp)
#define polynome_succ(pp)
bool symbol_table(const char *)
To replace c_symbol_table() and fortran_symbol_table() because the information about the language is ...
static bool constant_p(entity e)
This function return a bool indicating if related entity e represents a constant.
#define UNBOUNDED_DIMENSION_NAME
#define make_expression_list(stats...)
#define MAX_OPERATOR_NAME
#define POWER_OPERATOR_NAME
#define CABS_OPERATOR_NAME
#define ENTITY_DIVIDE_P(e)
#define ENTITY_RELATIONAL_OPERATOR_P(e)
#define ABS_OPERATOR_NAME
#define ENTITY_NON_EQUAL_P(e)
#define binary_call_rhs(c)
#define ENTITY_EQUAL_P(e)
#define ENTITY_FIVE_OPERATION_P(e)
#define MINUS_OPERATOR_NAME
#define ENTITY_MINUS_P(e)
#define ENTITY_COMMA_P(e)
#define ENTITY_UNARY_MINUS_P(e)
#define IABS_OPERATOR_NAME
#define ENTITY_DEREFERENCING_P(e)
#define COMMA_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define ENTITY_LESS_THAN_P(e)
#define ENTITY_MULTIPLY_P(e)
#define NORMALIZE_EXPRESSION(e)
#define MAX0_OPERATOR_NAME
#define DEREFERENCING_OPERATOR_NAME
#define MIN0_OPERATOR_NAME
#define entity_symbolic_p(e)
#define FIELD_OPERATOR_NAME
#define ENTITY_BRACE_INTRINSIC_P(e)
C initialization expression.
#define ENTITY_CONDITIONAL_P(e)
#define expression_scalar_p(e)
#define unary_intrinsic_expression(name, e)
Building quickly bool expressions, FC.
#define CONDITIONAL_OPERATOR_NAME
#define FALSE_OPERATOR_NAME
#define binary_intrinsic_expression(name, e1, e2)
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define ENTITY_PLUS_C_P(e)
#define ENTITY_GREATER_THAN_P(e)
#define ADDRESS_OF_OPERATOR_NAME
#define ENTITY_FIELD_P(e)
C data structure and pointer management.
#define ENTITY_UNARY_PLUS_P(e)
#define ENTITY_MINUS_C_P(e)
#define DIVIDE_OPERATOR_NAME
#define ENTITY_NON_EQUIV_P(e)
#define DABS_OPERATOR_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define binary_call_lhs(c)
#define C_LESS_THAN_OPERATOR_NAME
#define TRUE_OPERATOR_NAME
#define ENTITY_ADDRESS_OF_P(e)
#define ENTITY_LESS_OR_EQUAL_P(e)
#define make_statement_list(stats...)
easy list constructor
#define MINUS_C_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
#define entity_constant_p(e)
#define ENTITY_GREATER_OR_EQUAL_P(e)
#define ASSIGN_OPERATOR_NAME
#define MODULO_OPERATOR_NAME
#define PIPS_C_DIV_OPERATOR_NAME
#define ENTITY_MODULO_P(e)
#define PLUS_C_OPERATOR_NAME
#define MIN_OPERATOR_NAME
#define ENTITY_EQUIV_P(e)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
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...
bool commutative_call_p(call c)
Test if we are allowed to commute operations.
bool array_entity_p(entity e)
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool entity_field_p(entity e)
e is the field of a structure
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
bool entity_pointer_p(entity e)
bool same_field_entity_p(const entity f1, const entity f2)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
bool expression_linear_p(expression e)
returns if e is already normalized and linear.
value EvalExpression(expression e)
Evaluate statically an expression.
value EvalSizeofexpression(sizeofexpression soe)
bool expression_integer_value(expression e, intptr_t *pval)
bool false_expression_p(expression e)
bool expression_one_p(expression exp)
expression add_integer_to_expression(expression exp, int val)
bool user_function_call_p(expression e)
subscript expression_subscript(expression e)
bool expression_address_of_p(expression e)
static list do_brace_expression_to_statements(entity arr, expression e, list curr_indices)
helper for brace_expression_to_statements
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
bool reference_with_unbounded_indices_p(reference r)
indices can be constant or unbounded: they are store independent.
bool expression_is_C_rhs_p(expression exp)
Not all expressions can be used as right-hand side (rhs) in C assignments.
bool call_equal_p(call c1, call c2)
bool iabs_expression_p(expression e)
list struct_initialization_expression_to_expressions(expression e)
Returns a list of expressions hidden by the brace function.
expression reference_to_expression(reference r)
expression MakeSizeofType(type t)
range expression_range(expression e)
bool unbounded_entity_p(entity f)
bool expression_sizeofexpression_p(expression e)
void reference_complete_with_zero_subscripts(reference r)
Reference r to an array maybe partial, as is possible in C: with declaration "int a[10][10]",...
expression make_entity_expression(entity e, cons *inds)
list syntax_to_reference_list(syntax s, list lr)
bool expression_opposite_p(expression e1, expression e2)
e1+e2==0, i.e.
void brace_expression_to_updated_type(entity arr, expression e)
use a brace expression to update the type of array "arr" if the dimensions are implicit
bool expression_integer_constant_p(expression e)
expression make_address_of_expression(expression e)
generate a newly allocated expression for &(e)
bool expression_minmax_p(expression e)
expression expression_verbose_reduction_p_and_return_increment(expression incr, bool filter(expression))
Test if an expression is a verbose reduction of the form : "i = i op v" or "i = v op i".
struct ctx_substitute ctx_substitute_t
application expression_application(expression e)
bool simplify_expression(expression *pexp)
use polynomials to simplify an expression in some cases this operation can change the basic of the ex...
expression Pvecteur_to_expression(Pvecteur vect)
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
bool expression_similar_get_context_p(expression target, expression pattern, hash_table *symbol_table)
similar to expression_similar_p but the hash_map containing the crossref value is retured for further...
expression make_constraint_expression(Pvecteur v, Variable index)
Make an expression from a constraint v for a given index.
bool min0_expression_p(expression e)
void clean_all_normalized(expression e)
expression MakeBraceExpression(list l)
bool expression_field_p(expression e)
The expression is of kind "s.a", where "s" is a struct and a "a" field.
bool logical_operator_expression_p(expression e)
C xor is missing.
bool substraction_expression_p(expression e)
Test if an expression is an substraction.
bool same_expression_in_list_p(expression e, list le)
This function returns true, if there exists a same expression in the list false, otherwise.
void davinci_dump_expression(FILE *out, expression e)
dump expression e in file out as a davinci graph.
bool expression_list_directed_p(e)
expression make_lin_op_exp(entity op_ent, expression exp1, expression exp2)
================================================================
void normalize_subscript_expression(expression e)
Normalization of subscript in expressions.
list make_unbounded_subscripts(int d)
FI: this piece of code must have been duplicated somewhere else in an effect library.
bool extended_integer_constant_expression_p(expression e)
More extensive than next function.
reference expression_to_reference(expression e)
bool zero_expression_p(expression e)
bool expression_constant_p(expression exp)
================================================================
expression expressions_to_operation(const list l_exprs, entity op)
take a list of expression and apply a binary operator between all of them and return it as an express...
bool expression_call_p(expression e)
expression substitute_entity_variable_in_expression(entity old, entity new, expression e)
(This function isn't use for the moment) This function replaces all the occurrences of an old entity ...
void reference_add_zero_subscripts(reference r, type t)
list expressions_to_entities(list expressions)
map expression_to_entity on expressions
int expression_to_int(expression exp)
================================================================
expression make_unbounded_expression()
int trivial_expression_p(expression e)
This function returns:
bool true_expression_p(expression e)
expression MakeCommaExpression(list l)
bool call_constant_p(call c)
bool call_constant_p(call c): Returns true if "c" is a call to a constant, that is,...
expression monome_to_expression(Pmonome pm)
converts a monome to an expression
bool reference_with_unbounded_subscript_p(reference r)
See if the reference uses the unbounded function '*'.
bool expression_cast_p(expression e)
expression float_to_expression(float c)
expression make_min_expression(expression e1, expression e2, enum language_utype lang)
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
bool expression_subscript_p(expression e)
static void substitute_variable_in_reference(reference r, ctx_substitute_t *ctx)
constant expression_constant(expression exp)
This function returns a "constant" object if the expression is a constant such as 10,...
static void expr_rwt(expression e)
hack: clean all normalize fields...
expression make_factor_expression(int coeff, entity vari)
Some functions to generate expressions from vectors and constraint systems.
bool max0_expression_p(expression e)
bool expression_equal_or_opposite_p(expression e1, expression e2)
e1==e2 or -e1==e2 or e1==-e2 syntactically
statement Pvecteur_to_assign_statement(entity var, Pvecteur v)
generates var = linear expression from the Pvecteur.
bool expression_string_constant_p(expression exp)
bool expression_null_p(expression exp)
returns true if the expression is equal to zero or NULL (even if there is a cast before such as in (v...
bool field_expression_p(expression e)
The expression is of kind "a", where "a" is a field of some struct "s".
bool extended_integer_constant_expression_p_to_int(expression e, int *result)
void local_assign_expression(expression caller, expression field)
replace expression caller by expression field , where field is contained by caller
#define ALREADY_SEEN(node)
bool syntax_equal_p(syntax s1, syntax s2)
expression expression_list_to_binary_operator_call(list l, entity op)
static void do_simplify_expressions(call c)
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
bool expression_brace_p(expression e)
predicates and short cut accessors on expressions
bool subscript_equal_p(subscript s1, subscript s2)
expression replace_expression_content(expression e1, expression e2)
Use side effects to move the content of e2, s2 and n2, into e1; s1 and n1 are freed,...
expression make_zero_expression(void)
Make a zero expression.
expression size_of_actual_array(entity actual_array, list l_actual_ref, int i)
bool expression_equal_p(expression e1, expression e2)
Syntactic equality e1==e2.
void reference_add_zero_subscript(reference r)
No check on reference r.
call expression_call(expression e)
expression expression_list_to_conjonction(list l)
void update_expression_syntax(expression e, syntax s)
frees expression syntax of e and replace it by the new syntax s
reference add_subscript_to_reference(reference r, expression s)
Add a last subscript expression s to a reference r.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
cast expression_cast(expression e)
void expression_normalize_subscripts(expression e)
To be used for initialization expressions.
bool expression_pointer_p(expression e)
we get the type of the expression by calling expression_to_type() which allocates a new one.
expression MakeSizeofExpression(expression e)
bool brace_expression_p(expression e)
Return bool indicating if expression e is a brace expression.
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
bool logical_expression_p(expression e)
bool dabs_expression_p(expression e)
int fortran_string_compare(string fs1, string fs2)
compare pips fortran string constants from the fortran point of view.
expression make_subscript_expression(expression a, list sl)
expression expression_to_dereferencing_expression(expression e)
Reuse expression e to build expression *(e) without cheking the legality of the construct.
expression substitute_entity_in_expression(entity old, entity new, expression e)
This function replaces all the occurences of an old entity in the expression exp by the new entity.
expression find_ith_argument(list args, int n)
bool add_expression_p(expression e)
Test if an expression is an addition.
bool references_do_not_conflict_p(reference r1, reference r2)
If true is returned, the two references cannot conflict unless array bound declarations are violated.
bool user_call_p(call c)
Test if a call is a user call.
bool integer_expression_p(expression e)
expression MakeNullaryCall(entity f)
Creates a call expression to a function with zero arguments.
expression Value_to_expression(Value v)
added interface for linear stuff.
bool reference_equal_p(reference r1, reference r2)
bool unbounded_dimension_p(dimension dim)
bool unbounded_dimension_p(dim) input : a dimension of an array entity.
bool assignment_expression_p(expression e)
Test if an expression is an assignment operation.
bool cabs_expression_p(expression e)
expression find_ith_expression(list le, int r)
find_ith_expression() is obsolet; use find_ith_argument() instead
bool expression_equal_in_list_p(expression e, list le)
This function returns true, if there exists an expression equal in the list false,...
bool integer_constant_expression_p(expression e)
positive integer constant expression: call to a positive constant or to a sum of positive integer con...
bool comma_expression_p(expression e)
bool signed_integer_constant_expression_p(expression e)
bool modulo_expression_p(expression e)
expression convert_bound_expression(expression e, bool upper_p, bool non_strict_p)
Replace a C expression used as FOR bound by a Fortran DO bound expression, taking into account the C ...
bool array_argument_p(expression e)
expression MakeCastExpression(type t, expression e)
expression make_contrainte_expression(Pcontrainte pc, Variable index)
A wrapper around make_constraint_expression() for compatibility.
expression make_false_expression()
void reference_add_unbounded_subscripts(reference r, type t)
bool expression_application_p(expression e)
Duplicate bool expression_subscript_p(expression e) { return(syntax_subscript_p(expression_syntax(e))...
bool unary_minus_expression_p(expression e)
static bool _expression_similar_p(expression target, expression pattern, hash_table symbols)
perform the real similarity comparaison between two expressions target is matched against pattern,...
bool sizeofexpression_equal_p(sizeofexpression s0, sizeofexpression s1)
bool expression_intrinsic_operation_p(expression exp)
bool expression_intrinsic_operation_p(expression exp): Returns true if "exp" is an expression with a ...
list make_list_of_constant(int val, int number)
of expression
expression subscript_value_stride(entity arr, list l_inds)
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
void statement_normalize_subscripts(statement s)
To be used for module statements.
sizeofexpression expression_sizeofexpression(expression e)
bool array_reference_p(reference r)
predicates on references
expression make_ref_expr(entity ent, list args)
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool cast_equal_p(cast c1, cast c2)
bool expression_equal_integer_p(expression exp, int i)
================================================================
Ppolynome expression_to_polynome(expression exp)
===========================================================================
bool store_independent_reference_p(reference r)
Does this reference define the same set of memory locations regardless of the current (environment an...
static string actual_fortran_string_to_compare(string fs, int *plength)
quite lazy...
expression make_max_expression(expression e1, expression e2, enum language_utype lang)
bool unbounded_expression_p(expression e)
bool simplify_C_expression(expression e)
Replace C operators "+C" and "-C" which can handle pointers by arithmetic operators "+" and "-" when ...
expression expression_mult(expression ex)
expression make_assign_expression(expression lhs, expression rhs)
Make an assign expression, since in C the assignment is a side effect operator.
bool reference_with_constant_indices_p(reference r)
void free_expressions(list el)
Free a list of expressions.
void generic_reference_add_fixed_subscripts(reference r, type t, bool zero_p)
Add a set of zero subscripts to a reference "r" by side effect.
void simplify_expressions(void *obj)
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
static bool expr_flt(expression e)
bool expression_with_constant_signed_integer_value_p(expression e)
The expression may be complicated but all its leaves are constants or parameters.
bool C_initialization_expression_p(expression e)
expression reference_offset(reference ref)
computes the offset of a C reference with its origin
entity expression_variable(expression e)
expression complex_to_expression(float re, float im)
bool range_equal_p(range r1, range r2)
bool relational_expression_p(expression e)
expression MakeTernaryCall(entity f, expression e1, expression e2, expression e3)
Creates a call expression to a function with 3 arguments.
bool power_expression_p(expression e)
float expression_to_float(expression exp)
Same as above for floating point constants.
reference reference_with_store_independent_indices(reference r)
Return by side effect a reference whose memory locations includes the memory locations of r in case t...
bool expression_range_p(expression e)
static void do_brace_expression_to_updated_type(entity arr, expression e, list dl)
helper for brace_expression_to_updated_type
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
bool divide_expression_p(expression e)
expression dereference_expression(expression e)
generate a newly allocated expression for *(e)
bool sub_expression_p(expression e)
bool expression_implied_do_p(e)
expression pointer_reference_to_expression(reference r)
Assume p is a pointer.
bool reference_scalar_p(reference r)
This function returns true if Reference r is scalar.
list expression_to_reference_list(expression e, list lr)
conversion of an expression into a list of references; references are appended to list lr as they are...
void davinci_dump_all_expressions(FILE *out, statement s)
dump all expressions in s to out.
bool extended_expression_constant_p(expression exp)
Returns true if the value of the expression does not depend syntactically on the current store.
list subscript_expressions_to_constant_subscript_expressions(list sl)
make a full copy of the subscript expression list, preserve constant subscripts, replace non-constant...
bool abs_expression_p(expression e)
expression bool_to_expression(bool b)
expression syntax_to_expression(syntax s)
generates an expression from a syntax
expression polynome_to_expression(Ppolynome pp)
converts a polynomial to expression
bool same_expression_p(expression e1, expression e2)
this is slightly different from expression_equal_p, as it will return true for a+b vs b+a
bool is_expression_reference_to_entity_p(expression e, entity v)
Test if an expression is a reference to a given variable entity.
tag suggest_basic_for_expression(expression e)
a BASIC tag is returned for the expression this is a preliminary version.
bool expression_similar_p(expression target, expression pattern)
compare if two expressions are similar that is can we exchange target and pattern by substituing vari...
expression make_true_expression()
int signed_integer_constant_expression_value(expression e)
char * expression_string_constant(expression exp)
returns a newly allocated string!
int integer_constant_expression_value(expression e)
static bool davinci_dump_expression_rc(FILE *out, expression e, hash_table seen)
expression call_to_expression(call c)
Build an expression that call a function or procedure.
list brace_expression_to_statements(entity arr, expression e)
converts a brace expression used to initialize an array (not a struct yet) into a statement sequence
static void substitute_entity_in_call(call c, ctx_substitute_t *ctx)
bool expression_lists_equal_p(list l1, list l2)
bool operator_expression_p(expression e, string op_name)
bool c_language_module_p(entity m)
bool const_variable_p(entity)
basic basic_of_expression(expression)
basic basic_of_expression(expression exp): Makes a basic of the same basic as the expression "exp".
dimension find_ith_dimension(list, int)
This function returns the ith dimension of a list of dimensions.
bool variable_length_array_type_p(type)
Is this equivalent to dependent_type_p()?
type expression_to_type(expression)
For an array declared as int a[10][20], the type returned for a[i] is int [20].
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
int dimension_size(dimension)
this function computes the size of a dimension.
type expression_to_concrete_type(expression)
A new type is allocated.
type call_to_functional_type(call, bool)
The function called can have a functional type, or a typedef type or a pointer type to a functional t...
int variable_dimension_number(variable)
bool type_equal_p(type, type)
bool basic_equal_p(basic, basic)
type type_to_pointed_type(type)
returns t if t is not a pointer type, and the pointed type if t is a pointer type.
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
bool pointer_type_p(type)
Check for scalar pointers.
unsigned int array_type_dimension(type)
list struct_type_to_fields(type)
_int SizeOfElements(basic)
This function returns the length in bytes of the Fortran or C type represented by a basic,...
type reference_to_type(reference)
bool type_struct_variable_p(type)
basic expression_basic(expression)
basic basic_maximum(basic, basic)
#define type_functional_p(x)
#define normalized_undefined
#define syntax_reference_p(x)
#define expression_domain
newgen_execution_domain_defined
#define functional_result(x)
#define REFERENCE(x)
REFERENCE.
#define basic_complex_p(x)
#define value_constant(x)
#define syntax_reference(x)
#define normalized_complex_p(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define SIZEOFEXPRESSION(x)
SIZEOFEXPRESSION.
#define sizeofexpression_type(x)
#define reference_undefined_p(x)
#define symbolic_constant(x)
#define sizeofexpression_expression(x)
#define type_functional(x)
#define syntax_application(x)
#define dimension_lower(x)
#define syntax_sizeofexpression_p(x)
@ is_syntax_sizeofexpression
#define range_increment(x)
#define value_constant_p(x)
#define call_domain
newgen_callees_domain_defined
#define basic_overloaded_p(x)
#define value_symbolic(x)
#define basic_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define cast_expression(x)
#define application_arguments(x)
#define subscript_indices(x)
#define type_undefined_p(x)
#define reference_domain
newgen_range_domain_defined
#define constant_int_p(x)
#define expression_undefined
#define value_symbolic_p(x)
#define expression_normalized(x)
#define dimension_upper(x)
#define reference_indices(x)
#define syntax_sizeofexpression(x)
#define sizeofexpression_expression_p(x)
#define sizeofexpression_type_p(x)
#define constant_undefined_p(x)
#define syntax_application_p(x)
#define expression_undefined_p(x)
#define subscript_array(x)
#define application_function(x)
#define variable_dimensions(x)
#define syntax_subscript(x)
#define call_arguments(x)
#define syntax_range_p(x)
#define normalized_undefined_p(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define type_variable_p(x)
#define value_expression(x)
#define entity_domain
newgen_syntax_domain_defined
#define constant_undefined
#define variable_basic(x)
#define basic_logical_p(x)
#define entity_initial(x)
#define syntax_subscript_p(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
t_real sum(int n1, int n2, int n3, t_real u[n1][n2][n3])
char * strndup(char const *s, size_t n)
A replacement function, for systems that lack strndup.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define VECTEUR_UNDEFINED_P(v)
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Pvecteur vect_sort(Pvecteur v, int *compare)
Pvecteur vect_sort(v, compare) Pvecteur v; int (*compare)();.