diff options
author | Steve Merritt <steve.merritt@intel.com> | 2023-02-10 08:49:49 -0500 |
---|---|---|
committer | Steve Merritt <steve.merritt@intel.com> | 2023-02-24 09:20:52 -0500 |
commit | 750a6870eb41922f7013c163b458a02d5aa8994b (patch) | |
tree | e8d39aed11c561f92d695d5250bc2e6f06e85188 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 724b58f76691e5633fc9e2e19d64e476b0c7845e (diff) | |
download | llvm-750a6870eb41922f7013c163b458a02d5aa8994b.zip llvm-750a6870eb41922f7013c163b458a02d5aa8994b.tar.gz llvm-750a6870eb41922f7013c163b458a02d5aa8994b.tar.bz2 |
[Codeview] Fix incorrect size determination for complex types.
In Codeview, the basic type of a complex represents the size
of an individual component rather than the sum of the real
and imaginary components.
Differential Revision: https://reviews.llvm.org/D143760
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 824a57dc..5542c56 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1793,12 +1793,14 @@ TypeIndex CodeViewDebug::lowerTypeBasic(const DIBasicType *Ty) { } break; case dwarf::DW_ATE_complex_float: + // The CodeView size for a complex represents the size of + // an individual component. switch (ByteSize) { - case 2: STK = SimpleTypeKind::Complex16; break; - case 4: STK = SimpleTypeKind::Complex32; break; - case 8: STK = SimpleTypeKind::Complex64; break; - case 10: STK = SimpleTypeKind::Complex80; break; - case 16: STK = SimpleTypeKind::Complex128; break; + case 4: STK = SimpleTypeKind::Complex16; break; + case 8: STK = SimpleTypeKind::Complex32; break; + case 16: STK = SimpleTypeKind::Complex64; break; + case 20: STK = SimpleTypeKind::Complex80; break; + case 32: STK = SimpleTypeKind::Complex128; break; } break; case dwarf::DW_ATE_float: |