Changeset d628e4c in OpenModelica


Ignore:
Timestamp:
2017-03-20T18:15:12+01:00 (7 years ago)
Author:
hudson <openmodelica@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
f159b761
Parents:
59a2173e
git-author:
Willi Braun <wbraun@…> (03/20/17 18:15:12)
git-committer:
hudson <openmodelica@…> (03/20/17 18:15:12)
Message:

fix codegeneration for records

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/SimCode/SimCodeUtil.mo

    rd74861a0 rd628e4c  
    57685768
    57695769    /* Record() = f()  */
    5770     case (_, DAE.CALL(path=path, expLst=e1lst, attr=DAE.CALL_ATTR(ty= tp as DAE.T_COMPLEX(complexClassType=ClassInf.RECORD(path=rpath), varLst=varLst))), e2, _, _, _)
     5770    case (_, DAE.CALL(path=path, expLst=expLst, attr=DAE.CALL_ATTR(ty= tp as DAE.T_COMPLEX(complexClassType=ClassInf.RECORD(path=rpath), varLst=varLst))), e2, _, _, _)
    57715771      equation
    57725772
    57735773        true = Absyn.pathEqual(path, rpath);
     5774        // check all crefs are on the lhs
     5775        ht = HashSet.emptyHashSet();
     5776        ht = List.fold(crefs, BaseHashSet.add, ht);
     5777        List.foldAllValue(expLst, createSingleComplexEqnCode3, true, ht);
    57745778        (e2_1, _) = Expression.extendArrExp(e2, false);
    57755779
     
    57835787
    57845788        /* Expand the varLst. Each var might be an array or record. */
    5785         e1lst = List.mapFlat(e1lst, Expression.expandExpression);
    5786         /* Expand the tmp record and any arrays */
    5787         e2lst = Expression.expandExpression(e1_1);
     5789        crexplst = List.map1(varLst, Expression.generateCrefsExpFromExpVar, cr1);
    57885790        /* pair each of the expanded expressions to coressponding one*/
    5789         exptl = List.threadTuple(e1lst, e2lst);
     5791        exptl = List.threadTuple(expLst, crexplst);
    57905792        /* Create residual equations for each pair*/
    57915793        (eqSystlst, uniqueEqIndex) = List.map1Fold(exptl, makeSES_SIMPLE_ASSIGN, source, uniqueEqIndex);
     
    58005802      equation
    58015803        true = Absyn.pathEqual(path, rpath);
     5804        // check all crefs are on the rhs => turn
    58025805        ht = HashSet.emptyHashSet();
    58035806        ht = List.fold(crefs, BaseHashSet.add, ht);
Note: See TracChangeset for help on using the changeset viewer.