diff options
| author | Kazu Hirata <kazu@google.com> | 2022-12-10 10:28:55 -0800 |
|---|---|---|
| committer | Kazu Hirata <kazu@google.com> | 2022-12-10 10:28:55 -0800 |
| commit | e2e572a8d4ec75db458f8d6ab91896b7e41837f5 (patch) | |
| tree | 0500e582ae0c43f28fffcd96ab76e94057443658 /mlir/lib/AsmParser/Parser.cpp | |
| parent | d8be20818858629351a8f097ebd7a78fe8a50dac (diff) | |
[AsmParser] Use std::optional in Parser.cpp (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
Diffstat (limited to 'mlir/lib/AsmParser/Parser.cpp')
| -rw-r--r-- | mlir/lib/AsmParser/Parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mlir/lib/AsmParser/Parser.cpp b/mlir/lib/AsmParser/Parser.cpp index 75298ec5329d..7eb839d875b1 100644 --- a/mlir/lib/AsmParser/Parser.cpp +++ b/mlir/lib/AsmParser/Parser.cpp @@ -28,6 +28,7 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/SourceMgr.h" #include <algorithm> +#include <optional> using namespace mlir; using namespace mlir::detail; @@ -501,7 +502,7 @@ public: /// Return the location of the value identified by its name and number if it /// has been already reference. - Optional<SMLoc> getReferenceLoc(StringRef name, unsigned number) { + std::optional<SMLoc> getReferenceLoc(StringRef name, unsigned number) { auto &values = isolatedNameScopes.back().values; if (!values.count(name) || number >= values[name].size()) return {}; |
