Skip to content

[ADT] Deprecate PointerUnion::{is,get} (NFC) #122623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions llvm/include/llvm/ADT/PointerUnion.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,18 @@ class PointerUnion
// isa<T>, cast<T> and the llvm::dyn_cast<T>

/// Test if the Union currently holds the type matching T.
template <typename T> inline bool is() const { return isa<T>(*this); }
template <typename T>
[[deprecated("Use isa instead")]]
inline bool is() const {
return isa<T>(*this);
}

/// Returns the value of the specified pointer type.
///
/// If the specified pointer type is incorrect, assert.
template <typename T> inline T get() const {
template <typename T>
[[deprecated("Use cast instead")]]
inline T get() const {
assert(isa<T>(*this) && "Invalid accessor called");
return cast<T>(*this);
}
Expand Down
Loading