Skip to content

Commit

Permalink
- Fix separate compilation
Browse files Browse the repository at this point in the history
- Add separate compilation test to the testsuite so people do not break it again


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16415 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jun 20, 2013
1 parent 0809ddb commit 8596b82
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -998,9 +998,11 @@ annotation(preferredView="text");
end generateHeader;

function generateSeparateCode
input TypeName className := $TypeName(AllLoadedClasses);
output Boolean success;
external "builtin";
annotation(preferredView="text");
annotation(Documentation(info="<html><p>Under construction.</p>
</html>"),preferredView="text");
end generateSeparateCode;

function getLinker
Expand Down
6 changes: 3 additions & 3 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -1894,13 +1894,13 @@ algorithm
then
(cache,Values.BOOL(false),st);

case (cache,env,"generateSeparateCode",{},(st as Interactive.SYMBOLTABLE(ast = p)),_)
case (cache,env,"generateSeparateCode",{Values.CODE(Absyn.C_TYPENAME(Absyn.IDENT("AllLoadedClasses")))},(st as Interactive.SYMBOLTABLE(ast = p)),_)
equation
sp = SCodeUtil.translateAbsyn2SCode(p);
deps = generateFunctions(cache,env,p,sp,{});
then (cache,Values.BOOL(true),st);

case (cache,env,"generateSeparateCode",{},st,_)
case (cache,env,"generateSeparateCode",_,st,_)
then (cache,Values.BOOL(false),st);

case (cache,env,"loadModel",{Values.CODE(Absyn.C_TYPENAME(path)),Values.ARRAY(valueLst=cvars),Values.BOOL(b),Values.STRING(str)},
Expand Down Expand Up @@ -4582,7 +4582,7 @@ algorithm
funcs = Env.getFunctionTree(cache);
d = List.map1(paths, DAEUtil.getNamedFunction, funcs);
(_,(_,dependencies)) = DAEUtil.traverseDAEFunctions(d,Expression.traverseSubexpressionsHelper,(matchQualifiedCalls,{}),{});
print(name +& " has dependencies: " +& stringDelimitList(dependencies,",") +& "\n");
// print(name +& " has dependencies: " +& stringDelimitList(dependencies,",") +& "\n");
acc = (name,dependencies)::acc;
dependencies = List.map1(dependencies,stringAppend,".h\"");
dependencies = List.map1r(dependencies,stringAppend,"#include \"");
Expand Down
22 changes: 12 additions & 10 deletions Compiler/Util/VarTransform.mo
Expand Up @@ -951,17 +951,19 @@ public function addReplacementLst " adds several replacements given by list of c
input list<DAE.Exp> dsts;
output VariableReplacements repl;
algorithm
repl := matchcontinue(inRepl,crs,dsts)
local
DAE.ComponentRef cr;
DAE.Exp dst;
repl := match (inRepl,crs,dsts)
local
DAE.ComponentRef cr;
DAE.Exp dst;
list<DAE.ComponentRef> crrest;
list<DAE.Exp> dstrest;

case(repl,{},{}) then repl;
case(repl,cr::crs,dst::dsts) equation
case (repl,{},{}) then repl;
case (repl,cr::crrest,dst::dstrest) equation
repl = addReplacement(repl,cr,dst);
repl = addReplacementLst(repl,crs,dsts);
repl = addReplacementLst(repl,crrest,dstrest);
then repl;
end matchcontinue;
end match;
end addReplacementLst;

public function addReplacement "function: addReplacement
Expand Down Expand Up @@ -1145,11 +1147,11 @@ algorithm
DAE.ComponentRef src;
DAE.Exp dst;
VariableReplacements repl_1;
case (false,repl,src,dst) /* source dest */
case (false,_,src,dst) /* source dest */
equation
repl_1 = addReplacement(repl,src,dst);
then repl_1;
case (true,repl,src,dst)
case (true,_,src,dst)
then repl;
end matchcontinue;
end addReplacementIfNot;
Expand Down

0 comments on commit 8596b82

Please sign in to comment.