Skip to content

Commit

Permalink
Removed some calls that should not do anything
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23257 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 6, 2014
1 parent 027cda7 commit c02de76
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 32 deletions.
3 changes: 1 addition & 2 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -927,7 +927,6 @@ algorithm
DAEUtil.setMinMax(inVarAttr, SOME(DAE.ENUM_LITERAL(namee1, 1)), SOME(DAE.ENUM_LITERAL(nameen, i)));
case (NONE(), SOME(e), _, _, _)
equation
_ = listLength(inNames);
s1 = listGet(inNames, 1);
namee1 = Absyn.joinPaths(inPath, Absyn.IDENT(s1));
then
Expand Down Expand Up @@ -1588,7 +1587,7 @@ algorithm
(beqns, eqns);
case (DAE.NORETCALL(exp=exp, source=source)::eqns, NONE(), _, _, _)
equation
_ = List.fold(conditions, makeIfExp, DAE.BCONST(true));
// _ = List.fold(conditions, makeIfExp, DAE.BCONST(true)); // TODO: Does this do anything?
(beqns, eqns) = lowerIfEquationAsserts1(eqns, condition, conditions, brancheqns1, DAE.ALGORITHM(DAE.ALGORITHM_STMTS({DAE.STMT_IF(exp, {DAE.STMT_NORETCALL(exp, source)}, DAE.NOELSE(), source)}), source)::inEqns);
then
(beqns, eqns);
Expand Down
3 changes: 1 addition & 2 deletions Compiler/BackEnd/BackendQSS.mo
Expand Up @@ -104,11 +104,10 @@ algorithm
print("BackEndQSS analysis initialized");
print("\n ----------------------------\n");
(_,_,orderedVarsList) = getAllVars(dlow);
_ = List.filterOnTrue(orderedVarsList,BackendVariable.isStateVar);
// _ = List.filterOnTrue(orderedVarsList,BackendVariable.isStateVar); // TODO: Did this do anything?
discVarsLst = List.filterOnTrue(orderedVarsList,isDiscreteVar);
disc = List.map(discVarsLst,BackendVariable.varCref);
(eqsindex,zc_exps) = getEquationsWithDiscont(zeroCrossings);
_ = listLength(disc);
disc = listAppend(disc, newDiscreteVariables(getEquations(eqsdae,eqsindex),0));
//states = List.map(stateVarsList,BackendVariable.varCref);
//algs = computeAlgs(eqs,states,{});
Expand Down
31 changes: 11 additions & 20 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -677,7 +677,6 @@ algorithm
s = Absyn.crefLastIdent(fn);
true = stringEq(s, "EnumToInteger");
(cache,e_1,prop,st_1) = elabCall(cache, env, Absyn.CREF_IDENT("Integer", {}), args, nargs, impl, st,pre,info,Error.getNumErrorMessages());
_ = Types.propAllConst(prop);
(e_1,_) = ExpressionSimplify.simplify1(e_1);
then
(cache,e_1,prop,st_1);
Expand Down Expand Up @@ -736,7 +735,6 @@ algorithm
case (cache,env,Absyn.CALL(function_ = fn,functionArgs = Absyn.FUNCTIONARGS(args = args,argNames = nargs)),impl,st,_,pre,_,_)
equation
(cache,e_1,prop,st_1) = elabCall(cache, env, fn, args, nargs, impl, st, pre, info, Error.getNumErrorMessages());
_ = Types.propAllConst(prop);
(e_1,_) = ExpressionSimplify.simplify1(e_1);
then
(cache,e_1,prop,st_1);
Expand All @@ -760,7 +758,6 @@ algorithm
case (cache,env,Absyn.CALL(function_ = fn,functionArgs = Absyn.FOR_ITER_FARG(exp = e, iterType=iterType, iterators=iterators)),impl,st,doVect,pre,_,_)
equation
(cache,e_1,prop,st_1) = elabCallReduction(cache,env, fn, e, iterType, iterators, impl, st,doVect,pre,info);
_ = Types.propAllConst(prop);
then
(cache,e_1,prop,st_1);

