Skip to content

Commit

Permalink
Some refactoring to break dependencies
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16744 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 6, 2013
1 parent f27058c commit 2739ef3
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 197 deletions.
8 changes: 4 additions & 4 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -4562,7 +4562,7 @@ algorithm
Boolean b1;
String id1, str;
DAE.ElementSource source;
Algorithm.Else algElse;
DAE.Else algElse;
tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>> extraArg;
list<tuple<DAE.ComponentRef, Absyn.Info>> loopPrlVars "list of parallel variables used/referenced in the parfor loop";
list<DAE.ComponentRef> conditions;
Expand Down Expand Up @@ -4720,11 +4720,11 @@ author: BZ, 2008-12
Helper function for traverseStmtsExps
to find ZeroCrosssings in algorithm Else statements
modified: 2011-01 by wbraun"
input Algorithm.Else inElse;
input DAE.Else inElse;
input FuncExpType func;
input tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>> iextraArg;
input BackendDAE.Variables knvars;
output tuple<Algorithm.Else, tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>>> outTplStmtTypeA;
output tuple<DAE.Else, tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>>> outTplStmtTypeA;
partial function FuncExpType
input tuple<DAE.Exp, tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>>> arg;
output tuple<DAE.Exp, Boolean, tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>>> oarg;
Expand All @@ -4734,7 +4734,7 @@ algorithm
local
DAE.Exp e, e_1;
list<DAE.Statement> st, st_1;
Algorithm.Else el, el_1;
DAE.Else el, el_1;
tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, list<BackendDAE.ZeroCrossing>, Integer, Integer>, tuple<Integer, BackendDAE.Variables, BackendDAE.Variables>> extraArg;

case(DAE.NOELSE(), _, extraArg, _) then ((DAE.NOELSE(), extraArg));
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -4345,7 +4345,7 @@ algorithm
DAE.Statement x,ew;
Boolean b1;
String id1,str;
Algorithm.Else algElse;
DAE.Else algElse;
Type_a extraArg;

case ({},_,extraArg) then extraArg;
Expand Down Expand Up @@ -4489,7 +4489,7 @@ protected function traverseStmtsElse "
Author: Frenkel TUD 2012-06
Helper function for traverseStmts
"
input Algorithm.Else inElse;
input DAE.Else inElse;
input FuncExpType func;
input Type_a iextraArg;
output Type_a oextraArg;
Expand All @@ -4503,7 +4503,7 @@ algorithm
local
DAE.Exp e;
list<DAE.Statement> st;
Algorithm.Else el;
DAE.Else el;
Type_a extraArg;
case (DAE.NOELSE(),_,extraArg) then extraArg;
case (DAE.ELSEIF(e,st,el),_,extraArg)
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDump.mo
Expand Up @@ -2087,7 +2087,7 @@ public function dumpAlgorithms "Help function to dump, prints algorithms to stdo
algorithm
_ := match(ialgs,indx)
local
list<Algorithm.Statement> stmts;
list<DAE.Statement> stmts;
IOStream.IOStream myStream;
String is;
list<DAE.Algorithm> algs;
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/DAEQuery.mo
Expand Up @@ -549,7 +549,7 @@ end incidenceRow;
// author: PA
// Helper function to incidenceRow, investigates statements for
// variables, returning variable indexes."
// input list<Algorithm.Statement> inAlgorithmStatementLst;
// input list<DAE.Statement> inAlgorithmStatementLst;
// input BackendDAE.Variables inVariables;
// output list<String> outStringLst;
// algorithm
Expand All @@ -559,10 +559,10 @@ end incidenceRow;
// DAE.Type tp;
// DAE.ComponentRef cr;
// DAE.Exp e, e1;
// list<Algorithm.Statement> rest,stmts;
// list<DAE.Statement> rest,stmts;
// BackendDAE.Variables vars;
// list<DAE.Exp> expl;
// Algorithm.Else else_;
// DAE.Else else_;
// list<list<String>> lstlst;
//
// case ({},_) then {};
Expand Down
4 changes: 2 additions & 2 deletions Compiler/BackEnd/SimCode.mo
Expand Up @@ -381,10 +381,10 @@ uniontype Variable
end FUNCTION_PTR;
end Variable;

// TODO: Replace Statement with just list<Algorithm.Statement>?
// TODO: Replace Statement with just list<DAE.Statement>?
uniontype Statement
record ALGORITHM
list<Algorithm.Statement> statementLst; // in functions
list<DAE.Statement> statementLst; // in functions
end ALGORITHM;
end Statement;

Expand Down
8 changes: 4 additions & 4 deletions Compiler/BackEnd/SimCodeUtil.mo
Expand Up @@ -1088,7 +1088,7 @@ algorithm
(outStatement):=
matchcontinue (inElement)
local
list<Algorithm.Statement> stmts;
list<DAE.Statement> stmts;
case (DAE.ALGORITHM(algorithm_ = DAE.ALGORITHM_STMTS(statementLst = stmts)))
then
SimCode.ALGORITHM(stmts);
Expand Down Expand Up @@ -5428,7 +5428,7 @@ algorithm
Types.Type ft;
list<String> rt, rt_1, rt_2;
list<SimCode.RecordDeclaration> accRecDecls;
Algorithm.Algorithm algorithm_;
DAE.Algorithm algorithm_;
list<DAE.Exp> expl;

case ({}, accRecDecls, rt) then (accRecDecls, rt);
Expand Down Expand Up @@ -6337,7 +6337,7 @@ protected function createSingleAlgorithmCode
algorithm
(equations_, ouniqueEqIndex) := matchcontinue (eqns, vars, skipDiscinAlgorithm, iuniqueEqIndex)
local
Algorithm.Algorithm alg;
DAE.Algorithm alg;
list<Expression.ComponentRef> solvedVars, algOutVars;
String message, algStr;
list<DAE.Statement> algStatements;
Expand Down Expand Up @@ -6647,7 +6647,7 @@ algorithm
local
DAE.ComponentRef cr;
DAE.Exp exp_;
Algorithm.Algorithm alg;
DAE.Algorithm alg;
list<DAE.Statement> algStatements;
DAE.ElementSource source;

Expand Down

0 comments on commit 2739ef3

Please sign in to comment.