]> granicus.if.org Git - clang/commitdiff
[PCH] Use DenseMap instead of std::map to keep track of SwitchCases.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 4 May 2012 18:17:30 +0000 (18:17 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 4 May 2012 18:17:30 +0000 (18:17 +0000)
Part of rdar://11353109.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156185 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTReader.h
include/clang/Serialization/ASTWriter.h
lib/Serialization/ASTReaderDecl.cpp

index 11e237e5b50f3d48be53a8a7203ec35eab454107..d9af6d74af2706b1f7f93914b7dbd6523fcbf039 100644 (file)
@@ -591,13 +591,14 @@ private:
   /// indicates how many separate module file load operations have occurred.
   unsigned CurrentGeneration;
 
+  typedef llvm::DenseMap<unsigned, SwitchCase *> SwitchCaseMapTy;
   /// \brief Mapping from switch-case IDs in the chain to switch-case statements
   ///
   /// Statements usually don't have IDs, but switch cases need them, so that the
   /// switch statement can refer to them.
-  std::map<unsigned, SwitchCase *> SwitchCaseStmts;
+  SwitchCaseMapTy SwitchCaseStmts;
 
-  std::map<unsigned, SwitchCase *> *CurrSwitchCaseStmts;
+  SwitchCaseMapTy *CurrSwitchCaseStmts;
 
   /// \brief The number of stat() calls that hit/missed the stat
   /// cache.
index e693f17593f99fc3d426325632ff8b86dff609ec..16c3766f8fc228021c593db7396e37676ef290c1 100644 (file)
@@ -337,7 +337,7 @@ private:
   SmallVector<Stmt *, 16> *CollectedStmts;
 
   /// \brief Mapping from SwitchCase statements to IDs.
-  std::map<SwitchCase *, unsigned> SwitchCaseIDs;
+  llvm::DenseMap<SwitchCase *, unsigned> SwitchCaseIDs;
 
   /// \brief The number of statements written to the AST file.
   unsigned NumStatements;
index dc315f095c03cb61e43b3a74958999869e15c08b..1c5b6584699e1ecd92f09f126aa52a1bceae3683 100644 (file)
@@ -631,8 +631,8 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
     // In practice, this won't be executed (since method definitions
     // don't occur in header files).
     // Switch case IDs for this method body.
-    std::map<unsigned, SwitchCase *> SwitchCaseStmtsForObjCMethod;
-    SaveAndRestore<std::map<unsigned, SwitchCase *> *>
+    ASTReader::SwitchCaseMapTy SwitchCaseStmtsForObjCMethod;
+    SaveAndRestore<ASTReader::SwitchCaseMapTy *>
       SCFOM(Reader.CurrSwitchCaseStmts, &SwitchCaseStmtsForObjCMethod);
     MD->setBody(Reader.ReadStmt(F));
     MD->setSelfDecl(ReadDeclAs<ImplicitParamDecl>(Record, Idx));