[llvm-gsymutil] Use std::optional in llvm-gsymutil.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 10 Dec 2022 16:31:15 +0000 (08:31 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 10 Dec 2022 16:31:15 +0000 (08:31 -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/llvm-gsymutil/llvm-gsymutil.cpp

index be131d4..d409493 100644 (file)
@@ -41,6 +41,7 @@
 #include "llvm/DebugInfo/GSYM/InlineInfo.h"
 #include "llvm/DebugInfo/GSYM/LookupResult.h"
 #include "llvm/DebugInfo/GSYM/ObjectFileTransformer.h"
+#include <optional>
 
 using namespace llvm;
 using namespace gsym;
@@ -480,7 +481,7 @@ int main(int argc, char const *argv[]) {
 
     std::string InputLine;
     std::string CurrentGSYMPath;
-    llvm::Optional<Expected<GsymReader>> CurrentGsym;
+    std::optional<Expected<GsymReader>> CurrentGsym;
 
     while (std::getline(std::cin, InputLine)) {
       // Strip newline characters.