[llvm] [RFC][DataLayout] Add null pointer value infrastructure (PR #183207)
Alexander Richardson via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 14:49:29 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;
----------------
arichardson wrote:
I don't think this struct is particularly memory critical, but if we wanted to reduce the size we could store the `enum class NullPtrKind { Default, Zero, AllOnes };` here directly.
https://github.com/llvm/llvm-project/pull/183207
More information about the llvm-commits
mailing list