[DWARF] Add linkagename to hash

Originally encountered with RUST, but also there are cases with distributed LTO
where debug info dwo units contain structurally the same debug information, with
difference in DW_AT_linkage_name. This causes collision on DWO ID.

Differential Revision: https://reviews.llvm.org/D129317
This commit is contained in:
Alexander Yermolovich 2022-07-07 11:41:51 -07:00
parent f92d319c70
commit a84e1e6c0d
5 changed files with 11 additions and 11 deletions

View File

@ -51,5 +51,5 @@ HANDLE_DIE_HASH_ATTR(DW_AT_virtuality)
HANDLE_DIE_HASH_ATTR(DW_AT_visibility)
HANDLE_DIE_HASH_ATTR(DW_AT_vtable_elem_location)
HANDLE_DIE_HASH_ATTR(DW_AT_type)
HANDLE_DIE_HASH_ATTR(DW_AT_linkage_name)
#undef HANDLE_DIE_HASH_ATTR

View File

@ -13,7 +13,7 @@
; often - add another IR file with a different DW_OP_convert that's otherwise
; identical and demonstrate that they have different DWO IDs.
; SPLIT: 0x00000000: Compile Unit: {{.*}} DWO_id = 0xa6edbf487b0a7acf
; SPLIT: 0x00000000: Compile Unit: {{.*}} DWO_id = 0x4dbee91db55385db
; Regression testing a fairly quirky bug where instead of hashing (see above),
; extra bytes would be emitted into the output assembly in no

View File

@ -13,8 +13,8 @@
; int i = 7; // or 9
; }
; H1: DW_AT_GNU_dwo_id (0x03a55a70550ee09b)
; H2: DW_AT_GNU_dwo_id (0x826fcafbddebc96b)
; H1: DW_AT_GNU_dwo_id (0xc1220cf66b1190ad)
; H2: DW_AT_GNU_dwo_id (0xf66067a0cf366f0e)
; Function Attrs: norecurse nounwind readnone uwtable
define dso_local void @_Z2f1v() local_unnamed_addr !dbg !7 {

View File

@ -3,8 +3,8 @@
; Based on the debuginfo-tests/sret.cpp code.
; CHECK-DWO: DW_AT_GNU_dwo_id (0xa58a336e896549f1)
; CHECK-DWO: DW_AT_GNU_dwo_id (0xa58a336e896549f1)
; CHECK-DWO: DW_AT_GNU_dwo_id (0x7db1cc8453a47c44)
; CHECK-DWO: DW_AT_GNU_dwo_id (0x7db1cc8453a47c44)
; RUN: llc -O0 -fast-isel=true -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,FASTISEL %s
; RUN: llc -O0 -fast-isel=false -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,SDAG %s

View File

@ -73,7 +73,7 @@ TEST_F(DIEHashTest, TrivialType) {
uint64_t MD5Res = DIEHash().computeTypeSignature(Unnamed);
// The exact same hash GCC produces for this DIE.
ASSERT_EQ(0x715305ce6cfd9ad1ULL, MD5Res);
ASSERT_EQ(0x715305CE6CFD9AD1ULL, MD5Res);
}
// struct foo { };
@ -87,7 +87,7 @@ TEST_F(DIEHashTest, NamedType) {
uint64_t MD5Res = DIEHash().computeTypeSignature(Foo);
// The exact same hash GCC produces for this DIE.
ASSERT_EQ(0xd566dbd2ca5265ffULL, MD5Res);
ASSERT_EQ(0xD566DBD2CA5265FFULL, MD5Res);
}
// namespace space { struct foo { }; }
@ -606,7 +606,7 @@ TEST_F(DIEHashTest, MemberFuncFlag) {
uint64_t MD5Res = DIEHash().computeTypeSignature(A);
// The exact same hash GCC produces for this DIE.
ASSERT_EQ(0x8f78211ddce3df10ULL, MD5Res);
ASSERT_EQ(0x8F78211DDCE3DF10ULL, MD5Res);
}
// Derived from:
@ -652,7 +652,7 @@ TEST_F(DIEHashTest, MemberSdata) {
A.addChild(std::move(PI));
uint64_t MD5Res = DIEHash().computeTypeSignature(A);
ASSERT_EQ(0x9a216000dd3788a7ULL, MD5Res);
ASSERT_EQ(0x9A216000DD3788A7ULL, MD5Res);
}
// Derived from:
@ -713,6 +713,6 @@ TEST_F(DIEHashTest, MemberBlock) {
A.addChild(std::move(PI));
uint64_t MD5Res = DIEHash(this->getAsmPrinter()).computeTypeSignature(A);
ASSERT_EQ(0x493af53ad3d3f651ULL, MD5Res);
ASSERT_EQ(0x493AF53AD3D3F651ULL, MD5Res);
}
}