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

Commit 66ceece

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
Support more vectorized calls for Cpp runtime only, ticket:5110
C runtime fails for previous(array), see e.g. Modelica_Synchronous.Examples.Elementary.RealSignals.SampleWithADeffects Belonging to [master]: - #2655
1 parent bfccc5f commit 66ceece

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Compiler/BackEnd/BackendDAETransform.mo

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,14 @@ algorithm
865865
(exp1::exps) := Expression.flattenArrayExpToList(e);
866866
(cr1, call1) := match exp1
867867
case DAE.CREF(componentRef=cr1) then (cr1, "");
868-
case DAE.CALL(path=Absyn.IDENT(name="previous"), expLst={DAE.CREF(componentRef=cr1)}) then (cr1, "previous");
868+
case DAE.CALL(path=Absyn.IDENT(name=call1), expLst={DAE.CREF(componentRef=cr1)}) then (cr1, call1);
869869
else fail();
870870
end match;
871+
if call1 <> "" and Config.simCodeTarget() <> "Cpp" or call1 == "pre" then
872+
// only Cpp runtime supports collapsed calls, except pre(array), see e.g.
873+
// Modelica_Synchronous.Examples.Elementary.RealSignals.SampleWithADeffects
874+
fail();
875+
end if;
871876
// Check that the first element starts at index [1,...,1]
872877
subs := ComponentReference.crefLastSubs(cr1);
873878
true := ndim==listLength(subs);
@@ -881,7 +886,7 @@ algorithm
881886
//DAE.CREF(componentRef=cr2) := exp;
882887
(cr2, call2) := match exp
883888
case DAE.CREF(componentRef=cr2) then (cr2, "");
884-
case DAE.CALL(path=Absyn.IDENT(name="previous"), expLst={DAE.CREF(componentRef=cr2)}) then (cr2, "previous");
889+
case DAE.CALL(path=Absyn.IDENT(name=call2), expLst={DAE.CREF(componentRef=cr2)}) then (cr2, call2);
885890
else fail();
886891
end match;
887892
true := ndim==listLength(ComponentReference.crefLastSubs(cr2));

0 commit comments

Comments
 (0)