From c55cf4afa9161bb4413b7ca9933d553327f5f069 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 10 Feb 2020 07:06:45 -0800 Subject: Revert "Remove redundant "std::move"s in return statements" The build failed with error: call to deleted constructor of 'llvm::Error' errors. This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2. --- llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp') diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp index 6584341..02f053b 100644 --- a/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp +++ b/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp @@ -694,11 +694,11 @@ YAMLStringTableSubsection::fromCodeViewSubsection( StringRef S; // First item is a single null string, skip it. if (auto EC = Reader.readCString(S)) - return EC; + return std::move(EC); assert(S.empty()); while (Reader.bytesRemaining() > 0) { if (auto EC = Reader.readCString(S)) - return EC; + return std::move(EC); Result->Strings.push_back(S); } return Result; @@ -749,7 +749,7 @@ llvm::CodeViewYAML::toCodeViewSubsectionList( const codeview::StringsAndChecksums &SC) { std::vector> Result; if (Subsections.empty()) - return Result; + return std::move(Result); for (const auto &SS : Subsections) { std::shared_ptr CVS; @@ -757,7 +757,7 @@ llvm::CodeViewYAML::toCodeViewSubsectionList( assert(CVS != nullptr); Result.push_back(std::move(CVS)); } - return Result; + return std::move(Result); } namespace { @@ -892,7 +892,7 @@ YAMLDebugSubsection::fromCodeViewSubection(const StringsAndChecksumsRef &SC, const DebugSubsectionRecord &SS) { SubsectionConversionVisitor V; if (auto EC = visitDebugSubsection(SS, V, SC)) - return EC; + return std::move(EC); return V.Subsection; } -- cgit v1.1