[llvm] 23a884b - [obj2yaml] Use std::optional in elf2yaml.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 19:06:54 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T19:06:49-08:00
New Revision: 23a884bbeff22f19aceefd7a24e046de0d6fa73e

URL: https://github.com/llvm/llvm-project/commit/23a884bbeff22f19aceefd7a24e046de0d6fa73e
DIFF: https://github.com/llvm/llvm-project/commit/23a884bbeff22f19aceefd7a24e046de0d6fa73e.diff

LOG: [obj2yaml] Use std::optional in elf2yaml.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Added: 
    

Modified: 
    llvm/tools/obj2yaml/elf2yaml.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp
index 8363700df9f92..e4def747fb5bf 100644
--- a/llvm/tools/obj2yaml/elf2yaml.cpp
+++ b/llvm/tools/obj2yaml/elf2yaml.cpp
@@ -18,6 +18,7 @@
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/YAMLTraits.h"
+#include <optional>
 
 using namespace llvm;
 
@@ -32,7 +33,7 @@ class ELFDumper {
 
   DenseMap<StringRef, uint32_t> UsedSectionNames;
   std::vector<std::string> SectionNames;
-  Optional<uint32_t> ShStrTabIndex;
+  std::optional<uint32_t> ShStrTabIndex;
 
   DenseMap<StringRef, uint32_t> UsedSymbolNames;
   std::vector<std::string> SymbolNames;


        


More information about the llvm-commits mailing list