aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-02-23 14:48:40 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-02-23 14:48:40 +0000
commita789416a497b2e14e7c2fd721d03e541120bac8d (patch)
tree77dc531f50756d162a05a931adc9a28487dad83e /lib/Sema/SemaInit.cpp
parentc22adbd40ac2fc445e41fb664777179aa5c522e3 (diff)
Replace the std::map in the init list checker with a DenseMap to reduce malloc thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 31e4ecb939..55ab8dda36 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -173,7 +173,7 @@ class InitListChecker {
bool hadError;
bool VerifyOnly; // no diagnostics, no structure building
bool AllowBraceElision;
- std::map<InitListExpr *, InitListExpr *> SyntacticToSemantic;
+ llvm::DenseMap<InitListExpr *, InitListExpr *> SyntacticToSemantic;
InitListExpr *FullyStructuredList;
void CheckImplicitInitList(const InitializedEntity &Entity,
@@ -1632,7 +1632,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
// Determine the structural initializer list that corresponds to the
// current subobject.
- StructuredList = IsFirstDesignator? SyntacticToSemantic[IList]
+ StructuredList = IsFirstDesignator? SyntacticToSemantic.lookup(IList)
: getStructuredSubobjectInit(IList, Index, CurrentObjectType,
StructuredList, StructuredIndex,
SourceRange(D->getStartLocation(),
@@ -2046,7 +2046,7 @@ InitListChecker::getStructuredSubobjectInit(InitListExpr *IList, unsigned Index,
return 0; // No structured list in verification-only mode.
Expr *ExistingInit = 0;
if (!StructuredList)
- ExistingInit = SyntacticToSemantic[IList];
+ ExistingInit = SyntacticToSemantic.lookup(IList);
else if (StructuredIndex < StructuredList->getNumInits())
ExistingInit = StructuredList->getInit(StructuredIndex);