Skip to content

Commit

Permalink
- Fix compilation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14652 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 3, 2013
1 parent 4a8cd21 commit efa6fae
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 73 deletions.
21 changes: 11 additions & 10 deletions Compiler/BackEnd/SimCodeMain.mo
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ encapsulated package SimCodeMain
" file: SimCodeMain.mo
package: SimCodeMain
description: Code generation using Susan templates

The entry points to this module are the translateModel function and the
translateFunctions fuction.

The entry points to this module are the translateModel function and the
translateFunctions fuction.
RCS: $Id$"

Expand Down Expand Up @@ -133,7 +133,7 @@ algorithm
fileDir := CevalScript.getFileDir(a_cref, p);
System.realtimeTick(CevalScript.RT_CLOCK_SIMCODE);
(libs, includes, includeDirs, recordDecls, functions, outIndexedBackendDAE, _, literals) :=
SimCodeUtil.createFunctions(dae, inBackendDAE, className);
SimCodeUtil.createFunctions(p, dae, inBackendDAE, className);
simCode := SimCodeUtil.createSimCode(outIndexedBackendDAE,
className, filenamePrefix, fileDir, functions, includes, includeDirs, libs, simSettingsOpt, recordDecls, literals,Absyn.FUNCTIONARGS({},{}));
timeSimCode := System.realtimeTock(CevalScript.RT_CLOCK_SIMCODE);
Expand Down Expand Up @@ -250,7 +250,7 @@ algorithm
fileDir := CevalScript.getFileDir(a_cref, p);
System.realtimeTick(CevalScript.RT_CLOCK_SIMCODE);
(libs, includes, includeDirs, recordDecls, functions, outIndexedBackendDAE, _, literals) :=
SimCodeUtil.createFunctions(dae, inBackendDAE, className);
SimCodeUtil.createFunctions(p, dae, inBackendDAE, className);
simCode := SimCodeUtil.createSimCode(outIndexedBackendDAE,
className, filenamePrefix, fileDir, functions, includes, includeDirs, libs, simSettingsOpt, recordDecls, literals, args);

Expand Down Expand Up @@ -429,13 +429,14 @@ public function translateFunctions
"Entry point to translate Modelica/MetaModelica functions to C functions.
Called from other places in the compiler."
input Absyn.Program program;
input String name;
input Option<DAE.Function> optMainFunction;
input list<DAE.Function> idaeElements;
input list<DAE.Type> metarecordTypes;
input list<String> inIncludes;
algorithm
_ := match (name, optMainFunction, idaeElements, metarecordTypes, inIncludes)
_ := match (program, name, optMainFunction, idaeElements, metarecordTypes, inIncludes)
local
DAE.Function daeMainFunction;
SimCode.Function mainFunction;
Expand All @@ -447,23 +448,23 @@ algorithm
list<DAE.Exp> literals;
list<DAE.Function> daeElements;

case (_, SOME(daeMainFunction), daeElements, _, includes)
case (_, _, SOME(daeMainFunction), daeElements, _, includes)
equation
// Create SimCode.FunctionCode
(daeElements,literals) = SimCodeUtil.findLiterals(daeMainFunction::daeElements);
(mainFunction::fns, extraRecordDecls, includes, includeDirs, libs) = SimCodeUtil.elaborateFunctions(daeElements, metarecordTypes, literals, includes);
(mainFunction::fns, extraRecordDecls, includes, includeDirs, libs) = SimCodeUtil.elaborateFunctions(program, daeElements, metarecordTypes, literals, includes);
SimCodeUtil.checkValidMainFunction(name, mainFunction);
makefileParams = SimCodeUtil.createMakefileParams(includeDirs, libs);
fnCode = SimCode.FUNCTIONCODE(name, SOME(mainFunction), fns, literals, includes, makefileParams, extraRecordDecls);
// Generate code
_ = Tpl.tplString(CodegenC.translateFunctions, fnCode);
then
();
case (_, NONE(), daeElements, _, includes)
case (_, _, NONE(), daeElements, _, includes)
equation
// Create SimCode.FunctionCode
(daeElements,literals) = SimCodeUtil.findLiterals(daeElements);
(fns, extraRecordDecls, includes, includeDirs, libs) = SimCodeUtil.elaborateFunctions(daeElements, metarecordTypes, literals, includes);
(fns, extraRecordDecls, includes, includeDirs, libs) = SimCodeUtil.elaborateFunctions(program, daeElements, metarecordTypes, literals, includes);
makefileParams = SimCodeUtil.createMakefileParams(includeDirs, libs);
fnCode = SimCode.FUNCTIONCODE(name, NONE(), fns, literals, includes, makefileParams, extraRecordDecls);
// Generate code
Expand Down

0 comments on commit efa6fae

Please sign in to comment.