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

index 96e2a15..e832d8f 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/Error.h"
+#include <optional>
 #include <vector>
 
 // This class represents a glob pattern. Supported metacharacters
@@ -48,9 +49,9 @@ private:
   std::vector<BitVector> Tokens;
 
   // The following members are for optimization.
-  Optional<StringRef> Exact;
-  Optional<StringRef> Prefix;
-  Optional<StringRef> Suffix;
+  std::optional<StringRef> Exact;
+  std::optional<StringRef> Prefix;
+  std::optional<StringRef> Suffix;
 };
 }