Expand Down Expand Up @@ -1450,7 +1447,6 @@ algorithm
case (env,Absyn.IDENT("listReverse"),_,_,_,_) then (env,NONE());
case (env,Absyn.IDENT("sum"),_,_,_,_)
equation
_ = Absyn.pathToCref(path);
env = FGraph.addForIterator(env, foldId, expty, DAE.UNBOUND(), SCode.VAR(), SOME(DAE.C_VAR()));
env = FGraph.addForIterator(env, resultId, expty, DAE.UNBOUND(), SCode.VAR(), SOME(DAE.C_VAR()));
cr1 = Absyn.CREF_IDENT(foldId,{});
Expand All @@ -1459,7 +1455,6 @@ algorithm
then (env,SOME(exp));
case (env,Absyn.IDENT("product"),_,_,_,_)
equation
_ = Absyn.pathToCref(path);
env = FGraph.addForIterator(env, foldId, expty, DAE.UNBOUND(), SCode.VAR(), SOME(DAE.C_VAR()));
env = FGraph.addForIterator(env, resultId, expty, DAE.UNBOUND(), SCode.VAR(), SOME(DAE.C_VAR()));
cr1 = Absyn.CREF_IDENT(foldId,{});
Expand Down Expand Up @@ -2010,8 +2005,7 @@ algorithm
nmax = matrixConstrMaxDim(tps_2, 2);
havereal = Types.containReal(tps_2);
(cache,mexp,DAE.PROP(t,c),dim1,dim2) = elabMatrixSemi(cache,env,dess,tps,impl,NONE(),havereal,nmax,true,pre,info);
_ = Types.simplifyType(t);
_ = elabMatrixToMatrixExp(mexp);
_ = elabMatrixToMatrixExp(mexp); // TODO: Does this do anything?
t_1 = Types.unliftArray(t);
t_2 = Types.unliftArray(t_1);
then
Expand Down Expand Up @@ -4032,7 +4026,7 @@ algorithm
(_, exp_1, DAE.PROP(tp, _),_) = elabExpInExpression(cache, env, exp, inImpl, NONE(), true, inPrefix, info);
true = Types.dimensionsKnown(tp);
// check the stream prefix
_ = elabBuiltinStreamOperator(cache, env, "inStream", exp_1, tp, inInfo);
elabBuiltinStreamOperator(cache, env, "inStream", exp_1, tp, inInfo);
(cache, e, prop) = elabCallArgs(cache, env, Absyn.IDENT("inStream"), {exp}, {}, inImpl, NONE(), inPrefix, info);
then
(cache, e, prop);
Expand Down Expand Up @@ -4077,7 +4071,7 @@ algorithm
(_, exp_1, DAE.PROP(tp, _),_) = elabExpInExpression(cache, env, exp, inImpl, NONE(), true, inPrefix, info);
true = Types.dimensionsKnown(tp);
// check the stream prefix
_ = elabBuiltinStreamOperator(cache, env, "actualStream", exp_1, tp, inInfo);
elabBuiltinStreamOperator(cache, env, "actualStream", exp_1, tp, inInfo);
(cache, e, prop) = elabCallArgs(cache, env, Absyn.IDENT("actualStream"), {exp}, {}, inImpl, NONE(), inPrefix, info);
then
(cache, e, prop);
Expand Down Expand Up @@ -7429,13 +7423,13 @@ algorithm

case (Absyn.IDENT(name = id),_)
equation
_ = elabBuiltinHandler(id);
elabBuiltinHandler(id);
then
(DAE.FUNCTION_BUILTIN(SOME(id)),true,inPath);

case (Absyn.QUALIFIED("OpenModelicaInternal",Absyn.IDENT(name = id)),_)
equation
_ = elabBuiltinHandlerInternal(id);
elabBuiltinHandlerInternal(id);
then
(DAE.FUNCTION_BUILTIN(SOME(id)),true,inPath);

Expand Down Expand Up @@ -7660,7 +7654,7 @@ algorithm
String name;
case (Absyn.CREF_IDENT(name = name,subscripts = {}))
equation
_ = elabBuiltinHandler(name);
elabBuiltinHandler(name);
then
true;
else false;
Expand Down Expand Up @@ -8165,7 +8159,7 @@ algorithm
(cache,_,newslots,constInputArgs,_) = elabInputArgs(cache, env, args, nargs, slots, true, false /*checkTypes*/ ,impl,NOT_EXTERNAL_OBJECT_MODEL_SCOPE(), {},st,pre,info,DAE.T_UNKNOWN_DEFAULT,fn);
(cache,newslots2,constDefaultArgs,_) = fillGraphicsDefaultSlots(cache, newslots, cl, env_2, impl, {}, pre, info);
constlist = listAppend(constInputArgs, constDefaultArgs);
_ = List.fold(constlist, Types.constAnd, DAE.C_CONST());
// _ = List.fold(constlist, Types.constAnd, DAE.C_CONST());
args_2 = slotListArgs(newslots2);

tp = complexTypeFromSlots(newslots2,ClassInf.UNKNOWN(Absyn.IDENT("")));
Expand Down Expand Up @@ -8782,7 +8776,7 @@ algorithm

case (cache,_,DAE.T_METARECORD(fields=vars,source={fqPath}),_,_,_,_,_,_,_)
equation
_ = List.map(vars, Types.getVarType);
// _ = List.map(vars, Types.getVarType);
DAE.TYPES_VAR(name = str) = List.selectFirst(vars, Types.varHasMetaRecordType);
fn_str = Absyn.pathString(fqPath);
Error.addSourceMessage(Error.METARECORD_CONTAINS_METARECORD_MEMBER,{fn_str,str},info);
Expand Down Expand Up @@ -9130,10 +9124,10 @@ algorithm
// A slot with an unevaluated binding, evaluate the binding and return it.
case ((slot as SLOT(defaultArg = da as DAE.FUNCARG(defaultBinding=SOME(exp)), dims = dims, idx = idx), 0), _, _)
equation
_ = arrayUpdate(inSlotArray, idx, (slot, 1));
arrayUpdate(inSlotArray, idx, (slot, 1));
exp = evaluateSlotExp(exp, inSlotArray, inInfo);
slot = SLOT(da, true, SOME(exp), dims, idx);
_ = arrayUpdate(inSlotArray, idx, (slot, 2));
arrayUpdate(inSlotArray, idx, (slot, 2));
then
(exp, slot);

