Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Code cleanup


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13053 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 26, 2012
1 parent 3c1063d commit 224d629
Show file tree
Hide file tree
Showing 50 changed files with 243 additions and 243 deletions.
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendDAECreate.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ algorithm
tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>,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";

case ({},_,extraArg,knvars) then (({},extraArg));
case ({},_,extraArg,_) then (({},extraArg));

case ((DAE.STMT_ASSIGN(type_ = tp,exp1 = e2,exp = e, source = source) :: xs),_, extraArg, _)
equation
Expand Down Expand Up @@ -2772,7 +2772,7 @@ algorithm
Algorithm.Else el,el_1;
tuple<DAE.Exp, list<DAE.Exp>, DAE.Exp, tuple<list<BackendDAE.ZeroCrossing>,Integer>, tuple<Integer,BackendDAE.Variables,BackendDAE.Variables>> extraArg;

case(DAE.NOELSE(),_,extraArg,knvars) then ((DAE.NOELSE(),extraArg));
case(DAE.NOELSE(),_,extraArg,_) then ((DAE.NOELSE(),extraArg));
case(DAE.ELSEIF(e,st,el),_,extraArg,_)
equation
((el_1,extraArg)) = traverseStmtsElseExps(el,func,extraArg,knvars);
Expand Down Expand Up @@ -2879,7 +2879,7 @@ algorithm
DAE.Operator op;
list<DAE.Exp> rest,res2;
Integer index;
case (_,_,{},inIndex) then ({},inIndex);
case (_,_,{},_) then ({},inIndex);
case (exp as DAE.RELATION(exp1 = e1,operator = op,exp2 = e2),i,e::rest,index)
equation
e_1 = DAE.RELATION(e1,op,e2,index,NONE());
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,7 @@ algorithm
list<Integer> rest,eqns,eqns1,alleqns;
Integer pos;

case({},inM,_,_,_,inTypeA) then (inM,inTypeA);
case({},inM,_,_,_,_) then (inM,inTypeA);

case(pos::rest,_,_,_,_,_) equation
// do not leave the list
Expand Down Expand Up @@ -2806,7 +2806,7 @@ algorithm
var = BackendVariable.setBindValue(inVar,value);
var = BackendVariable.setVarStartValue(var,inExp);
then (var,true);
case(_,inVar) then (inVar,false);
case(_,_) then (inVar,false);
end matchcontinue;
end setbindValue;

Expand Down Expand Up @@ -8854,7 +8854,7 @@ protected function mergeIf
output DAE.Exp outExp;
algorithm
outExp := match(inExp1,inExp2,inOrgExp1)
case (_,inExp2,inOrgExp1) then DAE.IFEXP(inOrgExp1, inExp1, inExp2);
case (_,inExp2,_) then DAE.IFEXP(inOrgExp1, inExp1, inExp2);
end match;
end mergeIf;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendDAETransform.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3304,7 +3304,7 @@ algorithm
DAE.ElementSource source;
Type_a ext_arg_1,ext_arg_2;

case ({},func,inTypeA) then ({},inTypeA);
case ({},func,_) then ({},inTypeA);

case (BackendDAE.REINIT(stateVar=cr,value=cond,source=source)::res,_,_)
equation
Expand Down Expand Up @@ -3356,7 +3356,7 @@ algorithm
list<BackendDAE.WhenClause> wclst,wclst1;
Type_a ext_arg_1,ext_arg_2,ext_arg_3;

case ({},func,inTypeA) then ({},inTypeA);
case ({},func,_) then ({},inTypeA);

case (BackendDAE.WHEN_CLAUSE(cond,reinitStmtLst,elsindx)::wclst,_,_)
equation
Expand Down Expand Up @@ -3902,7 +3902,7 @@ algorithm
equation
((_,true)) = BackendVariable.traverseBackendDAEVars(vars,varInSameComponent,(cr,false));
then -1.0;
case (_,vars) then 0.0;
case (_,_) then 0.0;
end matchcontinue;
end varStateSelectHeuristicPrio2;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendDAEUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,7 @@ algorithm
(statementLst,_) = DAEUtil.traverseDAEEquationsStmts(statementLst, collateArrExp, infuncs);
then
DAE.ALGORITHM_STMTS(statementLst);
case (_,infuncs) then inAlg;
case (_,_) then inAlg;
end matchcontinue;
end collateAlgorithm;

Expand Down Expand Up @@ -4462,7 +4462,7 @@ algorithm
oldvars = m[pos];
then
oldvars;
case (_,pos) then {};
case (_,_) then {};
end matchcontinue;
end getOldVars;

