[llvm-dev] nullptr bit-value for DebugInfo in non-default address spaces

Jeremy Morse via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 4 06:47:43 PST 2018

Hi llvm-dev@,

It recently transpired that LLVM doesn't correctly preserve debugging
information when null pointer constants are assigned to variables [0], with
the debug records getting dropped by SelectionDAG. Fixing that [1] raises a
few questions about the bit-value of null in different address spaces, so
I'd like to ask:
 * Can we just assume that null is zero-valued for all address spaces?
 * If not, are there APIs available for determining an address spaces'

What's permissible / disallowed for address spaces is unclear to me.
Various comments around the code base suggest that nullptr is always zero
for address space zero; I'm not aware of rules for other address spaces.
Without further information, the current solution is to have non-zero
address space nulls marked as "optimized out".

[0] https://bugs.llvm.org/show_bug.cgi?id=39787
[1] https://reviews.llvm.org/D55227

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181204/0be7b8bc/attachment.html>

More information about the llvm-dev mailing list