Skip to content

Commit

Permalink
Fix some unused code for separate compilation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16370 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jun 14, 2013
1 parent 380bd65 commit 243917e
Show file tree
Hide file tree
Showing 26 changed files with 421 additions and 880 deletions.
19 changes: 5 additions & 14 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ algorithm
BackendDAE.BackendDAE dlow;
BackendDAE.EquationArray eqns;
Integer n;
case (dlow,inM)
case (dlow,_)
equation
// check equations
(_,(_,n)) = traverseIncidenceMatrix(inM,countSimpleEquationsFinder,(dlow,0));
Expand Down Expand Up @@ -4436,10 +4436,8 @@ protected function createDiffStatements
input DAE.Statement inStmt;
input DAE.ElementSource Source;
output list<DAE.Statement> outEqn;
algorithm outEqn := match(inLHS,inRHS,inType,inStmt,Source)
local
case (inLHS,inRHS,inType,inStmt,Source) then {DAE.STMT_ASSIGN(inType, inLHS, inRHS, Source), inStmt};
end match;
algorithm
outEqn := {DAE.STMT_ASSIGN(inType, inLHS, inRHS, Source), inStmt};
end createDiffStatements;

protected function differentiateWithRespectToXVec "function differentiateWithRespectToXVec
Expand Down Expand Up @@ -5042,14 +5040,7 @@ protected function mergeRelation
input Option<tuple<DAE.Exp,Integer,Integer>> inOptionExpisASUB;
output DAE.Exp outExp;
algorithm
outExp := matchcontinue(inExp0,inExp1,inExp2,inOp, inIndex, inOptionExpisASUB)
local
DAE.Exp e;
case (inExp0,inExp1,inExp2,inOp,inIndex,inOptionExpisASUB)
equation
e = DAE.RELATION(inExp1,inOp,inExp2,inIndex,inOptionExpisASUB);
then e;
end matchcontinue;
outExp := DAE.RELATION(inExp1,inOp,inExp2,inIndex,inOptionExpisASUB);
end mergeRelation;

protected function mergeArray
Expand Down Expand Up @@ -5393,7 +5384,7 @@ protected function printPartition
input array<Integer> ixs;
algorithm
_ := match (b,ixs)
case (true,ixs)
case (true,_)
equation
print("Got partition!\n");
print(stringDelimitList(List.map(arrayList(ixs), intString), ","));
Expand Down
34 changes: 13 additions & 21 deletions Compiler/BackEnd/BackendDAEUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1338,26 +1338,26 @@ algorithm
list<DAE.Exp> expl;
list<DAE.Statement> stmts;

case(BackendDAE.EQUATION(exp = e1,scalar = e2),vars,knvars) equation
case(BackendDAE.EQUATION(exp = e1,scalar = e2),_,_) equation
b = boolAnd(isDiscreteExp(e1,vars,knvars), isDiscreteExp(e2,vars,knvars));
then b;
case(BackendDAE.COMPLEX_EQUATION(left = e1,right = e2),vars,knvars) equation
case(BackendDAE.COMPLEX_EQUATION(left = e1,right = e2),_,_) equation
b = boolAnd(isDiscreteExp(e1,vars,knvars), isDiscreteExp(e2,vars,knvars));
then b;
case(BackendDAE.ARRAY_EQUATION(left = e1,right = e2),vars,knvars) equation
case(BackendDAE.ARRAY_EQUATION(left = e1,right = e2),_,_) equation
b = boolAnd(isDiscreteExp(e1,vars,knvars), isDiscreteExp(e2,vars,knvars));
then b;
case(BackendDAE.SOLVED_EQUATION(componentRef = cr,exp = e2),vars,knvars) equation
case(BackendDAE.SOLVED_EQUATION(componentRef = cr,exp = e2),_,_) equation
e1 = Expression.crefExp(cr);
b = boolAnd(isDiscreteExp(e1,vars,knvars), isDiscreteExp(e2,vars,knvars));
then b;
case(BackendDAE.RESIDUAL_EQUATION(exp = e1),vars,knvars) equation
case(BackendDAE.RESIDUAL_EQUATION(exp = e1),_,_) equation
b = isDiscreteExp(e1,vars,knvars);
then b;
case(BackendDAE.ALGORITHM(alg = DAE.ALGORITHM_STMTS(stmts)),vars,knvars) equation
case(BackendDAE.ALGORITHM(alg = DAE.ALGORITHM_STMTS(stmts)),_,_) equation
(_,(_,_,true)) = DAEUtil.traverseDAEEquationsStmts(stmts, isDiscreteExp1, (vars,knvars,false));
then true;
case(BackendDAE.WHEN_EQUATION(whenEquation = _),vars,knvars) then true;
case(BackendDAE.WHEN_EQUATION(whenEquation = _),_,_) then true;
// returns false otherwise!
case(_,_,_) then false;
end matchcontinue;
Expand Down Expand Up @@ -1582,17 +1582,9 @@ public function statesAndVarsExp
outputs: DAE.Exp list"
input DAE.Exp inExp;
input BackendDAE.Variables inVariables;
output list<DAE.Exp> outExpExpLst;
output list<DAE.Exp> exps;
algorithm
outExpExpLst :=
match(inExp,inVariables)
local list<DAE.Exp> exps;
case(inExp,inVariables)
equation
((_,(_,exps))) = Expression.traverseExpTopDown(inExp, traversingstatesAndVarsExpFinder, (inVariables,{}));
then
exps;
end match;
((_,(_,exps))) := Expression.traverseExpTopDown(inExp, traversingstatesAndVarsExpFinder, (inVariables,{}));
end statesAndVarsExp;

