Skip to content

Commit

Permalink
- Fix for arrayMap (no need to call listMap)
Browse files Browse the repository at this point in the history
  - Some other minor fixes


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7005 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 13, 2010
1 parent 6365717 commit a4f9888
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Compiler/BackendDAEUtil.mo
Expand Up @@ -4401,7 +4401,7 @@ protected function traverseBackendDAEExpsArrayEqn "function: traverseBackendDAEE

Helper function to traverseBackendDAEExpsEqn
"
replaceable type Type_b subtypeof Any;
replaceable type Type_a subtypeof Any;
input BackendDAE.MultiDimEquation inMultiDimEquation;
input FuncExpType func;
input Type_a inTypeA;
Expand Down
2 changes: 2 additions & 0 deletions Compiler/Ceval.mo
Expand Up @@ -1173,13 +1173,15 @@ algorithm
DAE.Function func;

// Try cevalFunction first
/*
case (cache,env,(e as DAE.CALL(path = funcpath,expLst = expl)),vallst,impl,st,_,msg)
equation
(cache,false) = Static.isExternalObjectFunction(cache,env,funcpath);
// Call of record constructors, etc., i.e. functions that can be constant propagated.
(cache,newval) = cevalFunction(cache, env, funcpath, vallst, impl, msg);
then
(cache,newval,st);
*/

// External functions that are "known" should be evaluated without compilation, e.g. all math functions
case (cache,env,(e as DAE.CALL(path = funcpath,expLst = expl,builtin = builtin)),vallst,impl,st,dim,msg)
Expand Down
5 changes: 2 additions & 3 deletions Compiler/Inst.mo
Expand Up @@ -2083,7 +2083,6 @@ algorithm
Env.Cache cache;
Real t1,t2,time; Boolean b;
Option<Absyn.ElementAttributes> oDA;
DAE.EqualityConstraint equalityConstraint;
CallingScope callscope;
ConnectionGraph.ConnectionGraph graph;
InstanceHierarchy ih;
Expand Down Expand Up @@ -2209,7 +2208,7 @@ algorithm
// Debug.fprint("insttr", implstr);
// Debug.fprintln("insttr", Env.printEnvPathStr(env) +& "." +& n +& " mods: " +& Mod.printModStr(mods));
// t1 = clock();
(cache,env_1,ih,store,dae,csets_1,ci_state_1,tys,bc,oDA,equalityConstraint,graph)
(cache,env_1,ih,store,dae,csets_1,ci_state_1,tys,bc,oDA,eqConstraint,graph)
= instClassdef(cache,env,ih,store, mods, pre, csets, ci_state, n,d, r, prot, inst_dims, impl, callscope, graph,instSingleCref,info);
// t2 = clock();
// time = t2 -. t1;
Expand All @@ -2218,7 +2217,7 @@ algorithm
// Debug.fprintln("insttr", " -> ICLASS " +& n +& " inst time: " +& s +& " in env: " +& Env.printEnvPathStr(env) +& " mods: " +& Mod.printModStr(mods));
cache = Env.addCachedEnv(cache,n,env_1);
then
(cache,env_1,ih,store,dae,csets_1,ci_state_1,tys,bc,oDA,equalityConstraint,graph);
(cache,env_1,ih,store,dae,csets_1,ci_state_1,tys,bc,oDA,eqConstraint,graph);

// failure
case (cache,env,ih,store,mods,pre,csets,ci_state,(c as SCode.CLASS(name = n,restriction = r,classDef = d)),prot,inst_dims,impl,_,graph,_)
Expand Down
3 changes: 1 addition & 2 deletions Compiler/Util.mo
Expand Up @@ -1069,8 +1069,7 @@ algorithm
case (array, func)
equation
true = intEq(0, arrayLength(array));
// apply listMap on the empty array
outArray = listArray(listMap(arrayList(array), func));
outArray = listArray({});
then
outArray;
// otherwise, use the first element to create the new array
Expand Down

0 comments on commit a4f9888

Please sign in to comment.