[PCH] Use DenseMap instead of std::map to keep track of SwitchCases.

Part of rdar://11353109.

llvm-svn: 156185
This commit is contained in:
Argyrios Kyrtzidis 2012-05-04 18:17:30 +00:00
parent de613265c5
commit 566e40775b
3 changed files with 6 additions and 5 deletions

View 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.

View 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;

View 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));