public function traversingstatesAndVarsExpFinder "
Expand Down Expand Up @@ -2064,7 +2056,7 @@ algorithm
EquationArray e,se,ie;
array<Integer> ass1,ass2;
array<list<Integer>> m,mt;
case (syst as BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1,ass2,comps)))
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1,ass2,comps)))
equation
size = arrayLength(ass1) "equation_size(e) => size &" ;
arr = arrayCreate(size, 0);
Expand Down Expand Up @@ -2426,8 +2418,8 @@ algorithm
list<Var> var_lst;
EquationArray eqnsNew;
BackendDAE.Variables varsNew;
case ({},inEqns,inVars,eqnsNew,varsNew) then (eqnsNew,varsNew);
case (comp::rest,inEqns,inVars,eqnsNew,varsNew)
case ({},_,_,eqnsNew,varsNew) then (eqnsNew,varsNew);
case (comp::rest,_,_,eqnsNew,varsNew)
equation
(eqnsNew,varsNew) = splitoutEquationAndVars(rest,inEqns,inVars,eqnsNew,varsNew);
(eqn_lst,var_lst,_) = BackendDAETransform.getEquationAndSolvedVar(comp, inEqns, inVars);
Expand Down Expand Up @@ -6140,7 +6132,7 @@ algorithm
reqn = BackendEquation.equationToResidualForm(eqn);
then
((eqn,reqn::eqns));
case (inTpl) then inTpl;
else inTpl;
end matchcontinue;
end traverseequationToResidualForm;

Expand Down
37 changes: 17 additions & 20 deletions Compiler/BackEnd/BackendDump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ algorithm
DAE.ComponentRef cr;

case ({}, _) then ();
case (BackendDAE.EQUATION(e1, e2, source, diffed)::res, printExpTree) equation /*done*/
case (BackendDAE.EQUATION(e1, e2, source, diffed)::res, _) equation /*done*/
str = "EQUATION: ";
str = str +& ExpressionDump.printExpStr(e1);
str = str +& " = ";
Expand All @@ -637,7 +637,7 @@ algorithm

dumpBackendDAEEqnList2(res, printExpTree);
then ();
case (BackendDAE.COMPLEX_EQUATION(left=e1, right=e2, source=source)::res, printExpTree) equation /*done*/
case (BackendDAE.COMPLEX_EQUATION(left=e1, right=e2, source=source)::res, _) equation /*done*/
str = "COMPLEX_EQUATION: ";
str = str +& ExpressionDump.printExpStr(e1);
str = str +& " = ";
Expand All @@ -655,7 +655,7 @@ algorithm

