Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Some code clean-up


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13054 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 26, 2012
1 parent 224d629 commit 54713e4
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ algorithm
e_1 = negateif(negate,e);
var1 = BackendVariable.setVarNominalValue(var,e_1);
then var1;
case(_,inVar,_) then inVar;
case(_,_,_) then inVar;
end matchcontinue;
end mergeNomnialAttribute;

Expand Down Expand Up @@ -2436,7 +2436,7 @@ algorithm
minMax = mergeMinMax(negate,ominmax,ominmax1,cr,cr1);
var1 = BackendVariable.setVarMinMax(var,minMax);
then var1;
case(_,inVar,_) then inVar;
case(_,_,_) then inVar;
end matchcontinue;
end mergeMinMaxAttribute;

Expand Down Expand Up @@ -6747,7 +6747,7 @@ algorithm
list<Integer> oneElem;
list<list<Integer>> rest;
array<list<Integer>> accumList;
case ({}, inAccumList, _) then inAccumList;
case ({},_,_) then inAccumList;
case (oneElem::rest, _, _)
equation
accumList = transposeSparsePattern2(oneElem, inAccumList, inValue);
Expand Down Expand Up @@ -8854,7 +8854,7 @@ protected function mergeIf
output DAE.Exp outExp;
algorithm
outExp := match(inExp1,inExp2,inOrgExp1)
case (_,inExp2,_) then DAE.IFEXP(inOrgExp1, inExp1, inExp2);
case (_,_,_) then DAE.IFEXP(inOrgExp1, inExp1, inExp2);
end match;
end mergeIf;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendVarTransform.mo
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ algorithm
repl_1 = makeTransitive12(lst,repl,singleRepl,inFuncTypeExpExpToBooleanOption);
then
(repl_1,src,dst);
case (_,src,dst,_) then (repl,src,dst);
case (_,_,dst,_) then (repl,src,dst);
end matchcontinue;
end makeTransitive1;

Expand Down Expand Up @@ -401,7 +401,7 @@ algorithm
then
(repl,src,dst_1);
// replace Exp failed, keep old rule.
case (_,src,dst,_) then (repl,src,dst); /* dst has no own replacement, return */
case (_,_,dst,_) then (repl,src,dst); /* dst has no own replacement, return */
end matchcontinue;
end makeTransitive2;

Expand Down Expand Up @@ -875,7 +875,7 @@ algorithm
Boolean c1,c2;
list<DAE.Subscript> subs;

case ({}, repl,_) then ({},false);
case ({},_,_) then ({},false);
case (DAE.WHOLEDIM()::subs, _, _)
equation
(subs,c1) = replaceCrefSubs2(subs,repl,cond);
Expand Down
14 changes: 7 additions & 7 deletions Compiler/BackEnd/SimCodeUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ algorithm
Integer r,c;
DAE.ComponentRef cr;
case({}, _,_,_) then true;
case({} :: restRows, inCref, rowIndex,_) then isMatrixExpansion(restRows, inCref, rowIndex+1, 1);
case({} :: restRows, inCref,_,_) then isMatrixExpansion(restRows, inCref, rowIndex+1, 1);
case ( (DAE.CREF(componentRef=cr) :: restElems) :: restRows, _, _, _)
equation
{ DAE.INDEX(DAE.ICONST(r)), DAE.INDEX(DAE.ICONST(c)) } = ComponentReference.crefLastSubs(cr);
Expand Down Expand Up @@ -3419,7 +3419,7 @@ algorithm
Boolean bwhen,bdisc,bdynamic;
list<SimCode.SimVar> tempvars;
// handle empty
case (_, _, _, {}, helpVarInfo,_,_) then ({},{},{},iuniqueEqIndex,itempvars);
case (_, _, _, {},_,_,_) then ({},{},{},iuniqueEqIndex,itempvars);
// single equation
case (_, BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns), _, BackendDAE.SINGLEEQUATION(eqn=index,var=vindex) :: restComps, _, _,_)
equation
Expand Down Expand Up @@ -3540,7 +3540,7 @@ algorithm
list<SimCode.SimEqSystem> equations_,equations1,noDiscEquations1;
list<SimCode.SimVar> tempvars;
// handle empty
case (_, skipDiscInZc, genDiscrete, skipDiscInAlgorithm, linearSystem, _, _, {}, helpVarInfo,_,_) then ({},{},iuniqueEqIndex,itempvars);
case (_,_, genDiscrete,_,_,_, _, {},_,_,_) then ({},{},iuniqueEqIndex,itempvars);

