[llvm-ifs] Use std::optional in llvm-ifs.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 02:51:35 +0000 (18:51 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 02:51:35 +0000 (18:51 -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-ifs/llvm-ifs.cpp

index 4a0c1c9..646d4df 100644 (file)
@@ -32,6 +32,7 @@
 #include "llvm/TextAPI/InterfaceFile.h"
 #include "llvm/TextAPI/TextAPIReader.h"
 #include "llvm/TextAPI/TextAPIWriter.h"
+#include <optional>
 #include <set>
 #include <string>
 #include <vector>
@@ -86,7 +87,7 @@ struct DriverConfig {
   Optional<FileFormat> InputFormat;
   Optional<FileFormat> OutputFormat;
 
-  Optional<std::string> HintIfsTarget;
+  std::optional<std::string> HintIfsTarget;
   Optional<std::string> OptTargetTriple;
   Optional<IFSArch> OverrideArch;
   Optional<IFSBitWidthType> OverrideBitWidth;
@@ -102,12 +103,12 @@ struct DriverConfig {
 
   std::vector<std::string> Exclude;
 
-  Optional<std::string> SoName;
+  std::optional<std::string> SoName;
 
-  Optional<std::string> Output;
-  Optional<std::string> OutputElf;
-  Optional<std::string> OutputIfs;
-  Optional<std::string> OutputTbd;
+  std::optional<std::string> Output;
+  std::optional<std::string> OutputElf;
+  std::optional<std::string> OutputIfs;
+  std::optional<std::string> OutputTbd;
 
   bool WriteIfChanged = false;
 };