Changeset d102cff in OpenModelica


Ignore:
Timestamp:
2013-04-12T19:17:55+02:00 (11 years ago)
Author:
Adrian Pop <adrian.pop@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
e8335829
Parents:
182b8deb
Message:
  • attempt to fix bug #2113, let's see how many tests we break.
  • is not 100% sure that the arguments to fill should not be known at compile time.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15804 f25d12d1-65f4-0310-ae8a-bbce733d8d8e

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Compiler/FrontEnd/Static.mo

    r1a7a9542 rd102cff  
    34373437    case (cache,env,(s :: dims),_,impl,pre,_)
    34383438      equation
    3439         (cache,s_1,prop,_) = elabExp(cache, env, s, impl,NONE(),true,pre,info);
    3440         (cache,dims_1,dimprops,_) = elabExpList(cache,env, dims, impl,NONE(),true,pre,info);
     3439        (cache,s_1,prop,_) = elabExp(cache, env, s, impl,NONE(), true, pre, info);
     3440        (cache,dims_1,dimprops,_) = elabExpList(cache, env, dims, impl, NONE(), true, pre, info);
    34413441        (dims_1,_) = Types.matchTypes(dims_1, List.map(dimprops,Types.getPropType), DAE.T_INTEGER_DEFAULT, false);
    34423442        c1 = Types.propertiesListToConst(dimprops);
     
    34443444        c1 = Types.constAnd(c1,Types.propAllConst(prop));
    34453445        sty = Types.getPropType(prop);
    3446         (cache,dimvals,_) = Ceval.cevalList(cache,env, dims_1, impl, NONE(), Ceval.NO_MSG());
    3447         (cache,exp,prop) = elabBuiltinFill2(cache,env, s_1, sty, dimvals,c1,pre);
    3448       then
    3449         (cache,exp,prop);
     3446        (cache,dimvals,_) = Ceval.cevalList(cache, env, dims_1, impl, NONE(), Ceval.NO_MSG());
     3447        (cache,exp,prop) = elabBuiltinFill2(cache, env, s_1, sty, dimvals, c1, pre);
     3448      then
     3449        (cache, exp, prop);
    34503450
    34513451    // If the previous case failed we probably couldn't constant evaluate the
    34523452    // dimensions. Create a function call to fill instead, and let the compiler sort it out later.
    3453     case (cache, env, (s :: dims), _, impl,pre,_)
     3453    case (cache, env, (s :: dims), _, impl, pre, _)
    34543454      equation
    34553455        c1 = unevaluatedFunctionVariability(env);
    3456         (cache, s_1, prop, _) = elabExp(cache, env, s, impl,NONE(), true,pre,info);
    3457         (cache, dims_1, dimprops, _) = elabExpList(cache, env, dims, impl, NONE(), true,pre,info);
     3456        (cache, s_1, prop, _) = elabExp(cache, env, s, impl,NONE(), true, pre, info);
     3457        (cache, dims_1, dimprops, _) = elabExpList(cache, env, dims, impl, NONE(), true, pre, info);
    34583458        (dims_1,_) = Types.matchTypes(dims_1, List.map(dimprops,Types.getPropType), DAE.T_INTEGER_DEFAULT, false);
    34593459        sty = Types.getPropType(prop);
     
    34673467    // Non-constant dimensons are also allowed in the case of non-expanded arrays
    34683468    // TODO: check that the diemnsions are parametric?
    3469     case (cache, env, (s :: dims), _, impl,pre,_)
     3469    case (cache, env, (s :: dims), _, impl, pre, _)
    34703470      equation
    34713471        false = Config.splitArrays();
    3472         (cache, s_1, DAE.PROP(sty, c1), _) = elabExp(cache, env, s, impl,NONE(), true,pre,info);
    3473         (cache, dims_1, dimprops, _) = elabExpList(cache, env, dims, impl,NONE(), true,pre,info);
     3472        (cache, s_1, DAE.PROP(sty, c1), _) = elabExp(cache, env, s, impl,NONE(), true, pre, info);
     3473        (cache, dims_1, dimprops, _) = elabExpList(cache, env, dims, impl,NONE(), true, pre, info);
    34743474        sty = makeFillArgListType(sty, dimprops);
    34753475        exp_type = Types.simplifyType(sty);
     
    43794379    case (cache,env,args,_,impl,pre,_)
    43804380      equation
    4381         (cache,e,p) = elabBuiltinFill(cache,env, (Absyn.INTEGER(0) :: args),{}, impl,pre,info);
     4381        (cache,e,p) = elabBuiltinFill(cache, env, (Absyn.INTEGER(0) :: args), {}, impl, pre, info);
    43824382      then
    43834383        (cache,e,p);
     
    43904390  input list<DAE.Properties> inProps;
    43914391  output Boolean res;
    4392 
    43934392protected
    43944393  list<DAE.Type> types;
     
    44064405  input Integer dimException;
    44074406  output Boolean res;
    4408 
    44094407protected
    44104408  list<DAE.Type> types;
     
    1410014098    case _ equation true = Env.inFunctionScope(inEnv); then DAE.C_VAR();
    1410114099    case _ equation true = Flags.getConfigBool(Flags.CHECK_MODEL); then DAE.C_UNKNOWN();
     14100    // bug #2113, seems that there is nothing in the specs
     14101    // that requires that fill arguments are of parameter/constant
     14102    // variability, so allow it.
     14103    else DAE.C_UNKNOWN();
    1410214104  end matchcontinue;
    1410314105end unevaluatedFunctionVariability;
Note: See TracChangeset for help on using the changeset viewer.