// ignore when equations if we should not generate them
case (false, _, _, _, _, BackendDAE.EQSYSTEM(orderedEqs=eqns), _, BackendDAE.SINGLEEQUATION(eqn=index) :: restComps, _, _,_)
Expand Down Expand Up @@ -8605,7 +8605,7 @@ algorithm
(e22,rhs);

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

Expand Down Expand Up @@ -11528,9 +11528,9 @@ Helper function for setVectorIndexes;
output list<SimCode.SimVar> out_1;
output list<SimCode.SimVar> out_2;
algorithm (out_0,out_1,out_2) := matchcontinue(in_0,in_1,in_2,variable,variable_index)
case (_,in_1,in_2,variable,0) then (variable::in_0,in_1,in_2);
case (_,in_1,in_2,variable,1) then (in_0,variable::in_1,in_2);
case (_,in_1,in_2,variable,2) then (in_0,in_1,variable::in_2);
case (_,_,_,_,0) then (variable::in_0,in_1,in_2);
case (_,_,_,_,1) then (in_0,variable::in_1,in_2);
case (_,_,_,_,2) then (in_0,in_1,variable::in_2);
case(_,_,_,_,_) equation print(" failure in addVariableToStateVector \n"); then fail();
end matchcontinue;
end addVariableToStateVector;
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/Uncertainties.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ algorithm
array<Option<BackendDAE.Var>> varOptArr;
BackendDAE.Var elimVar;

case ({},_,vars,knvars,mvars,repl,_,m,elimVarIndexList,false) then
case ({},_,_,knvars,mvars,repl,_,_,elimVarIndexList,false) then
({},{},mvars,repl);

case (e::eqns,_,_,_,_,_,_,_,_,false) equation
Expand Down Expand Up @@ -1535,7 +1535,7 @@ algorithm
list<BackendDAE.Var> varLst;

case({},repl,func,_) then {};
case(v::varLst,_,_,replaceName as true) equation
case(v::varLst,_,_,true) equation
cr = BackendVariable.varCref(v);
bindExp = varBindingOpt(v);
bindExp = replaceExpOpt(bindExp,repl,func);
Expand All @@ -1546,7 +1546,7 @@ algorithm
varLst = replaceVars(varLst,repl,func,replaceName);
then v::varLst;

case(v::varLst,_,_,replaceName as false) equation
case(v::varLst,_,_,false) equation
bindExp = varBindingOpt(v);
bindExp = replaceExpOpt(bindExp,repl,func);
bindExp = applyOptionSimplify(bindExp);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ConnectionGraph.mo
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ algorithm
Boolean b, b1, b2;

// handle empty case
case ({}, left,_) then false;
case ({},_,_) then false;

// try direct match
case (SOME((crLeft, crRight))::rest, _, _)
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Dependency.mo
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ algorithm
d = buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));
d = buildClassDependsInComponentItems(citems,optPath,cname,(d,p,env,ht));
then d;
case(_,optPath,cname,(d,p,env,ht)) then d;
case(_,_,cname,(d,p,env,ht)) then d;
end matchcontinue;
end buildClassDependsInComponentItems;

Expand Down Expand Up @@ -683,7 +683,7 @@ algorithm
case(Absyn.ALG_NORETCALL(cr,funcargs),_,_,(d,p,env,ht)) equation
d = buildClassDependsInExp(Absyn.CALL(cr,funcargs),optPath,cname,(d,p,env,ht));
then d;
case(_,optPath,cname,(d,p,env,ht)) then d;
case(_,_,cname,(d,p,env,ht)) then d;
end matchcontinue;
end buildClassDependsInAlg;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Env.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ algorithm
local CacheTree tree;
array<EnvCache> arr;

