diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Sema/Sema.h | 3 | ||||
-rw-r--r-- | clang/include/clang/Serialization/ASTReader.h | 6 | ||||
-rw-r--r-- | clang/lib/AST/RecordLayoutBuilder.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 7 |
4 files changed, 9 insertions, 9 deletions
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 7e5dcbdb96b..0ec99701b3c 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -47,6 +47,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/MC/MCParser/MCAsmParser.h" #include <deque> #include <memory> @@ -840,7 +841,7 @@ public: /// \brief The number of SFINAE diagnostics that have been trapped. unsigned NumSFINAEErrors; - typedef llvm::DenseMap<ParmVarDecl *, SmallVector<ParmVarDecl *, 1> > + typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>> UnparsedDefaultArgInstantiationsMap; /// \brief A mapping from parameters with unparsed default arguments to the diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h index 32bec0b2d70..807e732510e 100644 --- a/clang/include/clang/Serialization/ASTReader.h +++ b/clang/include/clang/Serialization/ASTReader.h @@ -34,12 +34,12 @@ #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APSInt.h" -#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/MapVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Support/DataTypes.h" #include <deque> @@ -965,7 +965,7 @@ private: llvm::SmallVector<NamedDecl *, 16> PendingOdrMergeChecks; /// \brief Record definitions in which we found an ODR violation. - llvm::SmallDenseMap<CXXRecordDecl*, llvm::SmallVector<CXXRecordDecl*, 1>, 2> + llvm::SmallDenseMap<CXXRecordDecl *, llvm::TinyPtrVector<CXXRecordDecl *>, 2> PendingOdrMergeFailures; /// \brief DeclContexts in which we have diagnosed an ODR violation. @@ -1826,7 +1826,7 @@ public: void installImportedMacro(IdentifierInfo *II, ModuleMacroInfo *MMI, Module *Owner); - typedef llvm::SmallVector<DefMacroDirective*, 1> AmbiguousMacros; + typedef llvm::TinyPtrVector<DefMacroDirective *> AmbiguousMacros; llvm::DenseMap<IdentifierInfo*, AmbiguousMacros> AmbiguousMacroDefs; void diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp index 5eb87e7fc75..4567488bc18 100644 --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -65,7 +65,7 @@ class EmptySubobjectMap { const CXXRecordDecl *Class; /// EmptyClassOffsets - A map from offsets to empty record decls. - typedef SmallVector<const CXXRecordDecl *, 1> ClassVectorTy; + typedef llvm::TinyPtrVector<const CXXRecordDecl *> ClassVectorTy; typedef llvm::DenseMap<CharUnits, ClassVectorTy> EmptyClassOffsetsMapTy; EmptyClassOffsetsMapTy EmptyClassOffsets; diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 31b649f16e1..b6b09138116 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1915,7 +1915,7 @@ ASTReader::removeOverriddenMacros(IdentifierInfo *II, AmbiguousMacroDefs.erase(II); } else { // There's no ambiguity yet. Maybe we're introducing one. - llvm::SmallVector<DefMacroDirective*, 1> Ambig; + AmbiguousMacros Ambig; if (PrevDef) Ambig.push_back(PrevDef); @@ -1923,7 +1923,7 @@ ASTReader::removeOverriddenMacros(IdentifierInfo *II, if (!Ambig.empty()) { AmbiguousMacros &Result = AmbiguousMacroDefs[II]; - Result.swap(Ambig); + std::swap(Result, Ambig); return &Result; } } @@ -1946,10 +1946,9 @@ void ASTReader::installImportedMacro(IdentifierInfo *II, ModuleMacroInfo *MMI, assert(ImportLoc.isValid() && "no import location for a visible macro?"); } - llvm::SmallVectorImpl<DefMacroDirective*> *Prev = + AmbiguousMacros *Prev = removeOverriddenMacros(II, MMI->getOverriddenSubmodules()); - // Create a synthetic macro definition corresponding to the import (or null // if this was an undefinition of the macro). DefMacroDirective *MD = MMI->import(PP, ImportLoc); |