]> granicus.if.org Git - llvm/commit
Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be
authorAdrian Prantl <aprantl@apple.com>
Mon, 2 Feb 2015 18:31:58 +0000 (18:31 +0000)
committerAdrian Prantl <aprantl@apple.com>
Mon, 2 Feb 2015 18:31:58 +0000 (18:31 +0000)
commitb265a82d58cee9d61053056fe1cda1817e460b89
treee5333cb07b46a0d77461880428525b8df66416fc
parent0784a4dabb9e74a53eca083a13ad370b10678797
Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be
described by integer constants. This is a bit ugly, but if the source
language allows arbitrary type casting, the debug info must follow suit.

For example:
  void foo() {
    float a;
    *(int *)&a = 0;
  }
For the curious: SROA replaces the float alloca with an i32 alloca, which
is then optimized away and described via dbg.value(i32 0, ...).

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