Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 85e1ec8

Browse files
lochelOpenModelica-Hudson
authored andcommitted
Adapt index reduction to new representation of start values
1 parent 03e06df commit 85e1ec8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Compiler/BackEnd/IndexReduction.mo

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,7 @@ protected
15891589

15901590
DAE.Exp expcrA,mulAstates,mulAdstates,expset,expderset,expsetstart;
15911591
list<DAE.Exp> expcrstates,expcrdstates,expcrset,expcrdset,expcrstatesstart;
1592+
list<DAE.ComponentRef> crstates;
15921593
DAE.Operator op;
15931594
BackendDAE.Equation eqn,deqn;
15941595
list<BackendDAE.Equation> cEqnsLst,oEqnLst;
@@ -1607,8 +1608,9 @@ algorithm
16071608
// add Equations
16081609
// set.x = set.A*set.statecandidates
16091610
// der(set.x) = set.A*der(set.candidates)
1610-
expcrstates := List.map(stateCandidates,BackendVariable.varExp);
1611-
expcrstatesstart := List.map(expcrstates,makeStartExp);
1611+
expcrstates := List.map(stateCandidates, BackendVariable.varExp);
1612+
crstates := List.map(stateCandidates, BackendVariable.varCref);
1613+
expcrstatesstart := List.map(crstates, makeStartExp);
16121614
expcrdstates := List.map(expcrstates,makeder);
16131615
expcrset := List.map(crset,Expression.crefExp);
16141616
expcrdset := List.map(expcrset,makeder);
@@ -1648,11 +1650,11 @@ algorithm
16481650
end generateStateSets;
16491651

16501652
protected function makeStartExp
1651-
"generate the expression: $_start(inExp)"
1652-
input DAE.Exp inExp;
1653+
"generate the expression: $START.inCref"
1654+
input DAE.ComponentRef inCref;
16531655
output DAE.Exp outExp;
16541656
algorithm
1655-
outExp := Expression.makePureBuiltinCall("$_start", {inExp}, Expression.typeof(inExp));
1657+
outExp := Expression.crefExp(ComponentReference.crefPrefixStart(inCref));
16561658
end makeStartExp;
16571659

16581660
protected function setStartExp

0 commit comments

Comments
 (0)