diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-23 14:48:40 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-23 14:48:40 +0000 |
commit | 6b441d62e9d22e3ebd81e232c1755ff42a5bf54c (patch) | |
tree | f3cccb0b918d6a5546052a3498d1e27ff596dbec /clang | |
parent | d53aa39f464a07983f9ea9e6765895b08bd3c189 (diff) | |
download | bcm5719-llvm-6b441d62e9d22e3ebd81e232c1755ff42a5bf54c.tar.gz bcm5719-llvm-6b441d62e9d22e3ebd81e232c1755ff42a5bf54c.zip |
Replace the std::map in the init list checker with a DenseMap to reduce malloc thrashing.
llvm-svn: 151254
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 31e4ecb939b..55ab8dda364 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/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); |