Skip to content

Commit

Permalink
- small improvements
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20569 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed May 12, 2014
1 parent 0f01294 commit b0b5631
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Compiler/FrontEnd/InstFunction.mo
Expand Up @@ -446,7 +446,8 @@ algorithm
Inst.instClass(cache, env, ih, UnitAbsynBuilder.emptyInstStore(), mod, pre,
c, inst_dims, true, cs, ConnectionGraph.EMPTY, Connect.emptySet);
List.map2_0(daeElts,InstUtil.checkFunctionElement,false,info);
env_1 = Env.extendFrameC(env,c);
// do not add the stripped class to the env, is already there!
env_1 = env; // Env.extendFrameC(env,c);
(cache,fpath) = Inst.makeFullyQualified(cache, env_1, Absyn.IDENT(n));
cmt = InstUtil.extractClassDefComment(cache, env, cd, cmt);
derFuncs = InstUtil.getDeriveAnnotation(cd, cmt,fpath,cache,cenv,ih,pre,info);
Expand Down
16 changes: 3 additions & 13 deletions Compiler/FrontEnd/InstUtil.mo
Expand Up @@ -2330,29 +2330,19 @@ algorithm
String s;
SCode.Comment cmt;
SCode.Replaceable rpp;
DAE.Mod m;

// we do have a redeclaration of class.
case (env,ih,pre,( (sel1 as SCode.CLASS(name = _))),_,SOME(_))
case (env,ih,pre,( (sel1 as SCode.CLASS(name = _))),_,SOME(m))
equation
// extend first
false = valueEq(m, DAE.NOMOD());
env_1 = Env.extendFrameC(env, sel1);
// call to redeclareType which calls updateComponents in env wich updates the class frame
(env_1,ih,cl2) = addClassdefsToEnv3(env_1, ih, pre, redeclareMod, sel1);
ih = InnerOuter.addClassIfInner(cl2, pre, env_1, ih);
then
(env_1,ih);

// we do have a replaceable class?.
case (env,ih,_,(SCode.CLASS(name = s, prefixes = SCode.PREFIXES(replaceablePrefix = rpp))),_,_)
equation
// we have a replaceable class
true = SCode.replaceableBool(rpp);
// search first in env if we already have a redeclare definition for it!!
(_, SCode.CLASS(prefixes = SCode.PREFIXES(redeclarePrefix = SCode.REDECLARE())), _) = Lookup.lookupClass(Env.emptyCache(), env, Absyn.IDENT(s), false);
// do nothing, just move along!
then
(env,ih);

// otherwise, extend frame with in class.
case (env,ih,pre,(sel1 as SCode.CLASS(classDef = _)),_,_)
equation
Expand Down

0 comments on commit b0b5631

Please sign in to comment.