[AST] Don't use make_pointee_iterator in VTableBuilder.
authorJustin Lebar <jlebar@google.com>
Mon, 10 Oct 2016 19:26:22 +0000 (19:26 +0000)
committerJustin Lebar <jlebar@google.com>
Mon, 10 Oct 2016 19:26:22 +0000 (19:26 +0000)
Our implementation of make_pointee_iterator seems to be causing MSVC
2015 to crash, so I'm going to remove it.

llvm-svn: 283790

clang/lib/AST/VTableBuilder.cpp

index e4d51ee..46308c2 100644 (file)
@@ -3361,9 +3361,10 @@ 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(
-      llvm::make_pointee_iterator(Paths.begin()),
-      llvm::make_pointee_iterator(Paths.end()));
+  llvm::SmallVector<std::reference_wrapper<VPtrInfo>, 2> PathsSorted;
+  PathsSorted.reserve(Paths.size());
+  for (auto& P : Paths)
+    PathsSorted.push_back(*P);
   std::sort(PathsSorted.begin(), PathsSorted.end(),
             [](const VPtrInfo &LHS, const VPtrInfo &RHS) {
     return LHS.MangledPath < RHS.MangledPath;