Skip to content

Commit

Permalink
- size of enumeration type is 1
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13973 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Nov 19, 2012
1 parent d646053 commit 84b2c97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
18 changes: 7 additions & 11 deletions Compiler/FrontEnd/CheckModel.mo
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ algorithm
// equations
case((elem as DAE.EQUATION(exp=e1))::rest,_,_,_,_)
equation
//size = Expression.sizeOf(Expression.typeof(e1));
size = 1;
size = Expression.sizeOf(Expression.typeof(e1));
(varSize,eqnSize,eqns,hs) = countVarEqnSize(rest,ivarSize,ieqnSize+size,elem::ieqnslst,ihs);
then
(varSize,eqnSize,eqns,hs);
Expand All @@ -191,19 +190,17 @@ algorithm
// effort variable equality equations
case ((elem as DAE.EQUEQUATION(cr1 = cr))::rest,_,_,_,_)
equation
//tp = ComponentReference.crefTypeConsiderSubs(cr);
//size = Expression.sizeOf(tp);
size = 1;
tp = ComponentReference.crefTypeConsiderSubs(cr);
size = Expression.sizeOf(tp);
(varSize,eqnSize,eqns,hs) = countVarEqnSize(rest,ivarSize,ieqnSize+size,elem::ieqnslst,ihs);
then
(varSize,eqnSize,eqns,hs);

// a solved equation
case ((elem as DAE.DEFINE(componentRef = cr))::rest,_,_,_,_)
equation
//tp = ComponentReference.crefTypeConsiderSubs(cr);
//size = Expression.sizeOf(tp);
size = 1;
tp = ComponentReference.crefTypeConsiderSubs(cr);
size = Expression.sizeOf(tp);
(varSize,eqnSize,eqns,hs) = countVarEqnSize(rest,ivarSize,ieqnSize+size,elem::ieqnslst,ihs);
then
(varSize,eqnSize,eqns,hs);
Expand Down Expand Up @@ -576,9 +573,8 @@ algorithm
// effort variable equality equations
case ((elem as DAE.EQUEQUATION(cr1 = cr))::rest,_,_)
equation
//tp = ComponentReference.crefTypeConsiderSubs(cr);
//size = Expression.sizeOf(tp);
size = 1;
tp = ComponentReference.crefTypeConsiderSubs(cr);
size = Expression.sizeOf(tp);
then
countSympleEqnSize(rest,isimpleEqnSize+size,ihs);

Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Expression.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1689,11 +1689,11 @@ algorithm
nr = List.reduce(lstInt, intAdd);
then
nr;

/* Size of Enumeration is 1 like a Integer
case DAE.T_ENUMERATION(index=NONE(),names=strlst)
then
listLength(strlst);

*/
case DAE.T_FUNCTION(funcResultType=ty)
then
sizeOf(ty);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenXML.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ template classAttributesXml(ClassAttributes classAttribute, SimCode simCode)
<%startTime%>
<%finalTime%>
<opt:pathConstraints>
<%constraints%>
<%constraints%>
</opt:pathConstraints>
</opt:Optimization>
>>
Expand Down

0 comments on commit 84b2c97

Please sign in to comment.