Skip to content

Commit 8125c69

Browse files
committed
Remove dead cases and cleanup
1 parent b559b1d commit 8125c69

File tree

1 file changed

+13
-39
lines changed

1 file changed

+13
-39
lines changed

Compiler/FrontEnd/Expression.mo

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12173,77 +12173,51 @@ protected function traversingextendArrExp "author: Frenkel TUD 2010-07.
1217312173
output DAE.Exp outExp;
1217412174
output Boolean outExpanded;
1217512175
algorithm
12176-
(outExp, outExpanded) := matchcontinue(inExp)
12176+
(outExp, outExpanded) := match(inExp)
1217712177
local
1217812178
DAE.ComponentRef cr;
1217912179
DAE.Type ty;
1218012180
DAE.Dimension id, jd;
1218112181
Integer i, j;
1218212182
list<DAE.Exp> expl;
12183-
DAE.Exp e, e_new;
12183+
DAE.Exp e;
1218412184
list<DAE.Var> varLst;
1218512185
Absyn.Path name;
1218612186
list<list<DAE.Exp>> mat;
12187-
Boolean b;
1218812187

1218912188
// CASE for Matrix
1219012189
case DAE.CREF(ty=ty as DAE.T_ARRAY(dims={id, jd}))
1219112190
equation
1219212191
i = dimensionSize(id);
1219312192
j = dimensionSize(jd);
1219412193
expl = expandExpression(inExp);
12195-
mat = makeMatrix(expl,j);
12196-
e_new = DAE.MATRIX(ty,i,mat);
12197-
(e, b) = traverseExpBottomUp(e_new, traversingextendArrExp, true);
12198-
then
12199-
(e, b);
12200-
12201-
// CASE for Matrix and checkModel is on
12202-
case DAE.CREF(ty=ty as DAE.T_ARRAY(dims={_, _}))
12203-
equation
12204-
true = Flags.getConfigBool(Flags.CHECK_MODEL);
12205-
i = dimensionSize(DAE.DIM_INTEGER(1));
12206-
j = dimensionSize(DAE.DIM_INTEGER(1));
12207-
expl = expandExpression(inExp);
12208-
mat = makeMatrix(expl,j);
12209-
e_new = DAE.MATRIX(ty,i,mat);
12210-
(e, b) = traverseExpBottomUp(e_new, traversingextendArrExp, true);
12194+
mat = makeMatrix(expl, j);
12195+
e = DAE.MATRIX(ty, i, mat);
1221112196
then
12212-
(e, b);
12197+
(e, true);
1221312198

1221412199
// CASE for Array
1221512200
case DAE.CREF(ty=ty as DAE.T_ARRAY())
1221612201
equation
1221712202
expl = expandExpression(inExp);
12218-
e_new = DAE.ARRAY(ty,true,expl);
12219-
(e, b) = traverseExpBottomUp(e_new, traversingextendArrExp, true);
12203+
e = DAE.ARRAY(ty, true, expl);
1222012204
then
12221-
(e, b);
12222-
12223-
// CASE for Array and checkModel is on
12224-
case DAE.CREF(ty=ty as DAE.T_ARRAY())
12225-
equation
12226-
true = Flags.getConfigBool(Flags.CHECK_MODEL);
12227-
expl = expandExpression(inExp);
12228-
e_new = DAE.ARRAY(ty,true,expl);
12229-
(e, b) = traverseExpBottomUp(e_new, traversingextendArrExp, true);
12230-
then
12231-
(e, b);
12205+
(e, true);
1223212206

1223312207
// CASE for Records
1223412208
case DAE.CREF(componentRef=cr, ty=ty as DAE.T_COMPLEX(varLst=varLst, complexClassType=ClassInf.RECORD(name)))
1223512209
equation
12236-
expl = List.map1(varLst,generateCrefsExpFromExpVar,cr);
12210+
expl = List.map1(varLst, generateCrefsExpFromExpVar, cr);
1223712211
i = listLength(expl);
12238-
true = intGt(i,0);
12239-
e_new = DAE.CALL(name,expl,DAE.CALL_ATTR(ty,false,false,false,false,DAE.NO_INLINE(),DAE.NO_TAIL()));
12240-
(e, b) = traverseExpBottomUp(e_new, traversingextendArrExp, true);
12212+
true = intGt(i, 0);
12213+
e = DAE.CALL(name, expl, DAE.CALL_ATTR(ty, false, false, false, false, DAE.NO_INLINE(), DAE.NO_TAIL()));
12214+
(e, _) = traverseExpBottomUp(e, traversingextendArrExp, true);
1224112215
then
12242-
(e, b);
12216+
(e, true);
1224312217

1224412218
else (inExp, inExpanded);
1224512219

12246-
end matchcontinue;
12220+
end match;
1224712221
end traversingextendArrExp;
1224812222

1224912223
protected function insertSubScripts"traverses the subscripts of the templSubScript and searches for wholedim. the value replaces the wholedim.

0 commit comments

Comments
 (0)