OSDN Git Service

Build fixes for pdb-diff test.
authorZachary Turner <zturner@google.com>
Mon, 10 Jul 2017 17:01:28 +0000 (17:01 +0000)
committerZachary Turner <zturner@google.com>
Mon, 10 Jul 2017 17:01:28 +0000 (17:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307556 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-pdbutil/Diff.cpp

index 75e8f34..98e0a86 100644 (file)
@@ -101,8 +101,8 @@ struct BinaryPathProvider {
 
   SmallString<64> removeRoot(StringRef Path, bool IsRight) const {
     SmallString<64> Native(Path);
-    SmallString<64> Root =
-        IsRight ? opts::diff::RightRoot : opts::diff::LeftRoot;
+    auto &RootOpt = IsRight ? opts::diff::RightRoot : opts::diff::LeftRoot;
+    SmallString<64> Root(static_cast<std::string>(RootOpt));
     // pdb paths always use windows syntax, convert slashes to backslashes.
     sys::path::native(Root, sys::path::Style::windows);
     if (sys::path::has_stem(Root, sys::path::Style::windows))
@@ -449,7 +449,7 @@ diffOneModule(DiffPrinter &D,
 
   BinaryPathProvider PathProvider(28);
   auto Iter = llvm::find_if(
-      Other, [&Item, &PathProvider, ItemIsRight,
+      Other, [&PathProvider, ItemIsRight,
               L](const std::pair<uint32_t, DbiModuleDescriptor> &Other) {
         const auto *Left = L;
         const auto *Right = &Other;