[clang] [lld] [llvm] [WIP][IR][Constants] Change the semantic of `ConstantPointerNull` to represent an actual `nullptr` instead of a zero-value pointer (PR #166667)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 16 23:10:03 PST 2025


================
@@ -842,7 +842,7 @@ void Verifier::visitGlobalVariable(const GlobalVariable &GV) {
     // If the global has common linkage, it must have a zero initializer and
     // cannot be constant.
     if (GV.hasCommonLinkage()) {
-      Check(GV.getInitializer()->isNullValue(),
+      Check(GV.getInitializer()->isZeroValue(),
----------------
arichardson wrote:

I wonder if we should add an optional data layout parameter to this function so it can return true for null pointers in the common case? 

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


More information about the llvm-commits mailing list