Skip to content

Commit

Permalink
- Removed another ~1800 local declarations
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7657 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 6, 2011
1 parent e38940c commit b1633d9
Show file tree
Hide file tree
Showing 62 changed files with 73 additions and 1,816 deletions.
38 changes: 8 additions & 30 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -223,21 +223,21 @@ algorithm
match (inElements,functionTree,inVariables,inKnownVariables,inExternalVariables,inEquationLst3,inEquationLst4,inEquationLst5,
inMultiDimEquationLst6,inMultiDimEquationLst7,inAlgorithmAlgorithmLst8,inAlgorithmAlgorithmLst9,inWhenClauseLst10,inExtObjClasses,inStatesBinTree)
local
BackendDAE.Variables v1,v2,v3,vars,knvars,extVars,extVars1,extVars2,vars_1,knvars_1,vars1,vars2,knvars1,knvars2,kv;
list<BackendDAE.WhenClause> whenclauses,whenclauses_1,whenclauses_2;
BackendDAE.Variables vars,knvars,extVars;
list<BackendDAE.WhenClause> whenclauses;
list<BackendDAE.Equation> eqns,reqns,ieqns;
list<BackendDAE.MultiDimEquation> aeqns,iaeqns;
list<DAE.Algorithm> algs,ialgs;
BackendDAE.ExternalObjectClasses extObjCls,extObjCls1,extObjCls2;
BackendDAE.ExternalObjectClasses extObjCls;
BackendDAE.ExternalObjectClass extObjCl;
DAE.Element daeEl;
list<DAE.Element> daeLstRest;
BackendDAE.BinTree states;
BackendDAE.Equation backendEq2;
DAE.Exp c;
list<BackendDAE.Value> ds;
BackendDAE.Value count,count_1;
DAE.Algorithm a,a1,a2;
BackendDAE.Value count;
DAE.Algorithm a;
DAE.DAElist dae;
DAE.ExpType ty;
DAE.ComponentRef cr;
Expand All @@ -251,7 +251,7 @@ algorithm
list<tuple<DAE.Exp,DAE.Exp>> ealst;
BackendDAE.MultiDimEquation backendMultiDimEq;
list<Option<BackendDAE.Equation>> opteqlst;
BackendDAE.Var backendVar,backendVar1,backendVar2;
BackendDAE.Var backendVar;
DAE.Exp cond,msg;
DAE.Algorithm alg;
list<BackendDAE.Equation> backendEqLst;
Expand Down Expand Up @@ -323,7 +323,7 @@ algorithm
list<BackendDAE.Equation> eqns,reqns,ieqns,eqns2,re,eqsComplex;
list<BackendDAE.MultiDimEquation> aeqns,aeqns1,aeqns2,ae,iaeqns,iaeqns1,iaeqns2,iae;
list<DAE.Algorithm> algs,algs1,algs2,al,ialgs,ialgs1,ialgs2;
BackendDAE.ExternalObjectClasses extObjCls,extObjCls1,extObjCls2;
BackendDAE.ExternalObjectClasses extObjCls;
BackendDAE.ExternalObjectClass extObjCl;
DAE.Element daeEl;
list<DAE.Element> daeLstRest;
Expand Down Expand Up @@ -351,7 +351,7 @@ algorithm
list<tuple<DAE.Exp,DAE.Exp>> ealst;
BackendDAE.MultiDimEquation backendMultiDimEq;
list<Option<BackendDAE.Equation>> opteqlst;
BackendDAE.Var backendVar,backendVar1,backendVar2;
BackendDAE.Var backendVar1,backendVar2;
DAE.Exp cond,msg;
DAE.Algorithm alg;
list<BackendDAE.Equation> backendEqLst;
Expand Down Expand Up @@ -1077,7 +1077,6 @@ algorithm
local
DAE.Exp e1,e2,e1_1,e2_1;
DAE.ExpType ty;
list<DAE.ExpVar> varLst;
Integer i;
list<BackendDAE.Equation> complexEqs;
list<BackendDAE.MultiDimEquation> arreqns;
Expand Down Expand Up @@ -1156,8 +1155,6 @@ algorithm
(outEquationLst,outWhenClauseIndex,outWhenClauseLst):=
matchcontinue (inElement,inWhenClauseIndex,inWhenClauseLst)
local
BackendDAE.Variables vars;
BackendDAE.Variables elseVars;
list<BackendDAE.Equation> res, res1;
list<BackendDAE.Equation> trueEqnLst, elseEqnLst;
list<BackendDAE.WhenOperator> reinit;
Expand Down Expand Up @@ -1872,11 +1869,6 @@ algorithm
matchcontinue (inElems,inBinTree)
local
BackendDAE.BinTree bt;
DAE.Exp e2;
list<DAE.Element> xs;
DAE.DAElist dae;
DAE.FunctionTree funcs;
list<DAE.Element> daeElts;

