Skip to content

Commit

Permalink
- Moved Codegen.getMatchingExpsList and Codegen.getMatchingExps to Exp.
Browse files Browse the repository at this point in the history
- Moved Codegen.getUniontypePaths to DAEUtil.
- Removed Codegen.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5685 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Jun 17, 2010
1 parent 8c2f776 commit 94355bf
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 10,426 deletions.
2 changes: 1 addition & 1 deletion Compiler/CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@
# The MO sources
SET(SRCMO Absyn.mo AbsynDep.mo Algorithm.mo Builtin.mo
Ceval.mo CevalScript.mo Cevalfunc.mo ClassInf.mo
ClassLoader.mo Codegen.mo Connect.mo ExpandableConnectors.mo
ClassLoader.mo Connect.mo ExpandableConnectors.mo
ConnectionGraph.mo Convert.mo DAE.mo DAELow.mo
DAEUtil.mo Derive.mo Debug.mo DFA.mo Dump.mo
DumpGraphviz.mo Constants.mo Env.mo Error.mo
Expand Down
67 changes: 1 addition & 66 deletions Compiler/CevalScript.mo
Expand Up @@ -64,7 +64,6 @@ protected import AbsynDep;
protected import ConnectionGraph;
protected import ClassInf;
protected import ClassLoader;
protected import Codegen;
protected import Connect;
protected import DAEQuery;
protected import DAEUtil;
Expand Down Expand Up @@ -4089,81 +4088,17 @@ algorithm
case (cache, env, path)
equation
false = RTOpts.debugFlag("nogen");
true = RTOpts.debugFlag("tplmode");
(cache,false) = Static.isExternalObjectFunction(cache,env,path); //ext objs functions not possible to Ceval.ceval.
pathstr = generateFunctionName(path);
Debug.fprintln("ceval", "/*- CevalScript.cevalGenerateFunction starting " +& pathstr +& " */");
(cache,dae as DAE.DAE(d,_),_) = cevalGenerateFunctionDAEs(cache, path, env, {});

uniontypePaths = Codegen.getUniontypePaths(d);
uniontypePaths = DAEUtil.getUniontypePaths(d);
(cache,metarecordTypes) = Lookup.lookupMetarecordsRecursive(cache, env, uniontypePaths, {});

cfilename = stringAppend(pathstr, ".c");
//Print.clearBuf();
Debug.fprintln("ceval", "/*- CevalScript.cevalGenerateFunction generating function string */");
//Print.printBuf(constCfileHeader);
//libs = Codegen.generateFunctions(dae,metarecordTypes);
//Print.writeBuf(cfilename);
//Print.clearBuf();

Debug.fprintln("dynload", "CevalScript.cevalGenerateFunction: generating makefile for " +& pathstr);
//makefilename = generateMakefilename(pathstr);
//omhome = Settings.getInstallationDirectoryPath();
//omhome = System.trim(omhome, "\""); //Remove any quotation marks from omhome.
//MakefileHeader = generateMakefileHeader();
//libs = Util.listUnion(libs, libs); // un-double the libs
//libsstr = Util.stringDelimitList(libs, " ");
//str = Util.stringAppendList(
//{MakefileHeader,"\n.PHONY: ",pathstr,"\n",
//pathstr,": ",cfilename,"\n","\t $(LINK)",
//" $(CFLAGS)",
//" -o ",pathstr,"$(DLLEXT) ",cfilename,
//" $(LDFLAGS)",
//" ",libsstr," -lm \n"});
//System.writeFile(makefilename, str);
SimCode.translateFunctions(pathstr, d, metarecordTypes);
compileModel(pathstr, {}, "", "");
then
(cache, pathstr);
/* not template based translation */
case (cache, env, path)
equation
false = RTOpts.debugFlag("nogen");
false = RTOpts.debugFlag("tplmode");
(cache,false) = Static.isExternalObjectFunction(cache,env,path); //ext objs functions not possible to Ceval.ceval.
pathstr = generateFunctionName(path);
Debug.fprintln("ceval", "/*- CevalScript.cevalGenerateFunction starting " +& pathstr +& " */");
(cache,dae as DAE.DAE(d,_),_) = cevalGenerateFunctionDAEs(cache, path, env, {});
uniontypePaths = Codegen.getUniontypePaths(d);
(cache,metarecordTypes) = Lookup.lookupMetarecordsRecursive(cache, env, uniontypePaths, {});

cfilename = stringAppend(pathstr, ".c");
Print.clearBuf();
Debug.fprintln("ceval", "/*- CevalScript.cevalGenerateFunction generating function string */");
Print.printBuf(constCfileHeader);
libs = Codegen.generateFunctions(dae,metarecordTypes);
Print.writeBuf(cfilename);
Print.clearBuf();

Debug.fprintln("dynload", "CevalScript.cevalGenerateFunction: generating makefile for " +& pathstr);
makefilename = generateMakefilename(pathstr);
omhome = Settings.getInstallationDirectoryPath();
omhome = System.trim(omhome, "\""); //Remove any quotation marks from omhome.
MakefileHeader = generateMakefileHeader();
libs = Util.listUnion(libs, libs); // un-double the libs
libsstr = Util.stringDelimitList(libs, " ");
str = Util.stringAppendList(
{MakefileHeader,"\n.PHONY: ",pathstr,"\n",
pathstr,": ",cfilename,"\n","\t $(LINK)",
" $(CFLAGS)",
" -o ",pathstr,"$(DLLEXT) ",cfilename,
" ",libsstr,
" $(LDFLAGS)",
" -lm \n"});
System.writeFile(makefilename, str);
compileModel(pathstr, {}, "", "");
then
(cache,pathstr);
case (cache, env, path)
equation
false = RTOpts.debugFlag("nogen");
Expand Down

0 comments on commit 94355bf

Please sign in to comment.