From: Simon Pilgrim Date: Sun, 20 Sep 2020 13:42:36 +0000 (+0100) Subject: DWARFYAML::emitDebugSections - fix use after std::move warnings. NFCI. X-Git-Tag: llvmorg-13-init~11509 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bb912336804822cc4b09f6849f1fd7d12057132;p=platform%2Fupstream%2Fllvm.git DWARFYAML::emitDebugSections - fix use after std::move warnings. NFCI. We were using Err after it had been moved into cantFail - avoid this by calling cantFail with Error::success() directly. --- diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp index b634f7c..eaf68df 100644 --- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp +++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp @@ -1033,9 +1033,10 @@ DWARFYAML::emitDebugSections(StringRef YAMLString, bool IsLittleEndian, if (YIn.error()) return createStringError(YIn.error(), GeneratedDiag.getMessage()); + cantFail(Error::success()); + StringMap> DebugSections; Error Err = Error::success(); - cantFail(std::move(Err)); for (StringRef SecName : DI.getNonEmptySectionNames()) Err = joinErrors(std::move(Err),