Skip to content

Commit

Permalink
- added case to avoid generation of nonlinear systems for record con…
Browse files Browse the repository at this point in the history
…structor in tuple calls (e.g. (R(r1,r2),x) = f(x)).

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24039 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Jan 14, 2015
1 parent 95eaaf5 commit 8bbe824
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -6033,6 +6033,7 @@ algorithm
/* consider also array and record crefs */
case (DAE.CREF(componentRef=cr), _)
equation

crefs = ComponentReference.expandCref(cr, true);
false = valueEq({cr},crefs); // Not an expanded element
expLst = List.map(crefs, Expression.crefExp);
Expand All @@ -6042,6 +6043,12 @@ algorithm
case (DAE.ICONST(_), _) then (true, iht);
case (DAE.BCONST(_), _) then (true, iht);
case (DAE.CREF(componentRef=DAE.WILD()), _) then (true, iht);
/* Consider also record contructor */
/*
case (DAE.CALL(expLst=expLst),_) equation
List.foldAllValue(expLst, createSingleComplexEqnCode3, true, iht);
then (true, iht);
*/
else
(false, iht);
end matchcontinue;
Expand Down

0 comments on commit 8bbe824

Please sign in to comment.