From: Zachary Turner Date: Wed, 14 Jun 2017 05:44:38 +0000 (+0000) Subject: Fix some more errors. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4b3feefd482d9249830379c7bc50638c4ff979a;p=llvm Fix some more errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305368 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp b/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp index aa5f3cca10f..e670ca923b0 100644 --- a/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp +++ b/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp @@ -399,7 +399,7 @@ std::shared_ptr YAMLChecksumsSubsection::toCodeViewSubsection( for (const auto &CS : Checksums) { Result->addChecksum(CS.FileName, CS.Kind, CS.ChecksumBytes.Bytes); } - return std::move(Result); + return Result; } std::shared_ptr YAMLLinesSubsection::toCodeViewSubsection( @@ -429,7 +429,7 @@ std::shared_ptr YAMLLinesSubsection::toCodeViewSubsection( } } } - return std::move(Result); + return Result; } std::shared_ptr @@ -450,7 +450,7 @@ YAMLInlineeLinesSubsection::toCodeViewSubsection( Result->addExtraFile(EF); } } - return std::move(Result); + return Result; } std::shared_ptr @@ -460,7 +460,7 @@ YAMLCrossModuleExportsSubsection::toCodeViewSubsection( auto Result = std::make_shared(); for (const auto &M : Exports) Result->addMapping(M.Local, M.Global); - return std::move(Result); + return Result; } std::shared_ptr @@ -475,7 +475,7 @@ YAMLCrossModuleImportsSubsection::toCodeViewSubsection( for (const auto Id : M.ImportIds) Result->addImport(M.ModuleName, Id); } - return std::move(Result); + return Result; } std::shared_ptr YAMLSymbolsSubsection::toCodeViewSubsection( @@ -485,7 +485,7 @@ std::shared_ptr YAMLSymbolsSubsection::toCodeViewSubsection( for (const auto &Sym : Symbols) Result->addSymbol( Sym.toCodeViewSymbol(Allocator, CodeViewContainer::ObjectFile)); - return std::move(Result); + return Result; } std::shared_ptr @@ -495,7 +495,7 @@ YAMLStringTableSubsection::toCodeViewSubsection( auto Result = std::make_shared(); for (const auto &Str : this->Strings) Result->insert(Str); - return std::move(Result); + return Result; } std::shared_ptr YAMLFrameDataSubsection::toCodeViewSubsection( @@ -517,7 +517,7 @@ std::shared_ptr YAMLFrameDataSubsection::toCodeViewSubsection( F.FrameFunc = SC.strings()->insert(YF.FrameFunc); Result->addFrameData(F); } - return std::move(Result); + return Result; } std::shared_ptr @@ -527,7 +527,7 @@ YAMLCoffSymbolRVASubsection::toCodeViewSubsection( auto Result = llvm::make_unique(); for (const auto &RVA : RVAs) Result->addRVA(RVA); - return std::move(Result); + return Result; } static Expected @@ -907,7 +907,7 @@ llvm::CodeViewYAML::fromDebugS(ArrayRef Data, auto YamlSS = Err(YAMLDebugSubsection::fromCodeViewSubection(SC, SS)); Result.push_back(YamlSS); } - return std::move(Result); + return Result; } void llvm::CodeViewYAML::initializeStringsAndChecksums( diff --git a/lib/ObjectYAML/CodeViewYAMLTypes.cpp b/lib/ObjectYAML/CodeViewYAMLTypes.cpp index aa8653d7e88..a03b9cd50fa 100644 --- a/lib/ObjectYAML/CodeViewYAMLTypes.cpp +++ b/lib/ObjectYAML/CodeViewYAMLTypes.cpp @@ -731,7 +731,7 @@ llvm::CodeViewYAML::fromDebugT(ArrayRef DebugT) { auto CVT = Err(LeafRecord::fromCodeViewRecord(T)); Result.push_back(CVT); } - return std::move(Result); + return Result; } ArrayRef llvm::CodeViewYAML::toDebugT(ArrayRef Leafs, diff --git a/tools/yaml2obj/yaml2coff.cpp b/tools/yaml2obj/yaml2coff.cpp index b41cc9a8f06..1f302fdc45a 100644 --- a/tools/yaml2obj/yaml2coff.cpp +++ b/tools/yaml2obj/yaml2coff.cpp @@ -29,33 +29,6 @@ using namespace llvm; -namespace { -template struct WeakishPtr { -public: - WeakishPtr() : Ref(nullptr) {} - - WeakishPtr(std::unique_ptr Value) - : Ref(Value.get()), UniquePtr(std::move(Value)) {} - - WeakishPtr(std::unique_ptr &&Value) - : Ref(Value.get()), UniquePtr(std::move(Value)) {} - - WeakishPtr &operator=(std::unique_ptr &&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 Owned; -}; -} // namespace - /// This parses a yaml stream that represents a COFF object file. /// See docs/yaml2obj for the yaml scheema. struct COFFParser {