[obj2yaml] Use std::optional in elf2yaml.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 03:06:49 +0000 (19:06 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 03:06:49 +0000 (19:06 -0800)
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

llvm/tools/obj2yaml/elf2yaml.cpp

index 8363700..e4def74 100644 (file)
@@ -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;