case (_,inCache as CACHE(envCache=NONE()),_) then inCache;
case (_,CACHE(envCache=NONE()),_) then inCache;

case (_,CACHE(envCache=SOME(arr)),_)
equation
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3420,8 +3420,8 @@ protected function simplifyBinaryCommutative
output DAE.Exp exp;
algorithm
exp := matchcontinue (op,lhs,rhs)
case (_,lhs,_) then simplifyBinaryCommutativeWork(op,lhs,rhs);
case (_,lhs,_) then simplifyBinaryCommutativeWork(op,rhs,lhs);
case (_,_,_) then simplifyBinaryCommutativeWork(op,lhs,rhs);
case (_,_,_) then simplifyBinaryCommutativeWork(op,rhs,lhs);
end matchcontinue;
end simplifyBinaryCommutative;

Expand Down
32 changes: 16 additions & 16 deletions Compiler/FrontEnd/Inst.mo
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ algorithm
elems = listReverse(List.fold2r(elems,reEvaluateInitialIfEqns2,cache,env,{}));
then
DAE.DAE(elems);
case(_,_,dae,false) then dae;
case(_,_,_,false) then dae;
end match;
end reEvaluateInitialIfEqns;

Expand Down Expand Up @@ -2119,9 +2119,9 @@ algorithm
s1 = Mod.prettyPrintSubmod(smod) +& ", not processed in the built-in class Real";
Error.addMessage(Error.UNUSED_MODIFIER,{s1});
then fail();
case (_,env,DAE.MOD(f,e,{},eqmod),pre,ty) then {};
case (_,env,DAE.NOMOD(),pre,ty) then {};
case (_,env,DAE.REDECL(_,_,_),pre,ty) then fail(); /*TODO, report error when redeclaring in Real*/
case (_,_,DAE.MOD(f,e,{},eqmod),pre,ty) then {};
case (_,_,DAE.NOMOD(),pre,ty) then {};
case (_,_,DAE.REDECL(_,_,_),pre,ty) then fail(); /*TODO, report error when redeclaring in Real*/
end matchcontinue;
end instRealClass;

Expand Down Expand Up @@ -2193,9 +2193,9 @@ algorithm
s1 = Mod.prettyPrintSubmod(smod) +& ", not processed in the built-in class Integer";
Error.addMessage(Error.UNUSED_MODIFIER,{s1});
then fail();
case (_,env,DAE.MOD(f,e,{},eqmod),_) then {};
case (_,env,DAE.NOMOD(),_) then {};
case (_,env,DAE.REDECL(_,_,_),_) then fail(); /*TODO, report error when redeclaring in Real*/
case (_,_,DAE.MOD(f,e,{},eqmod),_) then {};
case (_,_,DAE.NOMOD(),_) then {};
case (_,_,DAE.REDECL(_,_,_),_) then fail(); /*TODO, report error when redeclaring in Real*/
end matchcontinue;
end instIntegerClass;

Expand Down Expand Up @@ -2293,8 +2293,8 @@ algorithm
s1 = Mod.prettyPrintSubmod(smod) +& ", not processed in the built-in class Boolean";
Error.addMessage(Error.UNUSED_MODIFIER,{s1});
then fail();
case (_,env,DAE.MOD(f,e,{},eqmod),_) then {};
case (_,env,DAE.NOMOD(),_) then {};
case (_,_,DAE.MOD(f,e,{},eqmod),_) then {};
case (_,_,DAE.NOMOD(),_) then {};
case(_,_,DAE.REDECL(_,_,_),_)
equation
print("Inst.instBooleanClass: ignoring wrong modifier:" +& Mod.printModStr(mods) +& "\n");
Expand Down Expand Up @@ -2355,9 +2355,9 @@ algorithm
s1 = Mod.prettyPrintSubmod(smod) +& ", not processed in the built-in class Enumeration";
Error.addMessage(Error.UNUSED_MODIFIER,{s1});
then fail();
case (_,env,DAE.MOD(f,e,{},eqmod),_) then {};
case (_,env,DAE.NOMOD(),_) then {};
case (_,env,DAE.REDECL(_,_,_),_) then fail(); /*TODO, report error when redeclaring in Real*/
case (_,_,DAE.MOD(f,e,{},eqmod),_) then {};
case (_,_,DAE.NOMOD(),_) then {};
case (_,_,DAE.REDECL(_,_,_),_) then fail(); /*TODO, report error when redeclaring in Real*/
end matchcontinue;
end instEnumerationClass;

