[Support] Use std::optional in ToolOutputFile.h (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:16:11 +0000 (14:16 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:16:11 +0000 (14:16 -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/include/llvm/Support/ToolOutputFile.h

index 9930e0b..00625b5 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/raw_ostream.h"
+#include <optional>
 
 namespace llvm {
 
@@ -43,7 +44,7 @@ class ToolOutputFile {
 
   /// Storage for the stream, if we're owning our own stream. This is
   /// intentionally declared after Installer.
-  Optional<raw_fd_ostream> OSHolder;
+  std::optional<raw_fd_ostream> OSHolder;
 
   /// The actual stream to use.
   raw_fd_ostream *OS;