case (inElems,bt)
equation
Expand Down Expand Up @@ -1961,7 +1953,6 @@ algorithm
local
DAE.Exp e, e1, e2, e3;
Integer i;
list<DAE.Exp> l;
Boolean t, b;
DAE.ExpType ty;
DAE.InlineType it;
Expand Down Expand Up @@ -2179,7 +2170,6 @@ algorithm
local
BackendDAE.Variables v,v_1,v_2,knv;
list<DAE.Statement> statementLst,statementLst1;
BackendDAE.Var var;
Boolean b;
DAE.Exp e,ie;
list<DAE.Exp> rest;
Expand Down Expand Up @@ -2310,7 +2300,6 @@ algorithm
list<BackendDAE.Equation> resAlgEqn,resDiffEqn,rest,resArrayEqns;
BackendDAE.Equation eqn,alg;
DAE.Exp exp1,exp2;
list<Boolean> bool_lst;
BackendDAE.Value indx;
list<DAE.Exp> expl;
case ({}) then ({},{},{}); /* algebraic equations differential equations */
Expand Down Expand Up @@ -2369,7 +2358,6 @@ algorithm
outBoolean := match(inExp)
local
Boolean b;
list<Boolean> blst;
case(inExp)
equation
((_,b)) = Expression.traverseExpTopDown(inExp, traversingisAlgebraicFinder, true);
Expand Down Expand Up @@ -2827,8 +2815,6 @@ algorithm
BackendDAE.Variables vars,knvars;
list<DAE.Exp> zeroCrossings;
DAE.Operator op;
DAE.ExpType tp;
Boolean scalar;
case (((e as DAE.CALL(path = Absyn.IDENT(name = "noEvent"))),(zeroCrossings,(vars,knvars))))
then ((e,false,(zeroCrossings,(vars,knvars))));
case (((e as DAE.CALL(path = Absyn.IDENT(name = "sample"))),(zeroCrossings,(vars,knvars))))
Expand Down Expand Up @@ -2870,9 +2856,6 @@ algorithm
list<Integer> li;
DAE.ElementSource source;
Algorithm.Else algElse;
Absyn.Path fnName;
Absyn.MatchType matchType;
DAE.Pattern pattern;

case ({},vars,knvars) then {};

Expand Down Expand Up @@ -3276,7 +3259,6 @@ algorithm
outTuplEqnLst := match(inEqn,inFuncs)
local
DAE.FunctionTree funcs;
BackendDAE.Equation eqn;
DAE.ComponentRef cr1,cr2;
list<DAE.Exp> e1lst,e2lst;
list<DAE.ExpVar> varLst;
Expand Down Expand Up @@ -3345,10 +3327,8 @@ algorithm
outTuplEqnLst := matchcontinue(inExp,Source,inFuncs)
local
DAE.Exp e1,e2,e1_1,e2_1,e2_2;
list<DAE.Exp> e2lst;
DAE.ElementSource source;
DAE.ComponentRef cr1;
list<DAE.ComponentRef> crlst2;
BackendDAE.Equation eqn;
Expression.Type tp;
list<DAE.Dimension> ad;
Expand Down Expand Up @@ -3425,8 +3405,6 @@ Author: Frenkel TUD 2010-12"
algorithm
otpl := matchcontinue itpl
local
DAE.Exp e;
Option<DAE.FunctionTree> funcs;
case (itpl)
equation
// Don't extend array?
Expand Down
27 changes: 2 additions & 25 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -766,7 +766,7 @@ algorithm
matchcontinue (inVars,inEqns,inAlias)
local
BackendDAE.Variables vars,vars1;
BackendDAE.Var var,var1,var2,var3;
BackendDAE.Var var,var2,var3;
DAE.ComponentRef cr;
DAE.Exp e;
BackendDAE.Equation eqn;
Expand Down Expand Up @@ -1393,7 +1393,6 @@ algorithm
match (inV1,inV2,inRLst,inTLst)
local
array<BackendDAE.Value> v1,v2,v1_1,v2_1,v1_2,v2_2;
list<BackendDAE.Value> comp;
list<Integer> rlst,tlst;
Integer r,t;
case (v1,v2,{},{}) then (v1,v2);
Expand Down Expand Up @@ -1580,7 +1579,6 @@ algorithm
DAE.ElementSource source;
DAE.ExpType identType;
list<DAE.Subscript> subscriptLst;
Integer replace1;