Expand Down Expand Up @@ -2455,7 +2455,7 @@ algorithm
" expected type: " +& Types.printTypeStr(expectedTp) +&
" type props: " +& Types.printPropStr(bindProp));
then fail();
case(cache,env,id,_,bind,expectedTp,bindProp) equation
case(cache,env,id,_,_,expectedTp,bindProp) equation
true = Flags.isSet(Flags.FAILTRACE);
Debug.fprintln(Flags.FAILTRACE, "instBuiltinAttribute failed for: " +& id +&
" value binding: NONE()" +&
Expand Down Expand Up @@ -3890,7 +3890,7 @@ algorithm
// case({}, _, allComps, className) then {};

// handle none
case (_,NONE(), allComps,_) then inComps;
case (_,NONE(),_,_) then inComps;

// handle StateSelect as we will NEVER find it!
// case(inComps, SOME(DAE.CREF_QUAL(ident="StateSelect")), allComps, className) then inComps;
Expand Down Expand Up @@ -13210,7 +13210,7 @@ algorithm
then
fail();

case (c,ty,_,_,_,_,_,_,_,_,_,_,_,_,source,_) then DAEUtil.emptyDae;
case (c,ty,_,_,_,_,_,_,_,_,_,_,_,_,_,_) then DAEUtil.emptyDae;
end matchcontinue;
end daeDeclare4;

Expand Down Expand Up @@ -16534,7 +16534,7 @@ algorithm
checkVariabilityOfUpdatedComponent(variability,cref);
then (DAE.NOMOD(),DAE.NOMOD(),SCode.NOMOD());

case (_,updatedComps,cref,mods,cmod,_) then (mods,cmod,m);
case (_,_,cref,mods,cmod,_) then (mods,cmod,m);
end matchcontinue;
end noModForUpdatedComponents;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/MetaUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ algorithm
then
SOME(DAE.T_METAUNIONTYPE(paths,b,ts));

case (_,t,_) then t;
case (_,_,_) then t;
end matchcontinue;
end fixUniontype;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Mod.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ algorithm
mod := match (subMod, eqMod, n)
// eqmod is nomod!
case (_, DAE.NOMOD(), _) then subMod;
case (_, eqMod as DAE.MOD(eqModOption = SOME(DAE.TYPED(modifierAsExp = _))), _) then eqMod;
case (_,DAE.MOD(eqModOption = SOME(DAE.TYPED(modifierAsExp = _))), _) then eqMod;
case (_, _, _)
equation
mod = checkDuplicateModifications(subMod,eqMod,n);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Patternm.mo
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ algorithm
Error.addSourceMessage(Error.LOOKUP_VARIABLE_ERROR,{id,""},info);
then fail();

case (cache,env,Absyn.CREF(Absyn.WILD()),_,info,_,_) then (cache,DAE.PAT_WILD());
case (cache,env,Absyn.CREF(Absyn.WILD()),_,_,_,_) then (cache,DAE.PAT_WILD());

case (cache,env,lhs,ty,info,numError,_)
equation
Expand Down
10 changes: 5 additions & 5 deletions Compiler/FrontEnd/UnitAbsynBuilder.mo
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ algorithm
equation
false = Flags.getConfigBool(Flags.UNIT_CHECKING);
then(UnitAbsyn.noStore,{});
case (_,dae,compDae,UnitAbsyn.NOSTORE()) then (UnitAbsyn.NOSTORE(),{});
case (_,_,compDae,UnitAbsyn.NOSTORE()) then (UnitAbsyn.NOSTORE(),{});
case(_,_,_,UnitAbsyn.INSTSTORE(st,ht,res))
equation
(terms,st) = buildTerms(env,dae,ht,st);
Expand Down Expand Up @@ -1370,10 +1370,10 @@ protected function buildTermOp "Takes two UnitTerms and and DAE.Operator and cre
output UnitAbsyn.UnitTerm ut;
algorithm
ut := match(ut1,ut2,op,origExp)
case (_,ut2,DAE.ADD(ty=_),_) then UnitAbsyn.ADD(ut1,ut2,origExp);
case (_,ut2,DAE.SUB(ty=_),_) then UnitAbsyn.SUB(ut1,ut2,origExp);
case (_,ut2,DAE.MUL(ty=_),_) then UnitAbsyn.MUL(ut1,ut2,origExp);
case (_,ut2,DAE.DIV(ty=_),_) then UnitAbsyn.DIV(ut1,ut2,origExp);
case (_,_,DAE.ADD(ty=_),_) then UnitAbsyn.ADD(ut1,ut2,origExp);
case (_,_,DAE.SUB(ty=_),_) then UnitAbsyn.SUB(ut1,ut2,origExp);
case (_,_,DAE.MUL(ty=_),_) then UnitAbsyn.MUL(ut1,ut2,origExp);
case (_,_,DAE.DIV(ty=_),_) then UnitAbsyn.DIV(ut1,ut2,origExp);
end match;
end buildTermOp;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/Script/Interactive.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10945,7 +10945,7 @@ algorithm
list<Absyn.ElementArg> xs;
String mapType;

case ({}, _, inClass, inFullProgram,_) then "{}";
case ({}, _,_,_,_) then "{}";

case ((ann as Absyn.MODIFICATION(componentRef = Absyn.CREF_IDENT(name = mapType),modification = mod)) :: _,_,
_, _, _)
Expand Down Expand Up @@ -14945,7 +14945,7 @@ algorithm
then
str;

case (_,inClass,inFullProgram,_) then "";
case (_,_,_,_) then "";
end matchcontinue;
end getComponentAnnotation;

Expand Down Expand Up @@ -19535,7 +19535,7 @@ algorithm
ident = "(" +& ident +& ")";
res = getDefinitionComponents(typeStr,dirStr,numDim,rest);
then ident :: res;
case (_,dirStr,numDim,_::rest) then getDefinitionComponents(typeStr,dirStr,numDim,rest);
case (_,_,_,_::rest) then getDefinitionComponents(typeStr,dirStr,numDim,rest);
end matchcontinue;
end getDefinitionComponents;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/Util/Graph.mo
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ algorithm
Integer node;
list<Integer> rest;
list<Integer> indexes;
case (_, {}, _, inForbiddenColor, _) then inForbiddenColor;
case (_, {}, _,_, _) then inForbiddenColor;
case (_, node::rest, _, _, _)
equation
((_,indexes)) = arrayGet(inGraph,node);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Util/Util.mo
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ algorithm
e = array[pos];
true = func(e);
then SOME(e);
case (_,func,_) then arrayFindFirstOnTrue2(array,func,pos+1);
case (_,_,_) then arrayFindFirstOnTrue2(array,func,pos+1);
end matchcontinue;
end arrayFindFirstOnTrue2;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/Util/VarTransform.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ algorithm
then
(repl,src,dst_1);
// replace Exp failed, keep old rule.
case (_,src,_) then (repl,src,dst); /* dst has no own replacement, return */
case (_,_,_) then (repl,src,dst); /* dst has no own replacement, return */
end matchcontinue;
end makeTransitive2;

Expand Down

0 comments on commit 54713e4

Please sign in to comment.