Skip to content

Commit c9b6864

Browse files
committed
don't name the encoding & don't assert in range lo_user - hi_user)
1 parent 49e7792 commit c9b6864

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ llvm::DIType *CGDebugInfo::CreateType(const ComplexType *Ty) {
11191119
// Bit size and offset of the type.
11201120
llvm::dwarf::TypeKind Encoding = llvm::dwarf::DW_ATE_complex_float;
11211121
if (Ty->isComplexIntegerType())
1122-
Encoding = llvm::dwarf::DW_ATE_GNU_complex_signed;
1122+
Encoding = llvm::dwarf::DW_ATE_lo_user;
11231123

11241124
uint64_t Size = CGM.getContext().getTypeSize(Ty);
11251125
return DBuilder.createBasicType("complex", Size, Encoding);

llvm/include/llvm/BinaryFormat/Dwarf.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,6 @@ HANDLE_DW_ATE(0x12, ASCII, 5, DWARF)
11111111
// HANDLE_DW_ATE(0x80, ALTIUM_fract, 2, ALTIUM) = DW_ATE_low_user
11121112
// HANDLE_DW_ATE(0x81, ALTIUM_accum, 2, ALTIUM)
11131113

1114-
HANDLE_DW_ATE(0x80, GNU_complex_signed, 4, GNU)
1115-
11161114
HANDLE_DW_ATE(0x81, HP_complex_float, 2, HP)
11171115
HANDLE_DW_ATE(0x82, HP_float128, 2, HP)
11181116
HANDLE_DW_ATE(0x83, HP_complex_float128, 2, HP)

llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "llvm/CodeGen/DebugHandlerBase.h"
15+
#include "llvm/BinaryFormat/Dwarf.h"
1516
#include "llvm/CodeGen/AsmPrinter.h"
1617
#include "llvm/CodeGen/MachineFunction.h"
1718
#include "llvm/CodeGen/MachineInstr.h"
@@ -236,9 +237,10 @@ bool DebugHandlerBase::isUnsignedDIType(const DIType *Ty) {
236237
Encoding == dwarf::DW_ATE_float || Encoding == dwarf::DW_ATE_UTF ||
237238
Encoding == dwarf::DW_ATE_boolean ||
238239
Encoding == dwarf::DW_ATE_complex_float ||
239-
Encoding == dwarf::DW_ATE_GNU_complex_signed ||
240240
Encoding == dwarf::DW_ATE_signed_fixed ||
241241
Encoding == dwarf::DW_ATE_unsigned_fixed ||
242+
(Encoding >= dwarf::DW_ATE_lo_user &&
243+
Encoding <= dwarf::DW_ATE_hi_user) ||
242244
(Ty->getTag() == dwarf::DW_TAG_unspecified_type &&
243245
Ty->getName() == "decltype(nullptr)")) &&
244246
"Unsupported encoding");

llvm/test/DebugInfo/dwarf-complex-int.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
; CHECK: [[complex]]: DW_TAG_base_type
1717
; CHECK-NEXT: DW_AT_name ("complex")
18-
; CHECK-NEXT: DW_AT_encoding (DW_ATE_GNU_complex_signed)
18+
; CHECK-NEXT: DW_AT_encoding (0x80)
1919
; CHECK-NEXT: DW_AT_byte_size (0x04)
2020

2121
@g = dso_local local_unnamed_addr global i32 0, align 4, !dbg !0

0 commit comments

Comments
 (0)