Skip to content

Commit

Permalink
- bugfix Backend expandDerExp
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7451 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Dec 17, 2010
1 parent 2d85a2c commit f75b9c0
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -2359,8 +2359,8 @@ algorithm
(outEqns, outIeqns,outAeqns,outAlgs,outVars) :=
matchcontinue(vars,eqns,ieqns,aeqns,algs,functions)
case(vars,eqns,ieqns,aeqns,algs,functions) equation
(eqns,(vars,_)) = BackendEquation.traverseBackendDAEExpsEqnList(eqns,expandDerExp,(vars,functions));
(ieqns,(vars,_)) = BackendEquation.traverseBackendDAEExpsEqnList(ieqns,expandDerExp,(vars,functions));
(eqns,(vars,_)) = BackendEquation.traverseBackendDAEExpsEqnList(eqns,traverserexpandDerExp,(vars,functions));
(ieqns,(vars,_)) = BackendEquation.traverseBackendDAEExpsEqnList(ieqns,traverserexpandDerExp,(vars,functions));
(aeqns,(vars,_)) = expandDerOperatorArrEqns(aeqns,(vars,functions));
(algs,(vars,_)) = expandDerOperatorAlgs(algs,(vars,functions));
then(eqns,ieqns,aeqns,algs,vars);
Expand Down Expand Up @@ -2399,7 +2399,7 @@ algorithm
(outAlg,outVars) := matchcontinue(alg,vars)
local list<Algorithm.Statement> stmts;
case(DAE.ALGORITHM_STMTS(stmts),vars) equation
(stmts,vars) = DAEUtil.traverseDAEEquationsStmts(stmts,expandDerExp,vars);
(stmts,vars) = DAEUtil.traverseDAEEquationsStmts(stmts,traverserexpandDerExp,vars);
then (DAE.ALGORITHM_STMTS(stmts),vars);
end matchcontinue;
end expandDerOperatorAlg;
Expand Down Expand Up @@ -2438,12 +2438,28 @@ algorithm
DAE.ElementSource source "the element source";

case(BackendDAE.MULTIDIM_EQUATION(dims,e1,e2,source),vars) equation
((e1,vars)) = Expression.traverseExp(e1,expandDerExp,vars);
((e2,vars)) = Expression.traverseExp(e2,expandDerExp,vars);
((e1,vars)) = traverserexpandDerExp((e1,vars));
((e2,vars)) = traverserexpandDerExp((e2,vars));
then (BackendDAE.MULTIDIM_EQUATION(dims,e1,e2,source),vars);
end matchcontinue;
end expandDerOperatorArrEqn;

protected function traverserexpandDerExp
"Help function to e.g. traverserexpandDerExp"
input tuple<DAE.Exp,tuple<BackendDAE.Variables,DAE.FunctionTree>> tpl;
output tuple<DAE.Exp,tuple<BackendDAE.Variables,DAE.FunctionTree>> outTpl;
algorithm
outTpl := matchcontinue(tpl)
local
DAE.Exp e,e1;
tuple<BackendDAE.Variables,DAE.FunctionTree> ext_arg, ext_art1;
case((e,ext_arg)) equation
((e1,ext_art1)) = Expression.traverseExp(e,expandDerExp,ext_arg);
then ((e1,ext_art1));
case tpl then tpl;
end matchcontinue;
end traverserexpandDerExp;

protected function expandDerExp
"Help function to e.g. expandDerOperatorEqn"
input tuple<DAE.Exp,tuple<BackendDAE.Variables,DAE.FunctionTree>> tpl;
Expand Down

0 comments on commit f75b9c0

Please sign in to comment.