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

Commit e46b837

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Propagate unit checking to the DAE
This fixes some of the issues in ticket:4526. displayUnit is not considered. Belonging to [master]: - #2104 - OpenModelica/OpenModelica-testsuite#819
1 parent 92c6383 commit e46b837

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Compiler/FrontEnd/Inst.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ algorithm
327327

328328
// instantiate a class
329329
case (cache,ih,cdecls as _::_,path)
330-
equation
331-
(outCache,outEnv,outIH,outDAElist) = instantiateClass_dispatch(cache,ih,cdecls,path,doSCodeDep);
332-
NFUnitCheck.checkUnits(outDAElist,FCore.getFunctionTree(outCache));
330+
algorithm
331+
(outCache,outEnv,outIH,outDAElist) := instantiateClass_dispatch(cache,ih,cdecls,path,doSCodeDep);
332+
outDAElist := NFUnitCheck.checkUnits(outDAElist,FCore.getFunctionTree(outCache));
333333
then
334334
(outCache,outEnv,outIH,outDAElist);
335335

Compiler/NFFrontEnd/NFUnitCheck.mo

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ end Functionargs;
4343
public function checkUnits
4444
input DAE.DAElist inDAE;
4545
input DAE.FunctionTree func;
46+
output DAE.DAElist outDAE = inDAE;
4647
protected
47-
DAE.DAElist elts1, elts2, elts3;
48+
DAE.DAElist elts1, elts2;
4849
list<DAE.Element> eqlist, varlist, newdaelist;
4950
list<DAE.Function> functionlist;
5051
list<Functionargs> args;
@@ -76,13 +77,13 @@ algorithm
7677
HtCr2U2 := BaseHashTable.copy(HtCr2U1);
7778
((HtCr2U2, HtS2U, HtU2S)) := algo(varlist, eqlist, args, HtCr2U2, HtS2U, HtU2S);
7879
varlist := List.map2(varlist, returnVar, HtCr2U2, HtU2S);
79-
newdaelist := List.append_reverse(varlist, eqlist);
80+
newdaelist := listAppend(varlist, eqlist);
8081
if Flags.isSet(Flags.DUMP_UNIT) then
8182
BaseHashTable.dumpHashTable(HtCr2U2);
8283
print("######## UnitCheck COMPLETED ########\n");
8384
end if;
8485
notification(HtCr2U1, HtCr2U2, HtU2S);
85-
elts3 := updateDAElist(inDAE, listReverse(newdaelist));
86+
outDAE := updateDAElist(inDAE, newdaelist);
8687
else
8788
Error.addInternalError(getInstanceName() + ": unit check module failed", sourceInfo());
8889
end try;

0 commit comments

Comments
 (0)