summaryrefslogtreecommitdiff
path: root/mlir/lib/AsmParser/Parser.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-10 10:28:55 -0800
committerKazu Hirata <kazu@google.com>2022-12-10 10:28:55 -0800
commite2e572a8d4ec75db458f8d6ab91896b7e41837f5 (patch)
tree0500e582ae0c43f28fffcd96ab76e94057443658 /mlir/lib/AsmParser/Parser.cpp
parentd8be20818858629351a8f097ebd7a78fe8a50dac (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.cpp3
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 {};