Expand Down Expand Up @@ -9350,7 +9344,7 @@ algorithm
case (DAE.ARRAY(),(dim :: ad),slots,DAE.PROP(tp,c),_)
equation
int_dim = Expression.dimensionSize(dim);
_ = Types.simplifyType(Types.liftArray(tp, dim));
// _ = Types.simplifyType(Types.liftArray(tp, dim));
vect_exp = vectorizeCallArray(inExp, int_dim, slots);
tp = Types.liftArrayRight(tp, dim);
(vect_exp_1,prop) = vectorizeCall(vect_exp, ad, slots, DAE.PROP(tp,c),info);
Expand Down Expand Up @@ -9948,7 +9942,6 @@ algorithm
// Constant evaluate the bound expression.
(cache, val, _) = Ceval.ceval(inCache, inEnv, exp, false, NONE(), Absyn.NO_MSG(), 0);
exp = ValuesUtil.valueExp(val);
_ = Expression.typeof(exp);
// Create a binding from the evaluated expression.
slot = SLOT(defaultArg,true,SOME(exp),dims,idx);
(cache,slots) = evaluateStructuralSlots2(cache,inEnv,rest,usedSlots,slot::acc);
Expand Down Expand Up @@ -10671,8 +10664,6 @@ algorithm
list<Slot> slots;

case({},_)
equation
_ = ClassInf.getStateName(complexClassType);
then
DAE.T_COMPLEX(complexClassType, {}, NONE(), DAE.emptyTypeSource);

Expand Down
5 changes: 0 additions & 5 deletions Compiler/FrontEnd/Types.mo
Expand Up @@ -4750,23 +4750,20 @@ algorithm
equation
(e,t1) = matchType(e,t1,unboxedType(t2),printFailtrace);
t2 = DAE.T_METABOXED(t1,DAE.emptyTypeSource);
_ = simplifyType(t2);
e = Expression.boxExp(e);
then (e,t2);

case (e, t1 as DAE.T_BOOL(), DAE.T_METABOXED(ty = t2),_)
equation
(e,t1) = matchType(e,t1,unboxedType(t2),printFailtrace);
t2 = DAE.T_METABOXED(t1,DAE.emptyTypeSource);
_ = simplifyType(t2);
e = Expression.boxExp(e);
then (e,t2);

case (e, t1 as DAE.T_REAL(), DAE.T_METABOXED(ty = t2),_)
equation
(e,t1) = matchType(e,t1,unboxedType(t2),printFailtrace);
t2 = DAE.T_METABOXED(t1,DAE.emptyTypeSource);
_ = simplifyType(t2);
e = Expression.boxExp(e);
then (e,t2);

Expand All @@ -4775,7 +4772,6 @@ algorithm
// true = Config.acceptMetaModelicaGrammar();
(e, t1) = matchType(e, t1, unboxedType(t2), printFailtrace);
t2 = DAE.T_METABOXED(t1,DAE.emptyTypeSource);
_ = simplifyType(t2);
e = Expression.boxExp(e);
then
(e, t2);
Expand Down Expand Up @@ -4986,7 +4982,6 @@ algorithm
case (expl::rest, DAE.T_ARRAY(ty=DAE.T_ARRAY(ty=t1)), DAE.T_METALIST(DAE.T_METALIST(ty=t2),_),_)
equation
(e,t1) = typeConvertMatrixRowToList(expl, t1, t2, printFailtrace);
_ = simplifyType(t1);
(expl,_) = typeConvertMatrixToList(rest, inType, outType, printFailtrace);
then (e::expl,DAE.T_METALIST(t1,DAE.emptyTypeSource));
else
Expand Down
5 changes: 2 additions & 3 deletions Compiler/Script/Interactive.mo
Expand Up @@ -14043,8 +14043,7 @@ algorithm
equation
c1 = countComponentsInElts(elt);
newn = n - c1;
_ = intString(newn);
(newn > 0) = true;
true = newn > 0;
res = getNthComponentInClass(Absyn.CLASS(a,b,c,d,e,Absyn.PARTS({},{},rest,ann,cmt),file_info),
newn);
then
Expand All @@ -14065,7 +14064,7 @@ algorithm
equation
c1 = countComponentsInElts(elt);
newn = n - c1;
(newn > 0) = true;
true = newn > 0;
res = getNthComponentInClass(Absyn.CLASS(a,b,c,d,e,Absyn.PARTS({},{},rest,ann,cmt),file_info), newn);
then
res;
Expand Down

0 comments on commit c02de76

Please sign in to comment.