Expand Down Expand Up @@ -8737,7 +8737,7 @@ algorithm
BackendDAE.Variables vars;
EquationArray eqs;
Option<BackendDAE.IncidenceMatrix> m,mT;
case (BackendDAE.EQSYSTEM(vars,eqs,m,mT,_),matching) then BackendDAE.EQSYSTEM(vars,eqs,m,mT,matching);
case (BackendDAE.EQSYSTEM(vars,eqs,m,mT,_),_) then BackendDAE.EQSYSTEM(vars,eqs,m,mT,matching);
end match;
end setEqSystemMatching;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ algorithm
list<list<Integer>> rest;
list<Integer> elem;
String sparsepatternStr;
case({},inInteger) then ();
case({},_) then ();
case(elem::rest,_)
equation
sparsepatternStr = List.toString(elem, intString,"Row[" +& intString(inInteger) +& "] = ","{",";","}",true);
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendEquation.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ algorithm
local
BackendDAE.Equation eqn;
Type_a ext_arg;
case (NONE(),func,inTypeA) then inTypeA;
case (NONE(),func,_) then inTypeA;
case (SOME(eqn),_,_)
equation
((_,ext_arg)) = func((eqn,inTypeA));
Expand Down Expand Up @@ -1130,7 +1130,7 @@ algorithm
BackendDAE.Equation eqn;
Type_a ext_arg;
Boolean b;
case (NONE(),func,inTypeA) then (true,inTypeA);
case (NONE(),func,_) then (true,inTypeA);
case (SOME(eqn),_,_)
equation
((_,b,ext_arg)) = func((eqn,inTypeA));
Expand Down Expand Up @@ -1197,7 +1197,7 @@ algorithm
Option<BackendDAE.Equation> oeqn;
BackendDAE.Equation eqn,eqn1;
Type_a ext_arg;
case (oeqn as NONE(),func,inTypeA) then (oeqn,inTypeA);
case (oeqn as NONE(),func,_) then (oeqn,inTypeA);
case (oeqn as SOME(eqn),_,_)
equation
((eqn1,ext_arg)) = func((eqn,inTypeA));
Expand Down
8 changes: 4 additions & 4 deletions Compiler/BackEnd/BackendQSS.mo
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ indexs:=
Integer p;
list<list<Integer>> acc_1;

