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

index c82d0dc..0fa9cb8 100644 (file)
@@ -13,6 +13,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/PrettyStackTrace.h"
+#include <optional>
 
 // The main() functions in typical LLVM tools start with InitLLVM which does
 // the following one-time initializations:
@@ -45,7 +46,7 @@ public:
 private:
   BumpPtrAllocator Alloc;
   SmallVector<const char *, 0> Args;
-  Optional<PrettyStackTraceProgram> StackPrinter;
+  std::optional<PrettyStackTraceProgram> StackPrinter;
 };
 } // namespace llvm