aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorOCHyams <orlando.hyams@sony.com>2023-06-12 17:06:50 +0100
committerOCHyams <orlando.hyams@sony.com>2023-06-12 17:09:04 +0100
commit9dcae2f524e7bd9c6655778fb3c4c5cac05180cb (patch)
treed579b80d055b7b48c6d89634e0f06c061928c71f /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parent06dab8f7438a7aae82157714c5b502680f78a382 (diff)
downloadllvm-9dcae2f524e7bd9c6655778fb3c4c5cac05180cb.zip
llvm-9dcae2f524e7bd9c6655778fb3c4c5cac05180cb.tar.gz
llvm-9dcae2f524e7bd9c6655778fb3c4c5cac05180cb.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index 1f1d243..eb2d992 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -223,6 +223,7 @@ bool DebugHandlerBase::isUnsignedDIType(const DIType *Ty) {
Encoding == dwarf::DW_ATE_signed_char ||
Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF ||
Encoding == dwarf::DW_ATE_boolean ||
+ Encoding == dwarf::DW_ATE_complex_float ||
(Ty->getTag() == dwarf::DW_TAG_unspecified_type &&
Ty->getName() == "decltype(nullptr)")) &&
"Unsupported encoding");