Changeset ab9d3836 in OpenModelica
- Timestamp:
- 2012-11-16T15:55:55+01:00 (11 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- f52e7dca
- Parents:
- 88557076
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/BackEnd/BackendDAEOptimize.mo
r88557076 rab9d3836 2493 2493 aliasVars = List.fold(varlst,fixAliasConstBindings,aliasVars); 2494 2494 (knvars1,_) = BackendVariable.traverseBackendDAEVarsWithUpdate(knvars,replaceVarTraverser,repl); 2495 (inieqns,_) = BackendEquation.traverseBackendDAEEqnsWithUpdate(inieqns,replaceEquationTraverser,repl); 2495 2496 (remeqns1,_) = BackendEquation.traverseBackendDAEEqnsWithUpdate(remeqns,replaceEquationTraverser,repl); 2496 2497 (whenClauseLst1,_) = BackendVarTransform.replaceWhenClauses(whenClauseLst, repl, SOME(BackendVarTransform.skipPreChangeEdgeOperator)); … … 2631 2632 case ((e,repl)) 2632 2633 equation 2633 ({e1},_) = BackendVarTransform.replaceEquations({e},repl, NONE());2634 ({e1},_) = BackendVarTransform.replaceEquations({e},repl,SOME(BackendVarTransform.skipPreChangeEdgeOperator)); 2634 2635 then ((e1,repl)); 2635 2636 end match; 2636 2637 end replaceEquationTraverser; 2637 2638 2639 protected function replaceWhenClauseTraverser "function: replaceWhenClauseTraverser2640 author: Frenkel TUD 2010-042641 It is possible to change the when clause.2642 "2643 input tuple<DAE.Exp,BackendVarTransform.VariableReplacements> inTpl;2644 output tuple<DAE.Exp,BackendVarTransform.VariableReplacements> outTpl;2645 algorithm2646 outTpl:=2647 match (inTpl)2648 local2649 DAE.Exp e,e1;2650 BackendVarTransform.VariableReplacements repl;2651 case ((e,repl))2652 equation2653 (e1,_) = BackendVarTransform.replaceExp(e, repl, NONE());2654 then2655 ((e1,repl));2656 case _ then inTpl;2657 end match;2658 end replaceWhenClauseTraverser;2659 2638 2660 2639 protected function replacementsInEqns2 … … 10187 10166 then 10188 10167 ((e,(knvars,aliasvars,true))); 10168 case((DAE.CALL(path=Absyn.IDENT(name = "pre"),expLst={e as DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"))}),(knvars,aliasvars,_))) 10169 then 10170 ((e,(knvars,aliasvars,true))); 10189 10171 case((e as DAE.CALL(path=Absyn.IDENT(name = "pre"),expLst={DAE.CREF(componentRef=cr,ty=tp)},attr=attr),(knvars,aliasvars,_))) 10190 10172 equation … … 10200 10182 then 10201 10183 ((zero,(knvars,aliasvars,true))); 10184 case((DAE.CALL(path=Absyn.IDENT(name = "change"),expLst={e as DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"))}),(knvars,aliasvars,_))) 10185 then 10186 ((DAE.BCONST(false),(knvars,aliasvars,true))); 10202 10187 case((DAE.CALL(path=Absyn.IDENT(name = "change"),expLst={e as DAE.CREF(componentRef=cr,ty=tp)},attr=attr),(knvars,aliasvars,_))) 10203 10188 equation … … 10213 10198 then 10214 10199 ((zero,(knvars,aliasvars,true))); 10200 case((DAE.CALL(path=Absyn.IDENT(name = "edge"),expLst={e as DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"))}),(knvars,aliasvars,_))) 10201 then 10202 ((DAE.BCONST(false),(knvars,aliasvars,true))); 10215 10203 case((DAE.CALL(path=Absyn.IDENT(name = "edge"),expLst={e as DAE.CREF(componentRef=cr,ty=tp)},attr=attr),(knvars,aliasvars,_))) 10216 10204 equation … … 10239 10227 then 10240 10228 e; 10229 case (DAE.CALL(path=Absyn.IDENT(name = "pre"),expLst={e as DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"))}),_) 10230 then 10231 e; 10241 10232 case(DAE.CALL(path=Absyn.IDENT(name = "change"),expLst={DAE.CREF(componentRef=cr,ty=tp)}),_) 10242 10233 equation … … 10245 10236 then 10246 10237 e; 10238 case (DAE.CALL(path=Absyn.IDENT(name = "change"),expLst={e as DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"))}),_) 10239 then 10240 DAE.BCONST(false); 10247 10241 case(DAE.CALL(path=Absyn.IDENT(name = "edge"),expLst={DAE.CREF(componentRef=cr,ty=tp)}),_) 10248 10242 equation … … 10251 10245 then 10252 10246 e; 10247 case (DAE.CALL(path=Absyn.IDENT(name = "edge"),expLst={e as DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"))}),_) 10248 then 10249 DAE.BCONST(false); 10253 10250 else 10254 10251 then
Note: See TracChangeset
for help on using the changeset viewer.