case (_,{},acc) then acc;
case (_,{},_) then acc;
case (_,((SimCode.SES_SIMPLE_ASSIGN(cref=cref))::tail),_)
equation
/*
Expand Down Expand Up @@ -667,7 +667,7 @@ algorithm
local DAE.Exp e1;
list<DAE.Exp> tail;
list<DAE.ComponentRef> l;
case ({},acc) then acc;
case ({},_) then acc;
case (e1 :: tail ,_)
equation
((_,l)) = Expression.traverseExp(e1,getExpCrefs,{});
Expand Down Expand Up @@ -951,8 +951,8 @@ algorithm
list<BackendDAE.Equation> tail;
String s;
case ({},_) then {};
case (BackendDAE.EQUATION(exp=DAE.CREF(ty = DAE.T_BOOL(_,_))) :: tail,zc) then newDiscreteVariables(tail,zc);
case (BackendDAE.EQUATION(exp=DAE.CREF(ty = DAE.T_INTEGER(_,_))) :: tail,zc) then newDiscreteVariables(tail,zc);
case (BackendDAE.EQUATION(exp=DAE.CREF(ty = DAE.T_BOOL(_,_))) :: tail,_) then newDiscreteVariables(tail,zc);
case (BackendDAE.EQUATION(exp=DAE.CREF(ty = DAE.T_INTEGER(_,_))) :: tail,_) then newDiscreteVariables(tail,zc);
case ( _ :: tail,_)
equation
print("Found one discontinuous equation\n");
Expand Down
4 changes: 2 additions & 2 deletions Compiler/BackEnd/BackendVarTransform.mo
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ TODO: find out why array residual functions containing arrays as xloc[] does not
output DAE.Exp outExp;
algorithm outExp := matchcontinue(inExp,inType)
local DAE.ComponentRef cr;
case(DAE.CREF(cr,DAE.T_UNKNOWN(source = _)),inType) then Expression.makeCrefExp(cr,inType);
case(DAE.CREF(cr,DAE.T_UNKNOWN(source = _)),_) then Expression.makeCrefExp(cr,inType);
case (_,_) then inExp;
end matchcontinue;
end avoidDoubleHashLookup;
Expand Down Expand Up @@ -875,7 +875,7 @@ algorithm
Boolean c1,c2;
list<DAE.Subscript> subs;

case ({}, repl, cond) then ({},false);
case ({}, repl,_) then ({},false);
case (DAE.WHOLEDIM()::subs, _, _)
equation
(subs,c1) = replaceCrefSubs2(subs,repl,cond);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendVariable.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3138,7 +3138,7 @@ algorithm
Option<BackendDAE.Var> ovar;
BackendDAE.Var v,v1;
Type_a ext_arg;
case (ovar as NONE(),func,inTypeA) then (ovar,inTypeA);
case (ovar as NONE(),func,_) then (ovar,inTypeA);
case (ovar as SOME(v),_,_)
equation
((v1,ext_arg)) = func((v,inTypeA));
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/Derive.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ algorithm
list<tuple<Integer,DAE.derivativeCond>> crlst;

// no conditions
case (_,{},expl,inVarsandFuncs) then inblst;
case (_,{},expl,_) then inblst;

// zeroDerivative
case(_,(i,DAE.ZERO_DERIVATIVE())::crlst,_,_)
Expand Down
16 changes: 8 additions & 8 deletions Compiler/BackEnd/SimCodeUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7834,10 +7834,10 @@ algorithm
DAE.ComponentRef name;
Absyn.Path fname;

case (DAE.CREF(componentRef=name),inVar) then SimCode.ALIAS(name);
case (DAE.UNARY(operator=DAE.UMINUS(_),exp=DAE.CREF(componentRef=name)),inVar) then SimCode.NEGATEDALIAS(name);
case (DAE.UNARY(operator=DAE.UMINUS_ARR(_),exp=DAE.CREF(componentRef=name)),inVar) then SimCode.NEGATEDALIAS(name);
case (DAE.LUNARY(operator=DAE.NOT(_),exp=DAE.CREF(componentRef=name)),inVar) then SimCode.NEGATEDALIAS(name);
case (DAE.CREF(componentRef=name),_) then SimCode.ALIAS(name);
case (DAE.UNARY(operator=DAE.UMINUS(_),exp=DAE.CREF(componentRef=name)),_) then SimCode.NEGATEDALIAS(name);
case (DAE.UNARY(operator=DAE.UMINUS_ARR(_),exp=DAE.CREF(componentRef=name)),_) then SimCode.NEGATEDALIAS(name);
case (DAE.LUNARY(operator=DAE.NOT(_),exp=DAE.CREF(componentRef=name)),_) then SimCode.NEGATEDALIAS(name);
case (DAE.CALL(path=fname, expLst={DAE.CREF(componentRef=name)}),_)
equation
Builtin.isDer(fname);
Expand Down Expand Up @@ -8605,7 +8605,7 @@ algorithm
(e22,rhs);

// not succeded to solve, return unsolved equation., catched later.
case (_,e1,e2) then (e1,e2);
case (_,e1,_) then (e1,e2);
end matchcontinue;
end solveTrivialArrayEquation;

Expand Down Expand Up @@ -8809,7 +8809,7 @@ algorithm
Absyn.Path path;
HashTableStringToPath.HashTable ht;

case ({},ht,funcs) then ht;
case ({},ht,_) then ht;
case (path::rest,ht,_)
equation
ht = getCalledFunctionsInFunction2(path, Absyn.pathStringNoQual(path), ht, funcs);
Expand Down Expand Up @@ -12633,7 +12633,7 @@ algorithm
A a;
list<list<SimCode.SimEqSystem>> eqs;

case ({},_,a,acc) then (listReverse(acc),a);
case ({},_,a,_) then (listReverse(acc),a);
case (eq::eqs,_,a,_)
equation
(eq,a) = traverseExpsEqSystems(eq,func,a,{});
Expand Down Expand Up @@ -12661,7 +12661,7 @@ algorithm
A a;
list<SimCode.SimEqSystem> eqs;

case ({},_,a,acc) then (listReverse(acc),a);
case ({},_,a,_) then (listReverse(acc),a);
case (eq::eqs,_,a,_)
equation
(eq,a) = traverseExpsEqSystem(eq,func,a);
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/Uncertainties.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ algorithm
Option<DAE.Exp> bindExp;
list<BackendDAE.Var> varLst;

case({},repl,func,replaceName) then {};
case({},repl,func,_) then {};
case(v::varLst,_,_,replaceName as true) equation
cr = BackendVariable.varCref(v);
bindExp = varBindingOpt(v);
Expand Down Expand Up @@ -1630,7 +1630,7 @@ algorithm
Option<DAE.VariableAttributes> attr;
Option<SCode.Comment> cmt;
DAE.ConnectorType ct;
case (BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,cmt,ct),cr) then
case (BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,cmt,ct),_) then
BackendDAE.VAR(cr,kind,dir,prl,tp,bind,bindval,ad,source,attr,cmt,ct);
end match;
end setVarCref;
Expand Down Expand Up @@ -1658,7 +1658,7 @@ algorithm
Option<DAE.VariableAttributes> attr;
Option<SCode.Comment> cmt;
DAE.ConnectorType ct;
case (BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,cmt,ct),bindExp) then
case (BackendDAE.VAR(name,kind,dir,prl,tp,bind,bindval,ad,source,attr,cmt,ct),_) then
BackendDAE.VAR(name,kind,dir,prl,tp,bindExp,bindval,ad,source,attr,cmt,ct);
end match;
end setVarBindingOpt;
Expand Down
20 changes: 10 additions & 10 deletions Compiler/FrontEnd/Absyn.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3394,10 +3394,10 @@ algorithm
list<list<ComponentRef>> lstres1;
list<list<ComponentRef>> crefll;

case (INTEGER(value = _),checkSubs) then {};
case (REAL(value = _),checkSubs) then {};
case (STRING(value = _),checkSubs) then {};
case (BOOL(value = _),checkSubs) then {};
case (INTEGER(value = _),_) then {};
case (REAL(value = _),_) then {};
case (STRING(value = _),_) then {};
case (BOOL(value = _),_) then {};
case (CREF(componentRef = ALLWILD()),_) then {};
case (CREF(componentRef = WILD()),_) then {};
case (CREF(componentRef = CREF_INVALID(componentRef = _)), _) then {};
Expand Down Expand Up @@ -3486,7 +3486,7 @@ algorithm
res = listAppend(l1, l2);
then
res;
case (END(),checkSubs) then {};
case (END(),_) then {};

case (TUPLE(expressions = expl),_)
equation
Expand All @@ -3497,7 +3497,7 @@ algorithm

case (CODE(_),_) then {};

case (AS(exp = e1),checkSubs) then getCrefFromExp(e1,checkSubs);
case (AS(exp = e1),_) then getCrefFromExp(e1,checkSubs);
case (CONS(e1,e2),_)
equation
l1 = getCrefFromExp(e1,checkSubs);
Expand All @@ -3513,7 +3513,7 @@ algorithm
then
res;

case (MATCHEXP(matchTy = _),checkSubs) then fail();
case (MATCHEXP(matchTy = _),_) then fail();

case (e1,_)
equation
Expand Down Expand Up @@ -5358,8 +5358,8 @@ algorithm
outPath := match (within_,path)
local
Path path1;
case (TOP(),path) then path;
case (WITHIN(path1),path) then joinPaths(path1,path);
case (TOP(),_) then path;
case (WITHIN(path1),_) then joinPaths(path1,path);
end match;
end joinWithinPath;

Expand Down Expand Up @@ -5647,7 +5647,7 @@ algorithm
equation
elts1 = List.filter(elts1,filterAnnotationItem);
then listAppend(elts1,elts2);
case (_,elts) then elts;
case (_,_) then elts;
end match;
end getFunctionInterfaceParts;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/FrontEnd/AbsynDep.mo
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ algorithm
Option<AvlTreeValue> value;
Option<AvlTree> l,r;
Integer height;
case(AVLTREENODE(value,height,l,r),right) then AVLTREENODE(value,height,l,right);
case(AVLTREENODE(value,height,l,r),_) then AVLTREENODE(value,height,l,right);
end match;
end setRight;

Expand All @@ -573,7 +573,7 @@ algorithm
Option<AvlTreeValue> value;
Option<AvlTree> l,r;
Integer height;
case(AVLTREENODE(value,height,l,r),left) then AVLTREENODE(value,height,left,r);
case(AVLTREENODE(value,height,l,r),_) then AVLTREENODE(value,height,left,r);
end match;
end setLeft;

Expand Down Expand Up @@ -680,7 +680,7 @@ algorithm
case(_,_) equation
val = avlTreeGet(tree,key);
then val;
case (_,key) then {};
case (_,_) then {};
end matchcontinue;
end avlTreeGetOrEmpty;

Expand Down

0 comments on commit 224d629

Please sign in to comment.