Use the somewhat semantic term "split dwarf" it more matches what's

going on and makes a lot of the terminology in comments make more sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169758 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2012-12-10 19:51:21 +00:00
parent 9ec87b3c86
commit 4daaed1c70
3 changed files with 33 additions and 31 deletions

View File

@ -1,3 +1,4 @@
//===-- llvm/CodeGen/DwarfDebug.cpp - Dwarf Debug Framework ---------------===// //===-- llvm/CodeGen/DwarfDebug.cpp - Dwarf Debug Framework ---------------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
@ -78,8 +79,8 @@ static cl::opt<DefaultOnOff> DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
clEnumValEnd), clEnumValEnd),
cl::init(Default)); cl::init(Default));
static cl::opt<DefaultOnOff> DwarfFission("dwarf-fission", cl::Hidden, static cl::opt<DefaultOnOff> SplitDwarf("split-dwarf", cl::Hidden,
cl::desc("Output prototype dwarf fission."), cl::desc("Output prototype dwarf split debug info."),
cl::values( cl::values(
clEnumVal(Default, "Default for platform"), clEnumVal(Default, "Default for platform"),
clEnumVal(Enable, "Enabled"), clEnumVal(Enable, "Enabled"),
@ -156,7 +157,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
: Asm(A), MMI(Asm->MMI), FirstCU(0), : Asm(A), MMI(Asm->MMI), FirstCU(0),
AbbreviationsSet(InitAbbreviationsSetSize), AbbreviationsSet(InitAbbreviationsSetSize),
SourceIdMap(DIEValueAllocator), StringPool(DIEValueAllocator), SourceIdMap(DIEValueAllocator), StringPool(DIEValueAllocator),
PrevLabel(NULL), GlobalCUIndexCount(0), FissionCU(0) { PrevLabel(NULL), GlobalCUIndexCount(0), SkeletonCU(0) {
NextStringPoolNumber = 0; NextStringPoolNumber = 0;
DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0; DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0;
@ -183,10 +184,10 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
} else } else
HasDwarfAccelTables = DwarfAccelTables == Enable ? true : false; HasDwarfAccelTables = DwarfAccelTables == Enable ? true : false;
if (DwarfFission == Default) if (SplitDwarf == Default)
HasDwarfFission = false; HasSplitDwarf = false;
else else
HasDwarfFission = DwarfFission == Enable ? true : false; HasSplitDwarf = SplitDwarf == Enable ? true : false;
{ {
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);
@ -652,8 +653,8 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) {
if (!FirstCU) if (!FirstCU)
FirstCU = NewCU; FirstCU = NewCU;
if (useDwarfFission() && !FissionCU) if (useSplitDwarf() && !SkeletonCU)
FissionCU = constructFissionCU(N); SkeletonCU = constructSkeletonCU(N);
CUMap.insert(std::make_pair(N, NewCU)); CUMap.insert(std::make_pair(N, NewCU));
return NewCU; return NewCU;
@ -903,7 +904,7 @@ void DwarfDebug::endModule() {
// Emit initial sections. // Emit initial sections.
emitSectionLabels(); emitSectionLabels();
if (!useDwarfFission()) { if (!useSplitDwarf()) {
// Emit all the DIEs into a debug info section. // Emit all the DIEs into a debug info section.
emitDebugInfo(); emitDebugInfo();
@ -982,11 +983,11 @@ void DwarfDebug::endModule() {
E = CUMap.end(); I != E; ++I) E = CUMap.end(); I != E; ++I)
delete I->second; delete I->second;
delete FissionCU; delete SkeletonCU;
// Reset these for the next Module if we have one. // Reset these for the next Module if we have one.
FirstCU = NULL; FirstCU = NULL;
FissionCU = NULL; SkeletonCU = NULL;
} }
// Find abstract variable, if any, associated with Var. // Find abstract variable, if any, associated with Var.
@ -1678,14 +1679,14 @@ DwarfDebug::computeSizeAndOffset(DIE *Die, unsigned Offset) {
// Compute the size and offset of all the DIEs. // Compute the size and offset of all the DIEs.
void DwarfDebug::computeSizeAndOffsets() { void DwarfDebug::computeSizeAndOffsets() {
if (FissionCU) { if (SkeletonCU) {
unsigned Offset = unsigned Offset =
sizeof(int32_t) + // Length of Compilation Unit Info sizeof(int32_t) + // Length of Compilation Unit Info
sizeof(int16_t) + // DWARF version number sizeof(int16_t) + // DWARF version number
sizeof(int32_t) + // Offset Into Abbrev. Section sizeof(int32_t) + // Offset Into Abbrev. Section
sizeof(int8_t); // Pointer Size (in bytes) sizeof(int8_t); // Pointer Size (in bytes)
computeSizeAndOffset(FissionCU->getCUDie(), Offset); computeSizeAndOffset(SkeletonCU->getCUDie(), Offset);
} }
for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(), for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
E = CUMap.end(); I != E; ++I) { E = CUMap.end(); I != E; ++I) {
@ -1852,10 +1853,10 @@ void DwarfDebug::emitCompileUnits(const MCSection *Section) {
// Emit the debug info section. // Emit the debug info section.
void DwarfDebug::emitDebugInfo() { void DwarfDebug::emitDebugInfo() {
if (!useDwarfFission()) if (!useSplitDwarf())
emitCompileUnits(Asm->getObjFileLowering().getDwarfInfoSection()); emitCompileUnits(Asm->getObjFileLowering().getDwarfInfoSection());
else else
emitFissionSkeletonCU(Asm->getObjFileLowering().getDwarfInfoSection()); emitSkeletonCU(Asm->getObjFileLowering().getDwarfInfoSection());
} }
// Emit the abbreviation section. // Emit the abbreviation section.
@ -2324,7 +2325,7 @@ void DwarfDebug::emitDebugInlineInfo() {
// DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id, // DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
// DW_AT_ranges_base, DW_AT_addr_base. If DW_AT_ranges is present, // DW_AT_ranges_base, DW_AT_addr_base. If DW_AT_ranges is present,
// DW_AT_low_pc and DW_AT_high_pc are not used, and vice versa. // DW_AT_low_pc and DW_AT_high_pc are not used, and vice versa.
CompileUnit *DwarfDebug::constructFissionCU(const MDNode *N) { CompileUnit *DwarfDebug::constructSkeletonCU(const MDNode *N) {
DICompileUnit DIUnit(N); DICompileUnit DIUnit(N);
StringRef FN = DIUnit.getFilename(); StringRef FN = DIUnit.getFilename();
CompilationDir = DIUnit.getDirectory(); CompilationDir = DIUnit.getDirectory();
@ -2354,13 +2355,13 @@ CompileUnit *DwarfDebug::constructFissionCU(const MDNode *N) {
return NewCU; return NewCU;
} }
void DwarfDebug::emitFissionSkeletonCU(const MCSection *Section) { void DwarfDebug::emitSkeletonCU(const MCSection *Section) {
Asm->OutStreamer.SwitchSection(Section); Asm->OutStreamer.SwitchSection(Section);
DIE *Die = FissionCU->getCUDie(); DIE *Die = SkeletonCU->getCUDie();
// Emit the compile units header. // Emit the compile units header.
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("skel_info_begin", Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("skel_info_begin",
FissionCU->getUniqueID())); SkeletonCU->getUniqueID()));
// Emit size of content not including length itself // Emit size of content not including length itself
unsigned ContentSize = Die->getSize() + unsigned ContentSize = Die->getSize() +
@ -2380,7 +2381,7 @@ void DwarfDebug::emitFissionSkeletonCU(const MCSection *Section) {
emitDIE(Die); emitDIE(Die);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("skel_info_end", Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("skel_info_end",
FissionCU->getUniqueID())); SkeletonCU->getUniqueID()));
} }
@ -2388,6 +2389,6 @@ void DwarfDebug::emitFissionSkeletonCU(const MCSection *Section) {
// Emit the .debug_info.dwo section for fission. This contains the compile // Emit the .debug_info.dwo section for fission. This contains the compile
// units that would normally be in debug_info. // units that would normally be in debug_info.
void DwarfDebug::emitDebugInfoDWO() { void DwarfDebug::emitDebugInfoDWO() {
assert(useDwarfFission() && "Got fission?"); assert(useSplitDwarf() && "No split dwarf debug info?");
emitCompileUnits(Asm->getObjFileLowering().getDwarfInfoDWOSection()); emitCompileUnits(Asm->getObjFileLowering().getDwarfInfoDWOSection());
} }

View File

@ -318,7 +318,7 @@ class DwarfDebug {
// DWARF5 Experimental Options // DWARF5 Experimental Options
bool HasDwarfAccelTables; bool HasDwarfAccelTables;
bool HasDwarfFission; bool HasSplitDwarf;
// Fission Variables // Fission Variables
// In general these will all be for bits that are left in the // In general these will all be for bits that are left in the
@ -326,7 +326,7 @@ class DwarfDebug {
// to be in the .dwo sections. // to be in the .dwo sections.
// The CU left in the original object file for Fission debug info. // The CU left in the original object file for Fission debug info.
CompileUnit *FissionCU; CompileUnit *SkeletonCU;
private: private:
@ -428,13 +428,14 @@ private:
/// \brief Emit inline info using custom format. /// \brief Emit inline info using custom format.
void emitDebugInlineInfo(); void emitDebugInlineInfo();
/// DWARF 5 Experimental Fission Emitters /// DWARF 5 Experimental Split Dwarf Emitters
/// \brief Construct the fission compile unit for the debug info section. /// \brief Construct the split debug info compile unit for the debug info
CompileUnit *constructFissionCU(const MDNode *); /// section.
CompileUnit *constructSkeletonCU(const MDNode *);
/// \brief Emit the fission debug info section. /// \brief Emit the local split debug info section.
void emitFissionSkeletonCU(const MCSection *); void emitSkeletonCU(const MCSection *);
/// \brief Emit the debug info dwo section. /// \brief Emit the debug info dwo section.
void emitDebugInfoDWO(); void emitDebugInfoDWO();
@ -543,8 +544,8 @@ public:
bool useDwarfAccelTables() { return HasDwarfAccelTables; } bool useDwarfAccelTables() { return HasDwarfAccelTables; }
/// \brief Returns whether or not to change the current debug info for the /// \brief Returns whether or not to change the current debug info for the
/// fission proposal support. /// split dwarf proposal support.
bool useDwarfFission() { return HasDwarfFission; } bool useSplitDwarf() { return HasSplitDwarf; }
}; };
} // End of namespace llvm } // End of namespace llvm

View File

@ -1,4 +1,4 @@
; RUN: llc -dwarf-fission=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t ; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump %t | FileCheck %s ; RUN: llvm-dwarfdump %t | FileCheck %s
@a = common global i32 0, align 4 @a = common global i32 0, align 4