Skip to content

Commit

Permalink
- More expansion of functions
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12144 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jun 20, 2012
1 parent 9d6cd1c commit 51fb58f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Compiler/FrontEnd/SCodeExpand.mo
Expand Up @@ -909,9 +909,20 @@ algorithm
outFunction := match (inFunction)
local
Absyn.Path path;
case InstTypes.FUNCTION(path=path)
equation
then DAE.FUNCTION(path,{DAE.FUNCTION_DEF({})},DAE.T_FUNCTION_DEFAULT,false,DAE.NO_INLINE(),DAE.emptyElementSource,NONE());
list<DAE.Element> el;
list<InstTypes.Element> inputs,outputs,locals;
list<InstTypes.Statement> al;
case InstTypes.FUNCTION(path=path,inputs=inputs,outputs=outputs,locals=locals,algorithms=al)
equation
el = {};
/* Elements need to be typed...
el = List.fold1(inputs, expandElement, {}, el);
el = List.fold1(outputs, expandElement, {}, el);
el = List.fold1(locals, expandElement, {}, el);
*/
el = expandStatements(al, {}, false /* not initial */, el);
el = listReverse(el);
then DAE.FUNCTION(path,{DAE.FUNCTION_DEF(el)},DAE.T_FUNCTION_DEFAULT,false,DAE.NO_INLINE(),DAE.emptyElementSource,NONE());
end match;
end expandFunction;

Expand Down

0 comments on commit 51fb58f

Please sign in to comment.