Skip to content

Commit

Permalink
- Keep External decls.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25230 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
mahge committed Mar 24, 2015
1 parent 623e897 commit bff8ce0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Compiler/FrontEnd/InstFunction.mo
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,16 @@ algorithm
cache = FCore.addDaeExtFunction(cache, funs);
then
(cache,env_1,ih);

// The function type can be determined without the body. Annotations need to be preserved though.

// The function type can be determined without the body. Annotations, restrictions and external decls need
// to be preserved though (e.g parallel external functions have restrictions parallel_function not external function)
// Maybe we need one more restriction type for those.
case (cache,env,ih,SCode.CLASS(name = id,prefixes = prefixes,
encapsulatedPrefix = e,partialPrefix = p, restriction=r,
classDef = SCode.PARTS(elementLst = elts),cmt=cmt, info = info))
classDef = SCode.PARTS(elementLst = elts, externalDecl = extDecl),cmt=cmt, info = info))
equation
elts = List.select(elts,isElementImportantForFunction);
stripped_class = SCode.CLASS(id,prefixes,e,p,r,SCode.PARTS(elts,{},{},{},{},{},{},NONE()),cmt,info);
stripped_class = SCode.CLASS(id,prefixes,e,p,r,SCode.PARTS(elts,{},{},{},{},{},{},extDecl),cmt,info);
(cache,env_1,ih,_) = implicitFunctionInstantiation2(cache, env, ih, DAE.NOMOD(), Prefix.NOPRE(), stripped_class, {}, true);
// Only external functions are valid without an algorithm section...
// cache = FCore.addDaeExtFunction(cache, funs);
Expand Down

0 comments on commit bff8ce0

Please sign in to comment.