diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-04 18:17:30 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-04 18:17:30 +0000 |
commit | 12dcc64eebf7aaffb71392fba74fcb69f35d3b2e (patch) | |
tree | 14b4e0e12a7d66df7373255cb11db634d4a56ca0 | |
parent | 84d43848e39eab9e3386cbfb3906ba2d6a382f24 (diff) |
[PCH] Use DenseMap instead of std::map to keep track of SwitchCases.
Part of rdar://11353109.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156185 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 5 | ||||
-rw-r--r-- | include/clang/Serialization/ASTWriter.h | 2 | ||||
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 11e237e5b5..d9af6d74af 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -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. diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index e693f17593..16c3766f8f 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -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; diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index dc315f095c..1c5b658469 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -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)); |