dumpBackendDAEEqnList2(res,printExpTree);
then ();
case (BackendDAE.SOLVED_EQUATION(componentRef=cr,exp=e,source=source)::res,printExpTree) equation
case (BackendDAE.SOLVED_EQUATION(componentRef=cr,exp=e,source=source)::res,_) equation
print("SOLVED_EQUATION: ");
str = ExpressionDump.printExpStr(e);
print(str);
Expand All @@ -666,7 +666,7 @@ algorithm
print("\n");
dumpBackendDAEEqnList2(res,printExpTree);
then ();
case (BackendDAE.RESIDUAL_EQUATION(exp=e,source=source)::res, printExpTree) equation /*done*/
case (BackendDAE.RESIDUAL_EQUATION(exp=e,source=source)::res, _) equation /*done*/
str = "RESIDUAL_EQUATION: ";
str = str +& ExpressionDump.printExpStr(e);
str = str +& "\n";
Expand All @@ -679,7 +679,7 @@ algorithm

dumpBackendDAEEqnList2(res, printExpTree);
then ();
case (BackendDAE.ARRAY_EQUATION(left=e1,right=e2,source=source)::res,printExpTree) equation
case (BackendDAE.ARRAY_EQUATION(left=e1,right=e2,source=source)::res,_) equation
print("ARRAY_EQUATION: ");
str = ExpressionDump.printExpStr(e1);
print(str);
Expand All @@ -690,13 +690,13 @@ algorithm
print("\n");
dumpBackendDAEEqnList2(res,printExpTree);
then ();
case (BackendDAE.ALGORITHM(alg=alg,source=source)::res,printExpTree) equation
case (BackendDAE.ALGORITHM(alg=alg,source=source)::res,_) equation
print("ALGORITHM: ");
dumpAlgorithms({alg},0);
print("\n");
dumpBackendDAEEqnList2(res,printExpTree);
then ();
case (BackendDAE.WHEN_EQUATION(whenEquation=BackendDAE.WHEN_EQ(right=e/*TODO handle elsewhe also*/),source=source)::res, printExpTree) equation
case (BackendDAE.WHEN_EQUATION(whenEquation=BackendDAE.WHEN_EQ(right=e/*TODO handle elsewhe also*/),source=source)::res, _) equation
print("WHEN_EQUATION: ");
str = ExpressionDump.printExpStr(e);
print(str);
Expand All @@ -707,7 +707,7 @@ algorithm
print("\n");
dumpBackendDAEEqnList2(res,printExpTree);
then ();
case (_::res, printExpTree) equation
case (_::res, _) equation
print("SKIPED EQUATION\n");
dumpBackendDAEEqnList2(res, printExpTree);
then ();
Expand Down Expand Up @@ -923,7 +923,7 @@ algorithm
list<Integer> l;
list<list<Integer>> lst;
case ({},_,_,_) then ();
case ((l :: lst),i,v2,vars)
case ((l :: lst),i,_,_)
equation
print("{");
ls = List.map(l, intString);
Expand All @@ -934,8 +934,7 @@ algorithm
print("\n");
i_1 = i + 1;
dumpComponentsAdvanced2(lst, i_1,v2,vars);
then
();
then ();
end match;
end dumpComponentsAdvanced2;

Expand All @@ -957,7 +956,7 @@ algorithm
BackendDAE.Var var;
Boolean b;
case ({},_,_) then ();
case (i::{},v2,vars)
case (i::{},_,_)
equation
v = v2[i];
var = BackendVariable.getVarAt(vars,v);
Expand All @@ -969,9 +968,8 @@ algorithm
print(s);
s = Util.if_(b,") "," ");
print(s);
then
();
case (i::l,v2,vars)
then ();
case (i::l,_,_)
equation
v = v2[i];
var = BackendVariable.getVarAt(vars,v);
Expand All @@ -984,8 +982,7 @@ algorithm
s = Util.if_(b,") "," ");
print(s);
dumpComponentsAdvanced3(l,v2,vars);
then
();
then ();
end match;
end dumpComponentsAdvanced3;

Expand Down Expand Up @@ -2127,7 +2124,7 @@ algorithm
list<DAE.Algorithm> algs;

