diff options
Diffstat (limited to 'clang/lib/AST/VTableBuilder.cpp')
| -rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index 24586d6b70d4..3d64cb17fa9c 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -17,6 +17,7 @@ #include "clang/AST/RecordLayout.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/SetOperations.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" @@ -3113,8 +3114,7 @@ static void dumpMicrosoftThunkAdjustment(const ThunkInfo &TI, raw_ostream &Out, if (!ContinueFirstLine) Out << LinePrefix; Out << "[return adjustment (to type '" - << TI.Method->getReturnType().getCanonicalType().getAsString() - << "'): "; + << TI.Method->getReturnType().getCanonicalType() << "'): "; if (R.Virtual.Microsoft.VBPtrOffset) Out << "vbptr at offset " << R.Virtual.Microsoft.VBPtrOffset << ", "; if (R.Virtual.Microsoft.VBIndex) @@ -3384,10 +3384,8 @@ static bool rebucketPaths(VPtrInfoVector &Paths) { // sorted vector to implement a multiset to form the buckets. Note that the // ordering is based on pointers, but it doesn't change our output order. The // current algorithm is designed to match MSVC 2012's names. - llvm::SmallVector<std::reference_wrapper<VPtrInfo>, 2> PathsSorted; - PathsSorted.reserve(Paths.size()); - for (auto& P : Paths) - PathsSorted.push_back(*P); + llvm::SmallVector<std::reference_wrapper<VPtrInfo>, 2> PathsSorted( + llvm::make_pointee_range(Paths)); llvm::sort(PathsSorted, [](const VPtrInfo &LHS, const VPtrInfo &RHS) { return LHS.MangledPath < RHS.MangledPath; }); |
