Changeset 20893ab in OpenModelica


Ignore:
Timestamp:
2021-04-06T15:07:08+02:00 (3 years ago)
Author:
phannebohm <philip.hannebohm@…>
Children:
2d459fc8
Parents:
a94b02e4
Message:

Remove unused use of obsolete HashTable

Location:
OMCompiler/Compiler
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/NBackEnd/Modules/2_Pre/NBRemoveSimpleEquations.mo

    red22b43 r20893ab  
    22* This file is part of OpenModelica.
    33*
    4 * Copyright (c) 1998-2020, Open Source Modelica Consortium (OSMC),
     4* Copyright (c) 1998-2021, Open Source Modelica Consortium (OSMC),
    55* c/o Linköpings universitet, Department of Computer and Information Science,
    66* SE-58183 Linköping, Sweden.
     
    4646  import ComponentRef = NFComponentRef;
    4747  import Expression = NFExpression;
    48   import HashSet = NFHashSet;
    49   import HashTableCrToExp = NFHashTableCrToExp;
    5048  import Operator = NFOperator;
    5149  import Variable = NFVariable;
  • OMCompiler/Compiler/NBackEnd/NBReplacements.mo

    r6cc3f28b r20893ab  
    22* This file is part of OpenModelica.
    33*
    4 * Copyright (c) 1998-2020, Open Source Modelica Consortium (OSMC),
     4* Copyright (c) 1998-2021, Open Source Modelica Consortium (OSMC),
    55* c/o Linköpings universitet, Department of Computer and Information Science,
    66* SE-58183 Linköping, Sweden.
     
    5050  import Expression = NFExpression;
    5151  import NFFlatten.FunctionTreeImpl;
    52   import HashSet = NFHashSet;
    5352  import HashTableCrToExp = NFHashTableCrToExp;
    5453  import HashTableCrToLst = NFHashTable3;
     
    5857  // Backend imports
    5958  import BVariable = NBVariable;
    60   import EqData = NBEquation.EqData;
    61   import Equation = NBEquation.Equation;
    62   import EquationPointers = NBEquation.EquationPointers;
    63   import HashTableCrToCrEqLst = NBHashTableCrToCrEqLst;
     59  import NBEquation.{EqData, Equation, EquationPointers};
    6460  import Solve = NBSolve;
    6561  import StrongComponent = NBStrongComponent;
    66   import VarData = NBVariable.VarData;
    67   import VariablePointers = NBVariable.VariablePointers;
     62  import NBVariable.{VarData, VariablePointers};
    6863
    6964  // Util imports
     
    261256  function empty
    262257    "Returns an empty set of replacement rules"
    263     input Integer size = BaseHashTable.defaultBucketSize;
    264     input Boolean simple = false;
    265     output Replacements variableReplacements;
    266   protected
    267     HashTableCrToExp.HashTable replacements;
    268     HashTableCrToCrEqLst.HashTable groups;
    269   algorithm
    270     // ToDo: remove all those sized calls, they are just duplicate functions
    271     replacements := HashTableCrToExp.emptyHashTableSized(size);
    272     groups := HashTableCrToCrEqLst.emptyHashTableSized(size);
    273     variableReplacements := SIMPLE_REPLACEMENTS(replacements, groups);
    274   end empty;
    275 
    276   function add
    277     input output Replacements replacements;
    278     input Expression src                    "for simple replacements src and dst are not yet determined";
    279     input Expression dst;
    280     input Equation eqn;
    281   algorithm
    282     // new (a -> b), existing (b -> c)
    283     // new (a -> b), existing (a -> c) (FAIL or REPLACE?)
    284     // new (a -> b), existing (c -> a) (how to detect for f(.., a, ...)?)
    285     replacements := match replacements
    286       case SIMPLE_REPLACEMENTS() algorithm
    287       then replacements;
    288 
    289       else algorithm
    290         Error.addMessage(Error.INTERNAL_ERROR,{getInstanceName() + " failed adding replacement for expressions: "
    291         + "\n\t 1. " + Expression.toString(src) + "\n\t 2. " + Expression.toString(dst) + "\n In equation: \n\t"
    292         + Equation.toString(eqn)});
    293       then fail();
    294     end match;
    295   end add;
    296 
    297   function addStatic
    298     input output Replacements repl;
    299     input ComponentRef src;
    300     input Expression dst;
    301     input Equation eqn;
    302   algorithm
    303     repl := match repl
    304       case SIMPLE_REPLACEMENTS() guard(not BaseHashTable.hasKey(src, repl.replacements)) algorithm
    305         repl.replacements := BaseHashTable.add((src, dst), repl.replacements);
    306       then repl;
    307 
    308       // need forward replacement
    309 
    310       else algorithm
    311         Error.addMessage(Error.INTERNAL_ERROR,{getInstanceName() + " failed adding replacement for componentRef: "
    312         + "\n\t - " + ComponentRef.toString(src) + "\n In equation: \n\t" + Equation.toString(eqn)});
    313       then fail();
    314     end match;
    315 
    316   end addStatic;
    317 
    318   function empty
    319     "Returns an empty set of replacement rules"
    320258    output Replacements variableReplacements;
    321259    input Integer size = BaseHashTable.defaultBucketSize;
  • OMCompiler/Compiler/NBackEnd/NBSolve.mo

    refb3afa r20893ab  
    22* This file is part of OpenModelica.
    33*
    4 * Copyright (c) 1998-2020, Open Source Modelica Consortium (OSMC),
     4* Copyright (c) 1998-2021, Open Source Modelica Consortium (OSMC),
    55* c/o Linköpings universitet, Department of Computer and Information Science,
    66* SE-58183 Linköping, Sweden.
     
    4141  import ComponentRef = NFComponentRef;
    4242  import Expression = NFExpression;
    43   import FunctionTree = NFFlatten.FunctionTree;
     43  import NFFlatten.FunctionTree;
    4444  import Operator = NFOperator;
    4545  import SimplifyExp = NFSimplifyExp;
  • OMCompiler/Compiler/NBackEnd/NBStrongComponent.mo

    ree2d45b4 r20893ab  
    22* This file is part of OpenModelica.
    33*
    4 * Copyright (c) 1998-2020, Open Source Modelica Consortium (OSMC),
     4* Copyright (c) 1998-2021, Open Source Modelica Consortium (OSMC),
    55* c/o Linköpings universitet, Department of Computer and Information Science,
    66* SE-58183 Linköping, Sweden.
     
    5050  import NBEquation.Equation;
    5151  import NBEquation.EquationAttributes;
    52   import HashTableCrToCrLst = NBHashTableCrToCrLst;
    5352  import Matching = NBMatching;
    5453  import Tearing = NBTearing;
     
    255254  function getDependentCrefs
    256255    "Collects dependent crefs in current comp and saves them in the
    257     HashTable. Saves both directions."
     256     unordered map. Saves both directions."
    258257    input StrongComponent comp                    "strong component to be analyzed";
    259258    input UnorderedMap<ComponentRef, list<ComponentRef>> map "unordered map to save the dependencies";
  • OMCompiler/Compiler/NBackEnd/NBVariable.mo

    rc95dc3ca r20893ab  
    22* This file is part of OpenModelica.
    33*
    4 * Copyright (c) 1998-2020, Open Source Modelica Consortium (OSMC),
     4* Copyright (c) 1998-2021, Open Source Modelica Consortium (OSMC),
    55* c/o Linköpings universitet, Department of Computer and Information Science,
    66* SE-58183 Linköping, Sweden.
     
    4646  //NF Imports
    4747  import BackendExtension = NFBackendExtension;
    48   import BackendInfo = NFBackendExtension.BackendInfo;
    49   import Binding = NFBinding.Binding;
     48  import NFBackendExtension.BackendInfo;
     49  import NFBinding.Binding;
    5050  import Component = NFComponent;
    5151  import ComponentRef = NFComponentRef;
    5252  import Dimension = NFDimension;
    5353  import Expression = NFExpression;
    54   import InstNode = NFInstNode.InstNode;
     54  import NFInstNode.InstNode;
    5555  import Prefixes = NFPrefixes;
    5656  import Subscript = NFSubscript;
    5757  import Type = NFType;
    5858  import Variable = NFVariable;
    59   import VariableKind = NFBackendExtension.VariableKind;
     59  import NFBackendExtension.VariableKind;
    6060
    6161  // Backend Imports
     
    13131313    end getMarkedVars;
    13141314
    1315     function compress"O(n)
     1315    function compress "O(n)
    13161316      Reorders the elements in order to remove all the gaps.
    13171317      Be careful: This changes the indices of the elements.
     
    13381338            lastUsedIndex := lastUsedIndex-1;
    13391339          end while;
    1340           // udpate HashTable element
     1340          // udpate hash table element
    13411341          UnorderedMap.add(getVarName(moved_var), i, vars.map);
    13421342        end if;
  • OMCompiler/Compiler/boot/LoadCompilerSources.mos

    raddc6bc r20893ab  
    314314    "../NBackEnd/Util/NBGraphUtil.mo",
    315315    "../NBackEnd/Util/NBHashTableCrToCr.mo",
    316     "../NBackEnd/Util/NBHashTableCrToCrEqLst.mo",
    317316    "../NBackEnd/Util/NBHashTableCrToCrLst.mo",
    318317
Note: See TracChangeset for help on using the changeset viewer.