Changeset 1690778


Ignore:
Timestamp:
May 1, 2019, 7:49:16 AM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
3908e5d
Parents:
98d4df9
Message:

change from map/set to unordered map/set

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/RenameVars.cc

    r98d4df9 r1690778  
    1010// Created On       : Sun May 17 12:05:18 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:36:32 2016
    13 // Update Count     : 5
     12// Last Modified On : Tue Apr 30 17:07:57 2019
     13// Update Count     : 7
    1414//
    1515
     
    3939                  private:
    4040                        int level, resetCount;
    41                         std::list< std::map< std::string, std::string > > mapStack;
     41                        std::list< std::unordered_map< std::string, std::string > > mapStack;
    4242                };
    4343
     
    5555        namespace {
    5656                RenameVars::RenameVars() : level( 0 ), resetCount( 0 ) {
    57                         mapStack.push_front( std::map< std::string, std::string >() );
     57                        mapStack.push_front( std::unordered_map< std::string, std::string >() );
    5858                }
    5959
     
    6565                void RenameVars::previsit( TypeInstType * instType ) {
    6666                        previsit( (Type *)instType );
    67                         std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->name );
     67                        std::unordered_map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->name );
    6868                        if ( i != mapStack.front().end() ) {
    6969                                instType->name = i->second;
  • src/ResolvExpr/TypeEnvironment.h

    r98d4df9 r1690778  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:24:58 2015
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Mon Jun 18 11:58:00 2018
    13 // Update Count     : 4
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Apr 30 23:04:10 2019
     13// Update Count     : 9
    1414//
    1515
     
    1818#include <iostream>                    // for ostream
    1919#include <list>                        // for list, list<>::iterator, list<>...
    20 #include <map>                         // for map, map<>::value_compare
    21 #include <set>                         // for set
     20#include <map>                                             // for map, map<>::value_compare
     21#include <unordered_map>
     22#include <set>                                             // for set
    2223#include <string>                      // for string
    2324#include <utility>                     // for move, swap
     
    6465                AssertionSetValue() : isUsed(false), resnSlot(0) {}
    6566        };
    66         typedef std::map< DeclarationWithType*, AssertionSetValue, AssertCompare > AssertionSet;
    67         typedef std::map< std::string, TypeDecl::Data > OpenVarSet;
     67        typedef std::map< DeclarationWithType *, AssertionSetValue, AssertCompare > AssertionSet;
     68        typedef std::unordered_map< std::string, TypeDecl::Data > OpenVarSet;
    6869
    6970        /// merges one set of open vars into another
  • src/SynTree/Declaration.h

    r98d4df9 r1690778  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Sep  3 19:24:06 2017
    13 // Update Count     : 131
     12// Last Modified On : Wed May  1 07:46:49 2019
     13// Update Count     : 134
    1414//
    1515
     
    1919#include <iosfwd>                // for ostream
    2020#include <list>                  // for list
     21#include <unordered_map>         // for unordered_map
    2122#include <string>                // for string, operator+, allocator, to_string
    2223
     
    334335        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    335336  private:
    336         std::map< std::string, long long int > enumValues;
     337        std::unordered_map< std::string, long long int > enumValues;
    337338        virtual std::string typeString() const override;
    338339};
  • src/SynTree/TypeSubstitution.h

    r98d4df9 r1690778  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:52:24 2017
    13 // Update Count     : 3
     12// Last Modified On : Tue Apr 30 22:52:47 2019
     13// Update Count     : 9
    1414//
    1515
     
    1919#include <iosfwd>                  // for ostream
    2020#include <list>                    // for list<>::iterator, _List_iterator
    21 #include <map>                     // for _Rb_tree_iterator, map, map<>::val...
    22 #include <set>                     // for set
     21#include <unordered_map>
     22#include <unordered_set>
    2323#include <string>                  // for string, operator!=
    2424#include <utility>                 // for pair
     
    7878        friend class PassVisitor;
    7979
    80         typedef std::map< std::string, Type* > TypeEnvType;
    81         typedef std::map< std::string, Expression* > VarEnvType;
     80        typedef std::unordered_map< std::string, Type * > TypeEnvType;
     81        typedef std::unordered_map< std::string, Expression * > VarEnvType;
    8282        TypeEnvType typeEnv;
    8383        VarEnvType varEnv;
     
    9898        ActualIterator actualIt = actualBegin;
    9999        for ( ; formalIt != formalEnd; ++formalIt, ++actualIt ) {
    100                 if ( TypeDecl *formal = dynamic_cast< TypeDecl* >( *formalIt ) ) {
    101                         if ( TypeExpr *actual = dynamic_cast< TypeExpr* >( *actualIt ) ) {
     100                if ( TypeDecl *formal = dynamic_cast< TypeDecl * >( *formalIt ) ) {
     101                        if ( TypeExpr *actual = dynamic_cast< TypeExpr * >( *actualIt ) ) {
    102102                                if ( formal->get_name() != "" ) {
    103103                                        TypeEnvType::iterator i = typeEnv.find( formal->get_name() );
     
    146146                int subCount = 0;
    147147                bool freeOnly;
    148                 typedef std::set< std::string > BoundVarsType;
     148                typedef std::unordered_set< std::string > BoundVarsType;
    149149                BoundVarsType boundVars;
    150150};
Note: See TracChangeset for help on using the changeset viewer.