[llvm] [RFC][NFCI][Constants] Add `Constant::isZeroValue` (PR #195736)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 09:19:01 PDT 2026


================
@@ -1245,7 +1245,7 @@ class ConstantPtrAuth final : public Constant {
 
   /// Whether there is any non-null address discriminator.
   bool hasAddressDiscriminator() const {
-    return !getAddrDiscriminator()->isNullValue();
+    return !getAddrDiscriminator()->isZeroValue();
----------------
nikic wrote:

Is the plan to just migrate everything to isZeroValue() regardless of whether it actually want to check for null or zero?

Like for example this one seems like it should stick with isNullValue(), as it's specifically looking for a null pointer.

I think I'd prefer to just change everything once to the correct API rather than going through things multiple times with back and forth renames.

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


More information about the llvm-commits mailing list