mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-18 06:38:41 +00:00
Revert r198851, "Prototype of skeleton type units for fission"
It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198865 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3539d6d40c
commit
adff827c6a
@ -2976,21 +2976,6 @@ DwarfCompileUnit *DwarfDebug::constructSkeletonCU(const DwarfCompileUnit *CU) {
|
|||||||
return NewCU;
|
return NewCU;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This DIE has the following attributes: DW_AT_comp_dir, DW_AT_dwo_name,
|
|
||||||
// DW_AT_addr_base.
|
|
||||||
DwarfTypeUnit *DwarfDebug::constructSkeletonTU(const DwarfTypeUnit *TU) {
|
|
||||||
|
|
||||||
DIE *Die = new DIE(dwarf::DW_TAG_type_unit);
|
|
||||||
DwarfTypeUnit *NewTU = new DwarfTypeUnit(
|
|
||||||
TU->getUniqueID(), Die, TU->getCUNode(), Asm, this, &SkeletonHolder);
|
|
||||||
NewTU->setTypeSignature(TU->getTypeSignature());
|
|
||||||
NewTU->initSection(
|
|
||||||
Asm->getObjFileLowering().getDwarfTypesSection(TU->getTypeSignature()));
|
|
||||||
|
|
||||||
initSkeletonUnit(TU, Die, NewTU);
|
|
||||||
return NewTU;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Emit the .debug_info.dwo section for separated dwarf. This contains the
|
// Emit the .debug_info.dwo section for separated dwarf. This contains the
|
||||||
// compile units that would normally be in debug_info.
|
// compile units that would normally be in debug_info.
|
||||||
void DwarfDebug::emitDebugInfoDWO() {
|
void DwarfDebug::emitDebugInfoDWO() {
|
||||||
@ -3033,6 +3018,8 @@ void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode,
|
|||||||
NewTU->addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
|
NewTU->addUInt(UnitDie, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
|
||||||
CUNode.getLanguage());
|
CUNode.getLanguage());
|
||||||
|
|
||||||
|
DIE *Die = NewTU->createTypeDIE(CTy);
|
||||||
|
|
||||||
MD5 Hash;
|
MD5 Hash;
|
||||||
Hash.update(Identifier);
|
Hash.update(Identifier);
|
||||||
// ... take the least significant 8 bytes and return those. Our MD5
|
// ... take the least significant 8 bytes and return those. Our MD5
|
||||||
@ -3042,10 +3029,7 @@ void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode,
|
|||||||
Hash.final(Result);
|
Hash.final(Result);
|
||||||
uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8);
|
uint64_t Signature = *reinterpret_cast<support::ulittle64_t *>(Result + 8);
|
||||||
NewTU->setTypeSignature(Signature);
|
NewTU->setTypeSignature(Signature);
|
||||||
if (useSplitDwarf())
|
NewTU->setType(Die);
|
||||||
NewTU->setSkeleton(constructSkeletonTU(NewTU));
|
|
||||||
|
|
||||||
NewTU->setType(NewTU->createTypeDIE(CTy));
|
|
||||||
|
|
||||||
NewTU->initSection(
|
NewTU->initSection(
|
||||||
useSplitDwarf()
|
useSplitDwarf()
|
||||||
|
@ -596,10 +596,6 @@ class DwarfDebug : public AsmPrinterHandler {
|
|||||||
/// section.
|
/// section.
|
||||||
DwarfCompileUnit *constructSkeletonCU(const DwarfCompileUnit *CU);
|
DwarfCompileUnit *constructSkeletonCU(const DwarfCompileUnit *CU);
|
||||||
|
|
||||||
/// \brief Construct the split debug info compile unit for the debug info
|
|
||||||
/// section.
|
|
||||||
DwarfTypeUnit *constructSkeletonTU(const DwarfTypeUnit *TU);
|
|
||||||
|
|
||||||
/// \brief Emit the debug info dwo section.
|
/// \brief Emit the debug info dwo section.
|
||||||
void emitDebugInfoDWO();
|
void emitDebugInfoDWO();
|
||||||
|
|
||||||
|
@ -1987,9 +1987,7 @@ void DwarfTypeUnit::emitHeader(const MCSection *ASection,
|
|||||||
Asm->OutStreamer.AddComment("Type Signature");
|
Asm->OutStreamer.AddComment("Type Signature");
|
||||||
Asm->OutStreamer.EmitIntValue(TypeSignature, sizeof(TypeSignature));
|
Asm->OutStreamer.EmitIntValue(TypeSignature, sizeof(TypeSignature));
|
||||||
Asm->OutStreamer.AddComment("Type DIE Offset");
|
Asm->OutStreamer.AddComment("Type DIE Offset");
|
||||||
// In a skeleton type unit there is no type DIE so emit a zero offset.
|
Asm->OutStreamer.EmitIntValue(Ty->getOffset(), sizeof(Ty->getOffset()));
|
||||||
Asm->OutStreamer.EmitIntValue(Ty ? Ty->getOffset() : 0,
|
|
||||||
sizeof(Ty->getOffset()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfTypeUnit::initSection(const MCSection *Section) {
|
void DwarfTypeUnit::initSection(const MCSection *Section) {
|
||||||
|
@ -726,9 +726,8 @@ const MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const {
|
|||||||
|
|
||||||
const MCSection *
|
const MCSection *
|
||||||
MCObjectFileInfo::getDwarfTypesDWOSection(uint64_t Hash) const {
|
MCObjectFileInfo::getDwarfTypesDWOSection(uint64_t Hash) const {
|
||||||
return Ctx->getELFSection(".debug_types.dwo", ELF::SHT_PROGBITS,
|
return Ctx->getELFSection(".debug_types.dwo", ELF::SHT_GROUP, 0,
|
||||||
ELF::SHF_GROUP, SectionKind::getMetadata(), 0,
|
SectionKind::getMetadata(), 0, utostr(Hash));
|
||||||
utostr(Hash));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCObjectFileInfo::InitEHFrameSection() {
|
void MCObjectFileInfo::InitEHFrameSection() {
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
; REQUIRES: object-emission
|
; REQUIRES: object-emission
|
||||||
|
|
||||||
; RUN: llc %s -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
|
; RUN: llc %s -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
|
||||||
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=SINGLE %s
|
; RUN: llvm-dwarfdump %t | FileCheck %s
|
||||||
|
|
||||||
; RUN: llc %s -split-dwarf=Enable -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
|
|
||||||
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=FISSION %s
|
|
||||||
|
|
||||||
; Generated from:
|
; Generated from:
|
||||||
; struct bar {};
|
; struct bar {};
|
||||||
@ -46,8 +43,7 @@
|
|||||||
|
|
||||||
; wombat wom;
|
; wombat wom;
|
||||||
|
|
||||||
; SINGLE-LABEL: .debug_info contents:
|
; CHECK-LABEL: .debug_info contents:
|
||||||
; FISSION-LABEL: .debug_info.dwo contents:
|
|
||||||
; CHECK: Compile Unit: length = [[CU_SIZE:[0-9a-f]+]]
|
; CHECK: Compile Unit: length = [[CU_SIZE:[0-9a-f]+]]
|
||||||
|
|
||||||
; CHECK: DW_TAG_structure_type
|
; CHECK: DW_TAG_structure_type
|
||||||
@ -57,32 +53,18 @@
|
|||||||
|
|
||||||
; Ensure the CU-local type 'walrus' is not placed in a type unit.
|
; Ensure the CU-local type 'walrus' is not placed in a type unit.
|
||||||
; CHECK: DW_TAG_structure_type
|
; CHECK: DW_TAG_structure_type
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"walrus"
|
; CHECK-NEXT: debug_str{{.*}}"walrus"
|
||||||
; CHECK-NEXT: DW_AT_byte_size
|
; CHECK-NEXT: DW_AT_byte_size
|
||||||
; CHECK-NEXT: DW_AT_decl_file
|
; CHECK-NEXT: DW_AT_decl_file
|
||||||
; CHECK-NEXT: DW_AT_decl_line
|
; CHECK-NEXT: DW_AT_decl_line
|
||||||
|
|
||||||
; FISSION-LABEL: .debug_types contents:
|
; CHECK-LABEL: .debug_types contents:
|
||||||
; FISSION-NOT: type_signature
|
|
||||||
; FISSION-LABEL: type_signature = 0x1d02f3be30cc5688
|
|
||||||
; FISSION: DW_TAG_type_unit
|
|
||||||
; FISSION: DW_AT_GNU_dwo_name{{.*}}"bar.dwo"
|
|
||||||
; FISSION: DW_AT_comp_dir{{.*}}"/tmp/dbginfo"
|
|
||||||
; FISSION-NOT: type_signature
|
|
||||||
; FISSION-LABEL: type_signature = 0xb04af47397402e77
|
|
||||||
; FISSION-NOT: type_signature
|
|
||||||
; FISSION-LABEL: type_signature = 0xfd756cee88f8a118
|
|
||||||
; FISSION-NOT: type_signature
|
|
||||||
; FISSION-LABEL: type_signature = 0xe94f6d3843e62d6b
|
|
||||||
|
|
||||||
; SINGLE-LABEL: .debug_types contents:
|
|
||||||
; FISSION-LABEL: .debug_types.dwo contents:
|
|
||||||
|
|
||||||
; Check that we generate a hash for bar and the value.
|
; Check that we generate a hash for bar and the value.
|
||||||
; CHECK-NOT: type_signature
|
; CHECK-NOT: type_signature
|
||||||
; CHECK-LABEL: type_signature = 0x1d02f3be30cc5688
|
; CHECK-LABEL: type_signature = 0x1d02f3be30cc5688
|
||||||
; CHECK: DW_TAG_structure_type
|
; CHECK: DW_TAG_structure_type
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"bar"
|
; CHECK-NEXT: debug_str{{.*}}"bar"
|
||||||
|
|
||||||
|
|
||||||
; Check that we generate a hash for fluffy and the value.
|
; Check that we generate a hash for fluffy and the value.
|
||||||
@ -90,13 +72,13 @@
|
|||||||
; CHECK-LABEL: type_signature = 0xb04af47397402e77
|
; CHECK-LABEL: type_signature = 0xb04af47397402e77
|
||||||
; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x9a0124d5a0c21c52)
|
; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x9a0124d5a0c21c52)
|
||||||
; CHECK: DW_TAG_namespace
|
; CHECK: DW_TAG_namespace
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"echidna"
|
; CHECK-NEXT: debug_str{{.*}}"echidna"
|
||||||
; CHECK: DW_TAG_namespace
|
; CHECK: DW_TAG_namespace
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"capybara"
|
; CHECK-NEXT: debug_str{{.*}}"capybara"
|
||||||
; CHECK: DW_TAG_namespace
|
; CHECK: DW_TAG_namespace
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"mongoose"
|
; CHECK-NEXT: debug_str{{.*}}"mongoose"
|
||||||
; CHECK: DW_TAG_class_type
|
; CHECK: DW_TAG_class_type
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"fluffy"
|
; CHECK-NEXT: debug_str{{.*}}"fluffy"
|
||||||
|
|
||||||
; Check that we generate a hash for wombat and the value, but not for the
|
; Check that we generate a hash for wombat and the value, but not for the
|
||||||
; anonymous type contained within.
|
; anonymous type contained within.
|
||||||
@ -104,7 +86,7 @@
|
|||||||
; CHECK-LABEL: type_signature = 0xfd756cee88f8a118
|
; CHECK-LABEL: type_signature = 0xfd756cee88f8a118
|
||||||
; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x685bcc220141e9d7)
|
; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x685bcc220141e9d7)
|
||||||
; CHECK: DW_TAG_structure_type
|
; CHECK: DW_TAG_structure_type
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"wombat"
|
; CHECK-NEXT: debug_str{{.*}}"wombat"
|
||||||
|
|
||||||
; CHECK-NOT: type_signature
|
; CHECK-NOT: type_signature
|
||||||
; CHECK-LABEL: type_signature = 0xe94f6d3843e62d6b
|
; CHECK-LABEL: type_signature = 0xe94f6d3843e62d6b
|
||||||
@ -118,7 +100,7 @@
|
|||||||
; CHECK-NOT: DW_AT_name
|
; CHECK-NOT: DW_AT_name
|
||||||
; CHECK-NOT: DW_AT_GNU_odr_signature
|
; CHECK-NOT: DW_AT_GNU_odr_signature
|
||||||
; CHECK: DW_TAG_member
|
; CHECK: DW_TAG_member
|
||||||
; CHECK-NEXT: DW_AT_name{{.*}}"a"
|
; CHECK-NEXT: debug_str{{.*}}"a"
|
||||||
|
|
||||||
; Use the unit size as a rough hash/identifier for the unit we're dealing with
|
; Use the unit size as a rough hash/identifier for the unit we're dealing with
|
||||||
; it happens to be unambiguous at the moment, but it's hardly ideal.
|
; it happens to be unambiguous at the moment, but it's hardly ideal.
|
||||||
@ -128,21 +110,17 @@
|
|||||||
; CHECK-NEXT: Offset Name
|
; CHECK-NEXT: Offset Name
|
||||||
; CHECK-NEXT: "walrus"
|
; CHECK-NEXT: "walrus"
|
||||||
; Type unit for 'bar'
|
; Type unit for 'bar'
|
||||||
; SINGLE-NEXT: unit_size = 0x00000023
|
; CHECK-NEXT: unit_size = 0x00000023
|
||||||
; FISSION-NEXT: unit_size = 0x00000024
|
|
||||||
; CHECK-NEXT: Offset Name
|
; CHECK-NEXT: Offset Name
|
||||||
; CHECK-NEXT: "bar"
|
; CHECK-NEXT: "bar"
|
||||||
; SINGLE-NEXT: unit_size = 0x0000005d
|
; CHECK-NEXT: unit_size = 0x0000005d
|
||||||
; FISSION-NEXT: unit_size = 0x00000024
|
|
||||||
; CHECK-NEXT: Offset Name
|
; CHECK-NEXT: Offset Name
|
||||||
; CHECK-NEXT: "int"
|
; CHECK-NEXT: "int"
|
||||||
; CHECK-NEXT: "echidna::capybara::mongoose::fluffy"
|
; CHECK-NEXT: "echidna::capybara::mongoose::fluffy"
|
||||||
; SINGLE-NEXT: unit_size = 0x0000003a
|
; CHECK-NEXT: unit_size = 0x0000003a
|
||||||
; FISSION-NEXT: unit_size = 0x00000024
|
|
||||||
; CHECK-NEXT: Offset Name
|
; CHECK-NEXT: Offset Name
|
||||||
; CHECK-NEXT: "wombat"
|
; CHECK-NEXT: "wombat"
|
||||||
; SINGLE-NEXT: unit_size = 0x0000004b
|
; CHECK-NEXT: unit_size = 0x0000004b
|
||||||
; FISSION-NEXT: unit_size = 0x00000024
|
|
||||||
; CHECK-NEXT: Offset Name
|
; CHECK-NEXT: Offset Name
|
||||||
; CHECK-NEXT: "int"
|
; CHECK-NEXT: "int"
|
||||||
|
|
||||||
@ -201,7 +179,7 @@ attributes #1 = { nounwind readnone }
|
|||||||
!llvm.module.flags = !{!42, !54}
|
!llvm.module.flags = !{!42, !54}
|
||||||
!llvm.ident = !{!43}
|
!llvm.ident = !{!43}
|
||||||
|
|
||||||
!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !20, metadata !37, metadata !2, metadata !"bar.dwo"} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/bar.cpp] [DW_LANG_C_plus_plus]
|
!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !20, metadata !37, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/bar.cpp] [DW_LANG_C_plus_plus]
|
||||||
!1 = metadata !{metadata !"bar.cpp", metadata !"/tmp/dbginfo"}
|
!1 = metadata !{metadata !"bar.cpp", metadata !"/tmp/dbginfo"}
|
||||||
!2 = metadata !{i32 0}
|
!2 = metadata !{i32 0}
|
||||||
!3 = metadata !{metadata !4, metadata !5, metadata !13, metadata !16}
|
!3 = metadata !{metadata !4, metadata !5, metadata !13, metadata !16}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user