You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This handles some obscure code that gets inlined. Ranges are not
simplified in the general case because they can be huge and usually are
used to iterate over some indexes without the need to construct an
array. Subscripts are different in that they are used to construct
arrays, so they should be safe to evaluate at compile-time.
e :=Expression.makeArray(list(DAE.ICONST(i) for i in simplifyRange(istart,match step caseNONE() then 1; caseSOME(DAE.ICONST(istep)) then istep; end match,istop)), DAE.T_INTEGER_DEFAULT, true);
353
+
hasRange :=true;
354
+
then e;
355
+
else exp; end match
356
+
for exp in inSubs);
357
+
true := hasRange;
358
+
then DAE.ASUB(inExp, subs);
359
+
342
360
else origExp;
343
361
end matchcontinue;
344
362
end simplifyAsubExp;
@@ -3481,7 +3499,7 @@ protected
3481
3499
DAE.Type ty;
3482
3500
algorithm
3483
3501
// Expand the subscripts.
3484
-
indices :=List.map(inSubscripts, Expression.splitArray);
3502
+
indices :=list(Expression.splitArray(simplify1(e)) for e in inSubscripts);
3485
3503
// Make asubs from all combinations of the subscript indices.
0 commit comments