[llvm] 6bb9123 - DWARFYAML::emitDebugSections - fix use after std::move warnings. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 20 07:22:17 PDT 2020


Author: Simon Pilgrim
Date: 2020-09-20T14:42:36+01:00
New Revision: 6bb912336804822cc4b09f6849f1fd7d12057132

URL: https://github.com/llvm/llvm-project/commit/6bb912336804822cc4b09f6849f1fd7d12057132
DIFF: https://github.com/llvm/llvm-project/commit/6bb912336804822cc4b09f6849f1fd7d12057132.diff

LOG: 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.

Added: 
    

Modified: 
    llvm/lib/ObjectYAML/DWARFEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
index b634f7c123e8..eaf68dfdab3c 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<std::unique_ptr<MemoryBuffer>> DebugSections;
   Error Err = Error::success();
-  cantFail(std::move(Err));
 
   for (StringRef SecName : DI.getNonEmptySectionNames())
     Err = joinErrors(std::move(Err),


        


More information about the llvm-commits mailing list