case (dlow,dlow1,m,mT,v1,v2,comp,vars,exclude,residualeqn,residualeqns,tearingvars,tearingeqns,crlst)
equation
Expand Down Expand Up @@ -1907,7 +1905,6 @@ algorithm
BackendDAE.VariableArray varr;
list<Boolean> blst,blst_1;
list<list<Boolean>> blstlst;
list<String> s;
case (eqns,{},ass,vars,crlst) then eqns;
case (eqns,e::rest,ass,vars as BackendDAE.VARIABLES(varArr=varr),crlst)
equation
Expand Down Expand Up @@ -1967,7 +1964,6 @@ algorithm
(outJacobian,outV1,outV2,outComps1) :=
matchcontinue (inBackendDAE,functionTree,inComRef1,inComRef2,inAllVar)
local
DAE.DAElist dae;
BackendDAE.BackendDAE dlow;

list<DAE.ComponentRef> eqvars,diffvars;
Expand Down Expand Up @@ -2110,7 +2106,6 @@ algorithm
list<Integer> rest;
list<list<Integer>> vars;
Integer var;
list<Integer> ilst2;
Integer i;
array<Integer> arr,arr1;
list<String> s;
Expand Down Expand Up @@ -2457,19 +2452,14 @@ algorithm
outDerivedEquations := matchcontinue(inEquation, inVars, inFunctions, inInputVars, inParamVars, inStateVars, inAlgorithmsLookUp)
local
BackendDAE.Equation currEquation;
list<DAE.Algorithm> algorithms;
DAE.FunctionTree functions;
DAE.ComponentRef currVar;
list<DAE.ComponentRef> restVars;
Integer algNum;

list<BackendDAE.Var> derivedVariables;
list<BackendDAE.Equation> currDerivedEquations, restDerivedEquations, derivedEquations;
list<DAE.Algorithm> derivedAlgorithms;

list<BackendDAE.Var> inputVars, paramVars, stateVars;
list<tuple<Integer, DAE.ComponentRef>> algorithmsLookUp;
Integer i;
case(_, {}, _, _, _, _, _) then {};

case(currEquation, currVar::restVars, functions, inputVars, paramVars, stateVars, algorithmsLookUp) equation
Expand Down Expand Up @@ -2500,21 +2490,16 @@ algorithm
outDerivedEquations := matchcontinue(inEquation, inVar, inFunctions, inInputVars, inParamVars, inStateVars, inAlgorithmsLookUp)
local
BackendDAE.Equation currEquation;
list<DAE.Algorithm> algorithms;
DAE.FunctionTree functions;
DAE.ComponentRef var, cref, cref_;

BackendDAE.Var currDerivedVariable;
BackendDAE.Equation currDerivedEquation;
DAE.Algorithm currDerivedAlgorithm;

DAE.Exp lhs, rhs, lhs_, rhs_, exp, exp_;
DAE.ElementSource source;

list<BackendDAE.Var> inputVars, paramVars, stateVars;
Integer index;
list<DAE.Exp> in_, derivedIn_,out, derivedOut;
DAE.Algorithm derivedAlgorithm;
list<tuple<Integer, DAE.ComponentRef>> algorithmsLookUp;
Integer newAlgIndex;
case(currEquation as BackendDAE.EQUATION(exp=lhs, scalar=rhs, source=source), var, functions, inputVars, paramVars, stateVars, _) equation
Expand Down Expand Up @@ -2570,8 +2555,6 @@ algorithm
local
DAE.ComponentRef cref, x;
String id,str;
DAE.ExpType idType;
list<DAE.Subscript> sLst;
list<BackendDAE.Var> stateVars;
BackendDAE.Var v1;

Expand Down Expand Up @@ -2623,7 +2606,6 @@ algorithm
DAE.Operator op;


list<DAE.ComponentRef> diff_crefs;
Absyn.Path fname,derFname;