case({},_) then ();
case(DAE.ALGORITHM_STMTS(stmts)::algs,indx)
case(DAE.ALGORITHM_STMTS(stmts)::algs,_)
equation
is = intString(indx);
myStream = IOStream.create("", IOStream.LIST());
Expand Down Expand Up @@ -3193,7 +3190,7 @@ algorithm
s = stringAppendList({scr," = ",se,"\n"});
print(s);
then ((v,{}));
case inTpl then inTpl;
else inTpl;
end matchcontinue;
end dumpAliasVariable;

Expand Down Expand Up @@ -3230,7 +3227,7 @@ algorithm
print(intString(pos)); print(": ");
print(scr); print("\n");
then ((v,pos+1));
case inTpl then inTpl;
else inTpl;
end matchcontinue;
end dumpStateVariable;

Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendEquation.mo
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ algorithm
then
((e, (crefs,vars) ));

case(inExp) then inExp;
else inExp;

end matchcontinue;
end traversingStateRefFinder;
Expand Down Expand Up @@ -554,7 +554,7 @@ algorithm
((_,tpl)) = Expression.traverseExp(exp,checkEquationsUnknownCrefsExp,tpl);
then
((exp,tpl));
case inTpl then inTpl;
else inTpl;
end matchcontinue;
end checkEquationsUnknownCrefs;

Expand Down Expand Up @@ -622,7 +622,7 @@ algorithm
then
((e, (vars,knvars,ht)));

case inTuple then inTuple;
else inTuple;
end matchcontinue;
end checkEquationsUnknownCrefsExp;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendVariable.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4120,7 +4120,7 @@ algorithm
equation
true = BackendDAEUtil.isVarDiscrete(v);
then ((v,v::v_lst));
case inTpl then inTpl;
else inTpl;
end matchcontinue;
end traversingisisVarDiscreteFinder;

Expand Down
10 changes: 5 additions & 5 deletions Compiler/BackEnd/BinaryTree.mo
Original file line number Diff line number Diff line change
Expand Up @@ -305,35 +305,35 @@ algorithm
case ((bt as TREENODE(value = NONE(),leftSubTree = NONE(),rightSubTree = NONE())),_,_)
then bt;

case (TREENODE(value = SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = optLeft,rightSubTree = SOME(right)),keystr,keyhash)
case (TREENODE(value = SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = optLeft,rightSubTree = SOME(right)),_,_)
equation
0 = keyCompareNinjaSecretHashTricks(rkeystr, rhash, keystr, keyhash);
(rightmost,right) = treeDeleteRightmostValue(right);
optRight = treePruneEmptyNodes(right);
then
TREENODE(SOME(rightmost),optLeft,optRight);

case (TREENODE(value = SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = SOME(left as TREENODE(value=_)),rightSubTree = NONE()),keystr,keyhash)
case (TREENODE(value = SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = SOME(left as TREENODE(value=_)),rightSubTree = NONE()),_,_)
equation
0 = keyCompareNinjaSecretHashTricks(rkeystr, rhash, keystr, keyhash);
then
left;

case (TREENODE(value = SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = NONE(),rightSubTree = NONE()),keystr,keyhash)
case (TREENODE(value = SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = NONE(),rightSubTree = NONE()),_,_)
equation
0 = keyCompareNinjaSecretHashTricks(rkeystr, rhash, keystr, keyhash);
then
TREENODE(NONE(),NONE(),NONE());

case (TREENODE(value = optVal as SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = optLeft,rightSubTree = SOME(t)),keystr,keyhash)
case (TREENODE(value = optVal as SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = optLeft,rightSubTree = SOME(t)),_,_)
equation
1 = keyCompareNinjaSecretHashTricks(rkeystr, rhash, keystr, keyhash);
t = treeDelete2(t, keystr, keyhash);
optTree = treePruneEmptyNodes(t);
then
TREENODE(optVal,optLeft,optTree);

case (TREENODE(value = optVal as SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = SOME(t),rightSubTree = optRight),keystr,keyhash)
case (TREENODE(value = optVal as SOME(TREEVALUE(rkey,rkeystr,rhash,rval)),leftSubTree = SOME(t),rightSubTree = optRight),_,_)
equation
-1 = keyCompareNinjaSecretHashTricks(rkeystr, rhash, keystr, keyhash);
t = treeDelete2(t, keystr, keyhash);
Expand Down

0 comments on commit 243917e

Please sign in to comment.