Skip to content

Commit

Permalink
- Fixed the field names of DAE.ExternalDecl (the names and types were…
Browse files Browse the repository at this point in the history
… off-by-one since the translation from RML)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8080 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 4, 2011
1 parent e357326 commit 0b05027
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions Compiler/BackEnd/SimCode.mo
Expand Up @@ -1463,8 +1463,8 @@ algorithm
local
Option<Absyn.Annotation> ann1,ann2;
list<String> includes1,libs1,includes2,libs2;
case (BackendDAE.EXTOBJCLASS(constructor=DAE.FUNCTION(functions={DAE.FUNCTION_EXT(externalDecl=DAE.EXTERNALDECL(language=ann1))}),
destructor=DAE.FUNCTION(functions={DAE.FUNCTION_EXT(externalDecl=DAE.EXTERNALDECL(language=ann2))})))
case (BackendDAE.EXTOBJCLASS(constructor=DAE.FUNCTION(functions={DAE.FUNCTION_EXT(externalDecl=DAE.EXTERNALDECL(ann=ann1))}),
destructor=DAE.FUNCTION(functions={DAE.FUNCTION_EXT(externalDecl=DAE.EXTERNALDECL(ann=ann2))})))
equation
(includes1,libs1) = generateExtFunctionIncludes(ann1);
(includes2,libs2) = generateExtFunctionIncludes(ann2);
Expand Down Expand Up @@ -1528,7 +1528,7 @@ algorithm
(fns, rt_2, decls, includes, libs) = elaborateFunctions2(rest, accfns, rt, decls, includes, libs);
then
(fns, rt_2, decls, includes, libs);
case (DAE.FUNCTION(functions = DAE.FUNCTION_EXT(externalDecl = DAE.EXTERNALDECL(returnType="builtin"))::_)::rest,accfns,rt,decls,includes,libs)
case (DAE.FUNCTION(functions = DAE.FUNCTION_EXT(externalDecl = DAE.EXTERNALDECL(language="builtin"))::_)::rest,accfns,rt,decls,includes,libs)
equation
// skip over builtin functions
(fns, rt_2, decls, includes, libs) = elaborateFunctions2(rest, accfns, rt, decls, includes, libs);
Expand Down Expand Up @@ -1603,8 +1603,8 @@ algorithm
functions = DAE.FUNCTION_EXT(body = daeElts, externalDecl = extdecl)::_, // might be followed by derivative maps
type_ = (tp as (DAE.T_FUNCTION(funcArg = args,funcResultType = restype),_))),rt,recordDecls,includes,libs)
equation
DAE.EXTERNALDECL(ident=extfnname, external_=extargs,
parameters=extretarg, returnType=lang, language=ann) = extdecl;
DAE.EXTERNALDECL(name=extfnname, args=extargs,
returnArg=extretarg, language=lang, ann=ann) = extdecl;
outvars = DAEUtil.getOutputVars(daeElts);
invars = DAEUtil.getInputVars(daeElts);
bivars = DAEUtil.getBidirVars(daeElts);
Expand Down Expand Up @@ -2822,10 +2822,10 @@ algorithm
path=path2,
constructor=DAE.FUNCTION(
functions={DAE.FUNCTION_EXT(
externalDecl=DAE.EXTERNALDECL(ident=cFuncStr))}),
externalDecl=DAE.EXTERNALDECL(name=cFuncStr))}),
destructor=DAE.FUNCTION(
functions={DAE.FUNCTION_EXT(
externalDecl=DAE.EXTERNALDECL(ident=dFuncStr))})) :: _)
externalDecl=DAE.EXTERNALDECL(name=dFuncStr))})) :: _)
equation
true = ModUtil.pathEqual(path1, path2);
then ({(name, cFuncStr, args)}, {(dFuncStr, name)}, {});
Expand Down
10 changes: 5 additions & 5 deletions Compiler/FrontEnd/DAE.mo
Expand Up @@ -395,11 +395,11 @@ end ExtArg;

public uniontype ExternalDecl
record EXTERNALDECL
Ident ident;
list<ExtArg> external_ "external function name" ;
ExtArg parameters "parameters" ;
String returnType "return type" ;
Option<Absyn.Annotation> language "language e.g. Library" ;
String name;
list<ExtArg> args;
ExtArg returnArg;
String language;
Option<Absyn.Annotation> ann;
end EXTERNALDECL;
end ExternalDecl;

Expand Down
11 changes: 5 additions & 6 deletions Compiler/FrontEnd/DAEDump.mo
Expand Up @@ -466,8 +466,7 @@ algorithm
String extargsstr,rettystr,str,id,lang;
list<DAE.ExtArg> extargs;
DAE.ExtArg retty;
Option<Absyn.Annotation> ann;
case DAE.EXTERNALDECL(ident = id,external_ = extargs,parameters = retty,returnType = lang,language = ann)
case DAE.EXTERNALDECL(name = id,args = extargs,returnArg = retty,language = lang)
equation
extargsstr = Dump.getStringList(extargs, dumpExtArgStr, ",");
rettystr = dumpExtArgStr(retty);
Expand Down Expand Up @@ -1333,11 +1332,11 @@ algorithm
then
();

case DAE.FUNCTION(functions = (DAE.FUNCTION_EXT(externalDecl = DAE.EXTERNALDECL(returnType="builtin"))::_))
case DAE.FUNCTION(functions = (DAE.FUNCTION_EXT(externalDecl = DAE.EXTERNALDECL(language="builtin"))::_))
then
();

case DAE.FUNCTION(path = fpath,inlineType=inlineType,functions = (DAE.FUNCTION_EXT(body = daeElts, externalDecl = DAE.EXTERNALDECL(returnType=lang))::_),type_ = t)
case DAE.FUNCTION(path = fpath,inlineType=inlineType,functions = (DAE.FUNCTION_EXT(body = daeElts, externalDecl = DAE.EXTERNALDECL(language=lang))::_),type_ = t)
equation
fstr = Absyn.pathString(fpath);
inlineTypeStr = dumpInlineTypeStr(inlineType);
Expand Down Expand Up @@ -3319,11 +3318,11 @@ algorithm
then
str;

case (DAE.FUNCTION(functions=(DAE.FUNCTION_EXT(externalDecl = DAE.EXTERNALDECL(returnType="builtin"))::_)), str)
case (DAE.FUNCTION(functions=(DAE.FUNCTION_EXT(externalDecl = DAE.EXTERNALDECL(language="builtin"))::_)), str)
then
str;

case (DAE.FUNCTION(path = fpath,inlineType=inlineType,functions = (DAE.FUNCTION_EXT(body = daeElts, externalDecl = DAE.EXTERNALDECL(returnType=lang))::_),type_ = t), str)
case (DAE.FUNCTION(path = fpath,inlineType=inlineType,functions = (DAE.FUNCTION_EXT(body = daeElts, externalDecl = DAE.EXTERNALDECL(language=lang))::_),type_ = t), str)
equation
fstr = Absyn.pathString(fpath);
str = IOStream.append(str, "function ");
Expand Down
3 changes: 2 additions & 1 deletion Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -411,11 +411,12 @@ function classDirectory "Not standard Modelica"
external "builtin";
end classDirectory;

/* Actually contains more...
record SimulationResult
String resultFile;
String simulationOptions;
String messages;
end SimulationResult;
end SimulationResult; */

encapsulated package OpenModelica

Expand Down

0 comments on commit 0b05027

Please sign in to comment.