list<DAE.Exp> expList1, expList2;
Expand Down Expand Up @@ -2913,7 +2895,6 @@ algorithm
Integer i,nArgs;
DAE.derivativeCond cond;
Boolean res;
DAE.Exp e1;
case ({},_) then true;
case((i,cond)::rest,nArgs)
equation
Expand Down Expand Up @@ -2942,12 +2923,11 @@ protected function partialAnalyticalDifferentiation
algorithm
outExp := match(varExpList, derVarExpList, functionCall, derFname, nDerArgs)
local
DAE.Exp e, currVar, currDerVar, derFun, absCurr;
DAE.Exp e, currVar, currDerVar, derFun;
list<DAE.Exp> restVar, restDerVar, varExpList1Added, varExpListTotal;
DAE.ExpType et;
Boolean tuple_, builtin;
DAE.InlineType inlineType;
DAE.FunctionTree functions;
Integer nArgs1, nArgs2;
case ( _, {}, _, _, _) then (DAE.RCONST(0.0));
case (currVar::restVar, currDerVar::restDerVar, functionCall as DAE.CALL(expLst=varExpListTotal, tuple_=tuple_, builtin=builtin, ty=et, inlineType=inlineType), derFname, nDerArgs)
Expand Down Expand Up @@ -2977,7 +2957,6 @@ algorithm
Absyn.Path fname;
Boolean tuple_, builtin;
DAE.InlineType inlineType;
DAE.FunctionTree functions;
Integer nArgs1, nArgs2;
case ({}, _, _, _) then (DAE.RCONST(0.0));
case (currVar::restVar, currDerVar::restDerVar, inState, functionCall as DAE.CALL(path=fname, expLst=varExpListTotal, tuple_=tuple_, builtin=builtin, ty=et, inlineType=inlineType))
Expand Down Expand Up @@ -3158,7 +3137,6 @@ algorithm
list<tuple<String,Integer>> erg;
list<DAE.ComponentRef> rest, states;
DAE.ComponentRef curr;
Boolean searchForStates;
Integer actInd;
list<BackendDAE.Var> allVars;

Expand Down Expand Up @@ -3240,7 +3218,6 @@ algorithm
String currVar;
Integer currInd;
BackendDAE.BinTree bt;
list<Integer> varInt;
case (curr as BackendDAE.VAR(varName=currCREF),(currVar,currInd)::restTuple,bt) equation
true = stringEqual(currVar,ComponentReference.printComponentRefStr(currCREF));
changedVar = BackendVariable.setVarIndex(curr,currInd);
Expand Down
7 changes: 0 additions & 7 deletions Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -1298,7 +1298,6 @@ algorithm
array<DAE.Algorithm> al;
BackendDAE.EventInfo wc;
BackendDAE.ExternalObjectClasses eoc;
BackendDAE.BackendDAE daelow_1;

case (BackendDAE.DAE(vars,kv,ev,av,e,se,ie,ae,al,wc,eoc),cr)
equation
Expand Down Expand Up @@ -1653,7 +1652,6 @@ algorithm
list<BackendDAE.WhenOperator> reinitStmtLst,reinitStmtLst1;
DAE.Exp cond,cond1;
list<BackendDAE.WhenClause> wclst,wclst1,wclst2;
list<Integer> dimSize;
Type_a ext_arg_1,ext_arg_2,ext_arg_3;

case (NONE(),wclst,func,inTypeA) then (wclst,inTypeA);
Expand Down Expand Up @@ -2131,7 +2129,6 @@ algorithm
outTpl := matchcontinue(inTpl)
local
DAE.ComponentRef cr,cr2;
DAE.Ident id2;
BackendDAE.Var v;
Integer i;
case((v,(cr,i)))
Expand All @@ -2153,7 +2150,6 @@ protected function varStateSelectHeuristicPrio2
algorithm
prio := matchcontinue(cr,vars)
local
list<BackendDAE.Var> sameCompVarLst;
case(cr,vars)
equation
((_,true)) = BackendVariable.traverseBackendDAEVars(vars,varInSameComponent,(cr,false));
Expand Down Expand Up @@ -2222,7 +2218,6 @@ algorithm
DAE.ComponentRef cr2;
list<DAE.ComponentRef> crs;
list<list<BackendDAE.Var>> crVars;
list<Boolean> blst;
DAE.Exp e2;

// s = expr(s1,..,sn) where s1 .. sn are states
Expand Down Expand Up @@ -2355,7 +2350,6 @@ algorithm
list<BackendDAE.Key> res1,res11,res1_1;
list<BackendDAE.Value> res2,vars2,res22,res2_1,rest;
BackendDAE.Value e;
BackendDAE.Equation eqn;
BackendDAE.Variables vars;
BackendDAE.EquationArray eqns;
array<list<BackendDAE.Value>> m,mt;
Expand Down Expand Up @@ -2468,7 +2462,6 @@ algorithm
array<list<BackendDAE.Value>> m,mt;
BackendDAE.Value nv,nf,e_1,leneqns,e;
BackendDAE.Equation eqn,eqn_1;
String str;
BackendDAE.EquationArray eqns_1,eqns,seqns,ie;
list<BackendDAE.Value> reqns,es;
BackendDAE.Variables v,kv,ev;
Expand Down

0 comments on commit b1633d9

Please sign in to comment.