PR19767: DebugInfo emission of pointer constants.
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 20 May 2014 18:21:51 +0000 (18:21 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 20 May 2014 18:21:51 +0000 (18:21 +0000)
commite2ab467b905b57be574e97bc529eddd0a4474633
tree3b8bd22f3e17b0a64442571dd119fd2876a33749
parent5d7afdb2ec6121cf5a2bc97f01f0ebd4e39d7dde
PR19767: DebugInfo emission of pointer constants.

In refactoring DwarfUnit::isUnsignedDIType I restricted it to only work
on values with signedness (unsigned or signed), asserting on anything
else (which did uncover some bugs). But it turns out that we do need to
emit constants of signless data, such as pointer constants - only null
pointer constants are known to need this so far, but it's conceivable
that there might be non-null pointer constants at some point (hardcoded
address offsets for device drivers?).

This patch just uses 'unsigned' for signless data such as pointer
constants. Arguably we could use signless representations
(DW_FORM_dataN) instead, allowing a trinary result from isUnsignedDIType
(signed, unsigned, signless), but this seems reasonable for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209223 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
test/DebugInfo/constant-pointers.ll [new file with mode: 0644]