Skip to content

Commit

Permalink
- Removed the last remains of subscripted modifiers.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15726 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Apr 3, 2013
1 parent b23a898 commit 1c390b1
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 721 deletions.
6 changes: 0 additions & 6 deletions Compiler/FrontEnd/DAE.mo
Expand Up @@ -1136,12 +1136,6 @@ uniontype SubMod "-Sub Modification"
Ident ident "component name";
Mod mod "modification";
end NAMEMOD;

record IDXMOD "index modification, i.e. (x[2] = {1.0,3.0})"
list<Integer> integerLst "list of indexes";
Mod mod "modification";
end IDXMOD;

end SubMod;

public
Expand Down
5 changes: 0 additions & 5 deletions Compiler/FrontEnd/FDependency.mo
Expand Up @@ -1045,11 +1045,6 @@ algorithm
then
();

case (SCode.IDXMOD(subscriptLst = subs, an = m), (env, ty_env), _)
equation
analyseModifier(m, env, ty_env, inInfo);
then
();
end match;
end analyseSubMod;

Expand Down
6 changes: 0 additions & 6 deletions Compiler/FrontEnd/FFlattenImports.mo
Expand Up @@ -529,12 +529,6 @@ algorithm
then
SCode.NAMEMOD(ident, mod);

case (SCode.IDXMOD(subscriptLst = subs, an = mod), _, _)
equation
subs = List.map2(subs, flattenSubscript, inEnv, inInfo);
mod = flattenModifier(mod, inEnv, inInfo);
then
SCode.IDXMOD(subs, mod);
end match;
end flattenSubMod;

Expand Down
37 changes: 2 additions & 35 deletions Compiler/FrontEnd/Inst.mo
Expand Up @@ -5581,15 +5581,6 @@ algorithm
then
exps;

// handle indexmod
case (SCode.IDXMOD(an = mod)::rest)
equation
(e, sm) = getExpsFromMod(mod);
exps = getExpsFromSubMods(rest);
exps = listAppend(e, listAppend(sm, exps));
then
exps;

end match;
end getExpsFromSubMods;

Expand Down Expand Up @@ -7234,9 +7225,6 @@ algorithm
// and add it to the cache!
// (cache, _, _) = addRecordConstructorsToTheCache(cache, cenv, ih, mod_1, pre, ci_state, dir, cls, inst_dims);

// adrpo: 2010-09-28: check if the IDX mod doesn't overlap!
Mod.checkIdxModsForNoOverlap(mod_1, PrefixUtil.prefixAdd(name, {}, pre, vt, ci_state), info);

(cache, comp_env, ih, store, dae, csets, ty, graph_new) = instVar(cache,
cenv, ih, store, ci_state, mod_1, pre, name, cls, attr,
prefixes, dims, {}, inst_dims, impl, comment, info, graph, csets, env2);
Expand Down Expand Up @@ -7450,11 +7438,6 @@ algorithm
(cache,subs) = removeSelfModReferenceSubs(cache,id,subs);
then (cache,SCode.NAMEMOD(ident,mod)::subs);

case(cache,id,SCode.IDXMOD(idxs,mod)::subs)
equation
(cache,mod) = removeSelfModReference(cache,id,mod);
(cache,subs) = removeSelfModReferenceSubs(cache,id,subs);
then (cache,SCode.IDXMOD(idxs,mod)::subs);
end matchcontinue;
end removeSelfModReferenceSubs;

Expand Down Expand Up @@ -16082,12 +16065,6 @@ algorithm osubs:= matchcontinue(subs)
mod = traverseModAddFinal2(mod);
then
SCode.NAMEMOD(ident,mod)::rest;
case((SCode.IDXMOD(intList,mod))::rest )
equation
rest = traverseModAddFinal4(rest);
mod = traverseModAddFinal2(mod);
then
SCode.IDXMOD(intList, mod)::rest;
case(_)
equation print(" we failed with traverseModAddFinal4\n");
then fail();
Expand Down Expand Up @@ -16209,11 +16186,6 @@ algorithm
smods2 = traverseModAddDims5(cache,env,pre,smods,inExps,inExpOpts);
then
SCode.NAMEMOD(n,mod2)::smods2;
case (_,_,_,SCode.IDXMOD(an=_)::_,_,_)
equation
print("Cannot process IDXMOD in the case of non-expanded arrays");
then
fail();
end match;
end traverseModAddDims5;

Expand Down Expand Up @@ -16253,7 +16225,7 @@ protected function traverseModAddDims3
input list<Option<Absyn.Exp>> inExpOpts;
output list<SCode.SubMod> outMods;
algorithm
outMods := matchcontinue(inMods,inExps,inExpOpts)
outMods := match(inMods,inExps,inExpOpts)
local
SCode.Mod mod,mod2;
list<SCode.SubMod> smods,smods2;
Expand All @@ -16265,12 +16237,7 @@ algorithm
smods2 = traverseModAddDims3(smods,inExps,inExpOpts);
then
SCode.NAMEMOD(n,mod2)::smods2;
case (SCode.IDXMOD(an=_)::_,_,_)
equation
print("Cannot process IDXMOD in the case of non-expanded arrays");
then
fail();
end matchcontinue;
end match;
end traverseModAddDims3;

protected function insertSubsInTuple
Expand Down
7 changes: 0 additions & 7 deletions Compiler/FrontEnd/InstExtends.mo
Expand Up @@ -1621,13 +1621,6 @@ algorithm
then
(cache, SCode.NAMEMOD(ident, mod) :: rest_mods);

case (_, _, SCode.IDXMOD(subscriptLst = subs, an = mod) :: rest_mods, _)
equation
(cache, mod) = fixModifications(inCache, inEnv, mod, inHt);
(cache, rest_mods) = fixSubModList(cache, inEnv, rest_mods, inHt);
then
(cache, SCode.IDXMOD(subs, mod) :: rest_mods);

end match;
end fixSubModList;

Expand Down

0 comments on commit 1c390b1

Please sign in to comment.