[llvm] 4700e7c - [Support] Use std::optional in GlobPattern.h (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 14:16:23 PST 2022
Author: Kazu Hirata
Date: 2022-11-27T14:16:05-08:00
New Revision: 4700e7ca159ac544d36b032f3523e113faa1d95f
URL: https://github.com/llvm/llvm-project/commit/4700e7ca159ac544d36b032f3523e113faa1d95f
DIFF: https://github.com/llvm/llvm-project/commit/4700e7ca159ac544d36b032f3523e113faa1d95f.diff
LOG: [Support] Use std::optional in GlobPattern.h (NFC)
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
Added:
Modified:
llvm/include/llvm/Support/GlobPattern.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 96e2a15ae20f..e832d8fb8968 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -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 @@ class GlobPattern {
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;
};
}
More information about the llvm-commits
mailing list