[mlir] Deprecate OptionalParseResult::{hasValue,getValue}

This patch deprecates hasValue and getValue for consistency with
std::optional and llvm::Optional.  Note that I've migrated all known
uses of them to has_value and value, respectively.

Differential Revision: https://reviews.llvm.org/D131366
This commit is contained in:
Kazu Hirata 2022-08-12 19:19:24 -07:00
parent 7082e1506d
commit 5c4674d67b
1 changed files with 6 additions and 2 deletions

View File

@ -45,11 +45,15 @@ public:
/// Returns true if we contain a valid ParseResult value.
bool has_value() const { return impl.has_value(); }
bool hasValue() const { return impl.has_value(); }
LLVM_DEPRECATED("Use has_value instead", "has_value") bool hasValue() const {
return impl.has_value();
}
/// Access the internal ParseResult value.
ParseResult value() const { return impl.value(); }
ParseResult getValue() const { return impl.value(); }
LLVM_DEPRECATED("Use value instead", "value") ParseResult getValue() const {
return impl.value();
}
ParseResult operator*() const { return value(); }
private: