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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 01:27:46 PST 2025


================
@@ -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>
+  LLVM_DEPRECATED("Use isa instead", "isa")
----------------
nikic wrote:

I don't think this does what you want. This is going to suggest replacing the is method with an isa method: https://clang.godbolt.org/z/sPxoM8bKK

We should probably rename `LLVM_DEPRECATED` to `LLVM_DEPRECATED_WITH_FIXIT` so people stop cargo-culting this in cases where they were supposed to just use `[[deprecated("msg")]``. It looks like half the current usages are incorrect.

https://github.com/llvm/llvm-project/pull/122623


More information about the llvm-commits mailing list