Skip to content

Commit

Permalink
- Support match->switch also for uniontypes with a default case (else)
Browse files Browse the repository at this point in the history
- Changed ExpressionSimplify to not create new expressions if the expression changed (using referenceEq instead of passing a boolean around)
- Changed ExpressionSimplify to use switch semantics for the main case
- Added env.var OPENMODELICA_BOOTSTRAPPING_DEBUG_FLAGS to set command-line options to be passed to the separate compilation script (e.g. to use +d=patternmAllInfo to see if match->switch optimisation was performed)
- Disabled some cppruntime testcases because they now fail in code generation due to noEvent


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17944 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 31, 2013
1 parent 3531c24 commit 89eb97f
Show file tree
Hide file tree
Showing 4 changed files with 766 additions and 788 deletions.
26 changes: 5 additions & 21 deletions Compiler/FrontEnd/Expression.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6497,33 +6497,17 @@ algorithm
nb := boolNot(b);
end isNotConst;

public function isRelation
"Returns true if expression is a function expression."
public function isRelation "Returns true if expression is a relation"
input DAE.Exp inExp;
output Boolean outBoolean;
algorithm
outBoolean := matchcontinue (inExp)
local
Boolean b1,b2,res;
DAE.Exp e1,e2;

outBoolean := match (inExp)
case (DAE.RELATION(exp1 = _)) then true;
case (DAE.LUNARY(exp = DAE.RELATION(exp1 = _))) then true;

case (DAE.LBINARY(exp1 = e1,exp2 = e2))
equation
b1 = isRelation(e1);
b2 = isRelation(e2);
res = boolOr(b1, b2);
then
res;

case (_) then false;

end matchcontinue;
else false;
end match;
end isRelation;

protected function isEventTriggeringFunctionExp
public function isEventTriggeringFunctionExp
input DAE.Exp inExp;
output Boolean outB;
algorithm
Expand Down

0 comments on commit 89eb97f

Please sign in to comment.