Skip to content

Commit

Permalink
remove some matchcontinue
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel authored and OpenModelica-Hudson committed May 12, 2016
1 parent 7e7eec7 commit 04080ae
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 176 deletions.
11 changes: 4 additions & 7 deletions Compiler/BackEnd/FindZeroCrossings.mo
Expand Up @@ -1157,8 +1157,7 @@ algorithm
BackendDump.debugExpStr(inExp, "\n");
end if;
b1 = Expression.expContains(e1, iterator);
b2 = Expression.expContains(e2, iterator);
true = Util.boolOrList({b1, b2});
true = if b1 then true else Expression.expContains(e2, iterator);
(e_1, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1)) = Expression.traverseExpTopDown(e1, collectZCAlgsFor, inTpl);
(e_2, (iterator, inExpLst, range, (_, relations, samples, numRelations1, numMathFunctions), tp1 as (alg_indx, vars, knvars))) = Expression.traverseExpTopDown(e2, collectZCAlgsFor, (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations1, numMathFunctions), tp1));
true = intGt(numRelations1, numRelations);
Expand Down Expand Up @@ -1202,8 +1201,7 @@ algorithm
case (DAE.RELATION(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range as DAE.RANGE(start=startvalue, step=stepvalueopt), (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, knvars))) equation
true = Flags.isSet(Flags.EVENTS);
b1 = Expression.expContains(e1, iterator);
b2 = Expression.expContains(e2, iterator);
true = Util.boolOrList({b1, b2});
true = if b1 then true else Expression.expContains(e2, iterator);
if Flags.isSet(Flags.RELIDX) then
print(" number of relations: " + intString(numRelations) + "\n");
end if;
Expand Down Expand Up @@ -1238,9 +1236,8 @@ algorithm
// All other functions generate zerocrossing.
case (DAE.RELATION(exp1=e1, operator=op, exp2=e2), (iterator, inExpLst, range, (zeroCrossings, relations, samples, numRelations, numMathFunctions), tp1 as (alg_indx, vars, knvars))) equation
true = Flags.isSet(Flags.EVENTS);
b1 = Expression.expContains(e1, iterator);
b2 = Expression.expContains(e2, iterator);
false = Util.boolOrList({b1, b2});
false = Expression.expContains(e1, iterator);
false = Expression.expContains(e2, iterator);
eres = DAE.RELATION(e1, op, e2, numRelations, NONE());
zc = createZeroCrossing(eres, {alg_indx});
zc_lst = listAppend(relations, {zc});
Expand Down

0 comments on commit 04080ae

Please sign in to comment.