Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.

This patch was developed on top of original patch by Artur Pietrek.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112678 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2010-08-31 23:50:19 +00:00
parent a6d050df14
commit ae84d5b9ba
4 changed files with 15 additions and 1 deletions

View File

@ -255,6 +255,10 @@ namespace llvm {
/// DwarfSectionOffsetDirective - Special section offset directive. /// DwarfSectionOffsetDirective - Special section offset directive.
const char* DwarfSectionOffsetDirective; // Defaults to NULL const char* DwarfSectionOffsetDirective; // Defaults to NULL
/// DwarfUsesAbsoluteLabelForStmtList - True if DW_AT_stmt_list needs
/// absolute label instead of offset.
bool DwarfUsesAbsoluteLabelForStmtList; // Defaults to true;
//===--- CBE Asm Translation Table -----------------------------------===// //===--- CBE Asm Translation Table -----------------------------------===//
const char *const *AsmTransCBE; // Defaults to empty const char *const *AsmTransCBE; // Defaults to empty
@ -417,6 +421,9 @@ namespace llvm {
const char *getDwarfSectionOffsetDirective() const { const char *getDwarfSectionOffsetDirective() const {
return DwarfSectionOffsetDirective; return DwarfSectionOffsetDirective;
} }
bool doesDwarfUsesAbsoluteLabelForStmtList() const {
return DwarfUsesAbsoluteLabelForStmtList;
}
const char *const *getAsmCBE() const { const char *const *getAsmCBE() const {
return AsmTransCBE; return AsmTransCBE;
} }

View File

@ -1815,7 +1815,11 @@ void DwarfDebug::constructCompileUnit(const MDNode *N) {
addUInt(Die, dwarf::DW_AT_entry_pc, dwarf::DW_FORM_addr, 0); addUInt(Die, dwarf::DW_AT_entry_pc, dwarf::DW_FORM_addr, 0);
// DW_AT_stmt_list is a offset of line number information for this // DW_AT_stmt_list is a offset of line number information for this
// compile unit in debug_line section. // compile unit in debug_line section.
addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0); if (Asm->MAI->doesDwarfUsesAbsoluteLabelForStmtList())
addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
Asm->GetTempSymbol("section_line"));
else
addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
if (!Dir.empty()) if (!Dir.empty())
addString(Die, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string, Dir); addString(Die, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string, Dir);

View File

@ -68,6 +68,7 @@ MCAsmInfo::MCAsmInfo() {
ExceptionsType = ExceptionHandling::None; ExceptionsType = ExceptionHandling::None;
DwarfRequiresFrameSection = true; DwarfRequiresFrameSection = true;
DwarfUsesInlineInfoSection = false; DwarfUsesInlineInfoSection = false;
DwarfUsesAbsoluteLabelForStmtList = true;
DwarfSectionOffsetDirective = 0; DwarfSectionOffsetDirective = 0;
HasMicrosoftFastStdCallMangling = false; HasMicrosoftFastStdCallMangling = false;

View File

@ -44,5 +44,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
HasDotTypeDotSizeDirective = false; HasDotTypeDotSizeDirective = false;
HasNoDeadStrip = true; HasNoDeadStrip = true;
DwarfUsesAbsoluteLabelForStmtList = false;
} }