PIPS
|
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "parser_private.h"
#include "syntax.h"
#include "toklex.h"
Go to the source code of this file.
Functions | |
value | EvalExpression (expression e) |
lint More... | |
value | EvalSyntax (syntax s) |
value | EvalCall (call c) |
only calls to constant, symbolic or intrinsic functions might be evaluated. More... | |
value | EvalConstant (ant c) const |
value | EvalIntrinsic (entity e, cons *la) |
this function tries to evaluate a call to an intrinsic function. More... | |
value | EvalUnaryOp (int t, cons *la) |
value | EvalBinaryOp (int t, cons *la) |
int | IsUnaryOperator (entity e) |
int | IsBinaryOperator (entity e) |
FI: These string constants are defined in ri-util.h and the tokens in ri-util/operator.h. More... | |
int | ipow (int vg, int vd) |
FI: such a function should exist in Linear/arithmetique. More... | |
Variables | |
char | vcid_syntax_eval [] = "%A% ($Date: 1998/04/14 21:28:15 $, ) version $Revision: 16236 $, got on %D%, %T% [%P%].\n Copyright (c) École des Mines de Paris Proprietary." |
Definition at line 195 of file eval.c.
References CAR, CDR, constant_int, constant_int_p, debug(), EvalExpression(), EXPRESSION, FatalError, gen_free(), ipow(), make_value_unknown(), NIL, pips_assert, TK_MINUS, TK_PLUS, TK_POWER, TK_SLASH, TK_STAR, value_constant, and value_constant_p.
only calls to constant, symbolic or intrinsic functions might be evaluated.
recall that intrinsic functions are not known.
it might be an intrinsic function
Definition at line 95 of file eval.c.
References call_arguments, call_function, entity_initial, EvalConstant(), EvalIntrinsic(), f(), is_value_code, is_value_constant, is_value_intrinsic, is_value_symbolic, is_value_unknown, make_value_unknown(), ParserError(), symbolic_constant, value_constant, value_symbolic, and value_tag.
value EvalConstant | ( | ant | c | ) | const |
Definition at line 130 of file eval.c.
References constant_int, constant_int_p, is_constant_int, is_value_constant, make_constant(), make_value(), and MakeValueLitteral().
value EvalExpression | ( | expression | e | ) |
lint
cproto-generated files
This file contains a set of functions to evaluate integer constant expressions. The algorithm is built on a recursive analysis of the expression structure. Lower level functions are called until basic atoms are reached. The succes of basic atom evaluation depend on the atom type:
reference: right now, the evaluation fails because we do not compute predicates on variables.
call: a call to a user function is not evaluated. a call to an intrinsic function is successfully evaluated if arguments can be evaluated. a call to a constant function is evaluated if its basic type is integer.
range: a range is not evaluated.
Definition at line 55 of file eval.c.
References EvalSyntax(), and expression_syntax.
this function tries to evaluate a call to an intrinsic function.
right now, we only try to evaluate unary and binary intrinsic functions, ie. fortran operators.
e is the intrinsic function.
la is the list of arguments.
Definition at line 150 of file eval.c.
References EvalBinaryOp(), EvalUnaryOp(), IsBinaryOperator(), IsUnaryOperator(), and make_value_unknown().
Is it a reference to a const variable?
SG: sizeof is architecture dependant, it is better not to evaluate it by default
Definition at line 63 of file eval.c.
References EvalCall(), is_syntax_application, is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, is_syntax_subscript, is_syntax_va_arg, make_value_unknown(), ParserError(), syntax_call, and syntax_tag.
Definition at line 169 of file eval.c.
References CAR, constant_int, constant_int_p, EvalExpression(), EXPRESSION, gen_free(), make_value_unknown(), NIL, pips_assert, TK_MINUS, value_constant, and value_constant_p.
FI: such a function should exist in Linear/arithmetique.
FI: should it return a long long int?
FI: see arithmetique library
vg | g |
vd | d |
Definition at line 315 of file eval.c.
References pips_assert.
FI: These string constants are defined in ri-util.h and the tokens in ri-util/operator.h.
Definition at line 272 of file eval.c.
References entity_local_name(), TK_AND, TK_EQ, TK_EQV, TK_GE, TK_GT, TK_LE, TK_LT, TK_MINUS, TK_NE, TK_NEQV, TK_OR, TK_PLUS, TK_POWER, TK_SLASH, and TK_STAR.
Definition at line 255 of file eval.c.
References entity_local_name(), TK_MINUS, and TK_NOT.