[DebugInfo] Add DW_ATE_complex_float case to assert in isUnsignedDIType
authorOCHyams <orlando.hyams@sony.com>
Mon, 12 Jun 2023 16:06:50 +0000 (17:06 +0100)
committerOCHyams <orlando.hyams@sony.com>
Mon, 12 Jun 2023 16:09:04 +0000 (17:09 +0100)
commit9dcae2f524e7bd9c6655778fb3c4c5cac05180cb
treed579b80d055b7b48c6d89634e0f06c061928c71f
parent06dab8f7438a7aae82157714c5b502680f78a382
[DebugInfo] Add DW_ATE_complex_float case to assert in isUnsignedDIType

Without this patch a `DW_ATE_complex_float` encoding trips an assertion in
`DebugHandlerBase::isUnsignedDIType` with the message `"Unsupported
encoding"`.

By adding a case to the `assert` for `DW_ATE_complex_float` it becomes
supported, behaving in the same way as the already supported `DW_ATE_float`
type (return false).

Note: For the reported reproducer:

    #include <complex.h>
    int main() {
      long double complex r1;
    }

The assertion isn't tripped without assignment tracking because instcombine
deletes everything, including the `dbg.declare`, without recovering any
location information. Whereas with assignment tracking we track a zeroing
memset that is emitted by clang.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D151795
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
llvm/test/DebugInfo/X86/DW_ATE_complex_float.ll [new file with mode: 0644]