[llvm] [RFC][DataLayout] Add null pointer value infrastructure (PR #183207)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 13:54:55 PDT 2026


================
@@ -95,6 +96,9 @@ class DataLayout {
     bool HasExternalState;
     // Symbolic name of the address space.
     std::string AddrSpaceName;
+    /// The null pointer bit representation for this address space.
+    /// If absent, this address space uses the default null pointer value.
+    std::optional<APInt> NullPtrValue;
----------------
nikic wrote:

As the default handling needs to create the appropriate APInt in getNullPtrValue anyway, I'm not sure it makes sense to use a different representation for the non-default case...

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


More information about the llvm-commits mailing list