[llvm] r305368 - Fix some more errors.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 22:44:38 PDT 2017


Author: zturner
Date: Wed Jun 14 00:44:38 2017
New Revision: 305368

URL: http://llvm.org/viewvc/llvm-project?rev=305368&view=rev
Log:
Fix some more errors.

Modified:
    llvm/trunk/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
    llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypes.cpp
    llvm/trunk/tools/yaml2obj/yaml2coff.cpp

Modified: llvm/trunk/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp?rev=305368&r1=305367&r2=305368&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp Wed Jun 14 00:44:38 2017
@@ -399,7 +399,7 @@ std::shared_ptr<DebugSubsection> YAMLChe
   for (const auto &CS : Checksums) {
     Result->addChecksum(CS.FileName, CS.Kind, CS.ChecksumBytes.Bytes);
   }
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection> YAMLLinesSubsection::toCodeViewSubsection(
@@ -429,7 +429,7 @@ std::shared_ptr<DebugSubsection> YAMLLin
       }
     }
   }
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection>
@@ -450,7 +450,7 @@ YAMLInlineeLinesSubsection::toCodeViewSu
       Result->addExtraFile(EF);
     }
   }
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection>
@@ -460,7 +460,7 @@ YAMLCrossModuleExportsSubsection::toCode
   auto Result = std::make_shared<DebugCrossModuleExportsSubsection>();
   for (const auto &M : Exports)
     Result->addMapping(M.Local, M.Global);
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection>
@@ -475,7 +475,7 @@ YAMLCrossModuleImportsSubsection::toCode
     for (const auto Id : M.ImportIds)
       Result->addImport(M.ModuleName, Id);
   }
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection> YAMLSymbolsSubsection::toCodeViewSubsection(
@@ -485,7 +485,7 @@ std::shared_ptr<DebugSubsection> YAMLSym
   for (const auto &Sym : Symbols)
     Result->addSymbol(
         Sym.toCodeViewSymbol(Allocator, CodeViewContainer::ObjectFile));
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection>
@@ -495,7 +495,7 @@ YAMLStringTableSubsection::toCodeViewSub
   auto Result = std::make_shared<DebugStringTableSubsection>();
   for (const auto &Str : this->Strings)
     Result->insert(Str);
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection> YAMLFrameDataSubsection::toCodeViewSubsection(
@@ -517,7 +517,7 @@ std::shared_ptr<DebugSubsection> YAMLFra
     F.FrameFunc = SC.strings()->insert(YF.FrameFunc);
     Result->addFrameData(F);
   }
-  return std::move(Result);
+  return Result;
 }
 
 std::shared_ptr<DebugSubsection>
@@ -527,7 +527,7 @@ YAMLCoffSymbolRVASubsection::toCodeViewS
   auto Result = llvm::make_unique<DebugSymbolRVASubsection>();
   for (const auto &RVA : RVAs)
     Result->addRVA(RVA);
-  return std::move(Result);
+  return Result;
 }
 
 static Expected<SourceFileChecksumEntry>
@@ -907,7 +907,7 @@ llvm::CodeViewYAML::fromDebugS(ArrayRef<
     auto YamlSS = Err(YAMLDebugSubsection::fromCodeViewSubection(SC, SS));
     Result.push_back(YamlSS);
   }
-  return std::move(Result);
+  return Result;
 }
 
 void llvm::CodeViewYAML::initializeStringsAndChecksums(

Modified: llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypes.cpp?rev=305368&r1=305367&r2=305368&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypes.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypes.cpp Wed Jun 14 00:44:38 2017
@@ -731,7 +731,7 @@ llvm::CodeViewYAML::fromDebugT(ArrayRef<
     auto CVT = Err(LeafRecord::fromCodeViewRecord(T));
     Result.push_back(CVT);
   }
-  return std::move(Result);
+  return Result;
 }
 
 ArrayRef<uint8_t> llvm::CodeViewYAML::toDebugT(ArrayRef<LeafRecord> Leafs,

Modified: llvm/trunk/tools/yaml2obj/yaml2coff.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2coff.cpp?rev=305368&r1=305367&r2=305368&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2coff.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2coff.cpp Wed Jun 14 00:44:38 2017
@@ -29,33 +29,6 @@
 
 using namespace llvm;
 
-namespace {
-template <typename T> struct WeakishPtr {
-public:
-  WeakishPtr() : Ref(nullptr) {}
-
-  WeakishPtr(std::unique_ptr<T> Value)
-      : Ref(Value.get()), UniquePtr(std::move(Value)) {}
-
-  WeakishPtr(std::unique_ptr<T> &&Value)
-      : Ref(Value.get()), UniquePtr(std::move(Value)) {}
-
-  WeakishPtr<T> &operator=(std::unique_ptr<T> &&Value) {
-    Owned = std::move(Value);
-    Ref = Owned.get();
-    return *this;
-  }
-
-  T *get() { return Ref; }
-  T &operator*() { return *Ref; }
-
-  operator bool() const { return Ref != nullptr; }
-
-  T *Ref;
-  std::unique_ptr<T> Owned;
-};
-} // namespace
-
 /// This parses a yaml stream that represents a COFF object file.
 /// See docs/yaml2obj for the yaml scheema.
 struct COFFParser {




More information about the llvm-commits mailing list