[RFC] Introduce sentinel pointer value to `DataLayout`

FWIW, I work on an embedded compiler where null pointers are intentionally neither 0 nor all ones.

For my stuff, I’ll still have to use custom null pointer logic as my environment has some other complexities, such as only some bits contibuting to nullness depending on context, and global pointers that can’t be represented as LLVM Constants because of the bit shifts, masking, and XORs required for segmented pointers. For example I might have to treat FDFDxxxx and FFFF0000FxxxFxxx and Fxxxxxxx0000FFFF as null pointers all pointing to same address space.

1 Like