diff options
| author | Craig Topper <craig.topper@gmail.com> | 2013-07-05 04:33:53 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2013-07-05 04:33:53 +0000 |
| commit | 79be4cdd2d5a7c9c686ed630b154a560fa39779e (patch) | |
| tree | 2a64af74988dbeb85876e585f74a6b3d5605b8d3 /clang/lib | |
| parent | 46312e8e72e34c9aa8585e584c002937c5098572 (diff) | |
| download | bcm5719-llvm-79be4cdd2d5a7c9c686ed630b154a560fa39779e.tar.gz bcm5719-llvm-79be4cdd2d5a7c9c686ed630b154a560fa39779e.zip | |
Add typedefs for Densemaps containing SmallVectors to avoid repeating the SmallVector size when creating iterators for the DenseMap.
llvm-svn: 185682
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaTemplateDeduction.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 18 |
3 files changed, 12 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d2f784c1d5b..a23e0507628 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -255,7 +255,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, if (getLangOpts().CPlusPlus && isa<FunctionDecl>(D)) { // If there were any diagnostics suppressed by template argument deduction, // emit them now. - llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >::iterator + SuppressedDiagnosticsMap::iterator Pos = SuppressedDiagnostics.find(D->getCanonicalDecl()); if (Pos != SuppressedDiagnostics.end()) { SmallVectorImpl<PartialDiagnosticAt> &Suppressed = Pos->second; diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 0fd29ea4496..0d17c878ac3 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -2795,7 +2795,7 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate, // keep track of these diagnostics. They'll be emitted if this specialization // is actually used. if (Info.diag_begin() != Info.diag_end()) { - llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >::iterator + SuppressedDiagnosticsMap::iterator Pos = SuppressedDiagnostics.find(Specialization->getCanonicalDecl()); if (Pos == SuppressedDiagnostics.end()) SuppressedDiagnostics[Specialization->getCanonicalDecl()] diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 052bef9e5be..171b053f2f7 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -5871,7 +5871,9 @@ namespace { void ASTReader::completeVisibleDeclsMap(const DeclContext *DC) { if (!DC->hasExternalVisibleStorage()) return; - llvm::DenseMap<DeclarationName, SmallVector<NamedDecl *, 8> > Decls; + typedef llvm::DenseMap<DeclarationName, SmallVector<NamedDecl *, 8> > + DeclsMap; + DeclsMap Decls; // Compute the declaration contexts we need to look into. Multiple such // declaration contexts occur when two declaration contexts from disjoint @@ -5894,9 +5896,7 @@ void ASTReader::completeVisibleDeclsMap(const DeclContext *DC) { ModuleMgr.visit(&DeclContextAllNamesVisitor::visit, &Visitor); ++NumVisibleDeclContextsRead; - for (llvm::DenseMap<DeclarationName, - SmallVector<NamedDecl *, 8> >::iterator - I = Decls.begin(), E = Decls.end(); I != E; ++I) { + for (DeclsMap::iterator I = Decls.begin(), E = Decls.end(); I != E; ++I) { SetExternalVisibleDeclsForName(DC, I->first, I->second); } const_cast<DeclContext *>(DC)->setHasExternalVisibleStorage(false); @@ -7298,7 +7298,10 @@ void ASTReader::finishPendingActions() { !PendingMacroIDs.empty() || !PendingDeclContextInfos.empty()) { // If any identifiers with corresponding top-level declarations have // been loaded, load those declarations now. - llvm::DenseMap<IdentifierInfo *, SmallVector<Decl *, 2> > TopLevelDecls; + typedef llvm::DenseMap<IdentifierInfo *, SmallVector<Decl *, 2> > + TopLevelDeclsMap; + TopLevelDeclsMap TopLevelDecls; + while (!PendingIdentifierInfos.empty()) { // FIXME: std::move IdentifierInfo *II = PendingIdentifierInfos.back().first; @@ -7316,9 +7319,8 @@ void ASTReader::finishPendingActions() { PendingDeclChains.clear(); // Make the most recent of the top-level declarations visible. - for (llvm::DenseMap<IdentifierInfo *, SmallVector<Decl *, 2> >::iterator - TLD = TopLevelDecls.begin(), TLDEnd = TopLevelDecls.end(); - TLD != TLDEnd; ++TLD) { + for (TopLevelDeclsMap::iterator TLD = TopLevelDecls.begin(), + TLDEnd = TopLevelDecls.end(); TLD != TLDEnd; ++TLD) { IdentifierInfo *II = TLD->first; for (unsigned I = 0, N = TLD->second.size(); I != N; ++I) { pushExternalDeclIntoScope(cast<NamedDecl>(TLD->second[I]), II); |

