Skip to content

Commit

Permalink
Don't add unused vardecls to the code
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15247 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 20, 2013
1 parent 6ce9cb3 commit 56c25a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6904,8 +6904,11 @@ template daeExpRelation(Exp exp, Context context, Text &preExp /*BUFP*/,
::=
match exp
case rel as RELATION(__) then
let simRel = daeExpRelationSim(rel, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
let &varDecls2 = buffer ""
let simRel = daeExpRelationSim(rel, context, &preExp /*BUFC*/, &varDecls2 /*BUFD*/)
if simRel then
/* Don't add the allocated temp-var unless it is used */
let &varDecls += varDecls2
simRel
else
let e1 = daeExp(rel.exp1, context, &preExp /*BUFC*/, &varDecls /*BUFD*/)
Expand Down
2 changes: 1 addition & 1 deletion Examples/BuildModelRecursive.mos
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ str:="<h1>Recursive BuildModel Test</h1>
<p>BuildModel time limit: "+ulimitOmc+"s</p>
<p>Simulation time limit: "+ulimitExe+"s</p>
<p>Flags: setCommandLineOptions(\"+d=nogen\"); setMatchingAlgorithm(\"PFPlusExt\"); setIndexReductionMethod(\"dynamicStateSelection\");</p>
<p>Links are provided if getErrorString() or the simulation generates output. <font style=\"background-color:#00FF00\">Green</style> means success, <font style=\"background-color:#FFFF00\">yellow</font> means success if +d=scodeInstShortcut was used. <font style=\"background-color:#FF0000\">Red</font> is bad and in general signifies a failure.</p>
<p>Links are provided if getErrorString() or the simulation generates output. <font style=\"background-color:#00FF00\">Green</font> means success, <font style=\"background-color:#FFFF00\">yellow</font> means success if +d=scodeInstShortcut was used. <font style=\"background-color:#FF0000\">Red</font> is bad and in general signifies a failure.</p>
";
writeFile(log,"<html><head><title>BuildModel Results</title></head><body>" + str);
writeFile(log,"<table><tr><th>Model</th><th>Simulate</th><th>Total buildModel</th><th>Frontend</th><th>Backend</th><th>SimCode</th><th>Templates</th><th>Compile</th></tr>",append=true);getErrorString();
Expand Down

0 comments on commit 56c25a3

Please sign in to comment.