Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
improved inline-function
Browse files Browse the repository at this point in the history
- disable guard inside addReplacement
 - guard called before addOptBindingReplacements if needed
 - since #2314 using replacement for outputs, too
  - allowed array-type and record type for outputs

refs ticket:4808

Belonging to [master]:
  - #2331
  • Loading branch information
vruge authored and OpenModelica-Hudson committed Mar 29, 2018
1 parent bb49baa commit d180efb
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Compiler/FrontEnd/Inline.mo
Expand Up @@ -1120,7 +1120,6 @@ protected
DAE.ComponentRef cr;
Option<DAE.Exp> binding;
DAE.Type tp;
DAE.Exp exp;
list<DAE.Statement> st;

algorithm
Expand All @@ -1132,19 +1131,12 @@ algorithm
oInputs = cr::oInputs;
then ();

case DAE.VAR(componentRef=cr,direction=DAE.OUTPUT(), binding=binding as SOME(exp))
case DAE.VAR(componentRef=cr,direction=DAE.OUTPUT(), binding=binding)
equation
// use type of cref, since var type is different
// and has no hint on array or record type
oRepl = addOptBindingReplacements(cr,binding,oRepl);
oOutputs = cr :: oOutputs;
then ();

case DAE.VAR(componentRef=cr,direction=DAE.OUTPUT(), binding=NONE())
equation
oOutputs = cr :: oOutputs;
then ();

case DAE.VAR(componentRef=cr,protection=DAE.PROTECTED(),binding=binding)
equation
// use type of cref, since var type is different
Expand Down Expand Up @@ -1200,8 +1192,6 @@ algorithm
local
DAE.Type tp;
case (DAE.CREF_IDENT(identType=tp),_,_)
guard
not Expression.isArrayType(tp) and not Expression.isRecordType(tp)
then VarTransform.addReplacement(iRepl, iCr, iExp);
else fail();
end match;
Expand Down

0 comments on commit d180efb

Please sign in to comment.