summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-07 01:30:55 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-07 01:30:55 +0000
commit48b1bdcf28301fd2d55a808d77bc2482c87d7ae6 (patch)
tree19a54a1c6b766e9809530901b0f3a0ed499f2038
parentf5040a64bbe0daf32eb6309a7c1b0425b89644ad (diff)
downloadbcm5719-llvm-48b1bdcf28301fd2d55a808d77bc2482c87d7ae6.tar.gz
bcm5719-llvm-48b1bdcf28301fd2d55a808d77bc2482c87d7ae6.zip
DebugInfo: Emit DW_TAG_subprogram's DW_AT_high_pc as an offset from the low_pc
This removes a relocation from each subprogram, reducing link times, etc. llvm-svn: 203187
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp3
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp6
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h4
-rw-r--r--llvm/test/DebugInfo/AArch64/dwarfdump.ll2
-rw-r--r--llvm/test/DebugInfo/X86/dbg-value-location.ll2
5 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d30be282361..7abd2f1dc73 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -413,7 +413,8 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
}
SPCU->addLabelAddress(SPDie, dwarf::DW_AT_low_pc, FunctionBeginSym);
- SPCU->addLabelAddress(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym);
+ SPCU->addLabelDelta(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym,
+ FunctionBeginSym);
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
MachineLocation Location(RI->getFrameRegister(*Asm->MF));
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index ddc1c2f4bc0..e046bf417b6 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -320,6 +320,12 @@ void DwarfUnit::addSectionDelta(DIE *Die, dwarf::Attribute Attribute,
Die->addValue(Attribute, dwarf::DW_FORM_data4, Value);
}
+void DwarfUnit::addLabelDelta(DIE *Die, dwarf::Attribute Attribute,
+ const MCSymbol *Hi, const MCSymbol *Lo) {
+ DIEValue *Value = new (DIEValueAllocator) DIEDelta(Hi, Lo);
+ Die->addValue(Attribute, dwarf::DW_FORM_data4, Value);
+}
+
/// addDIEEntry - Add a DIE attribute data and value.
///
void DwarfUnit::addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
index 937a607fa88..af465c006ed 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h
@@ -359,6 +359,10 @@ public:
void addSectionDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
const MCSymbol *Lo);
+ /// addLabelDelta - Add a label delta attribute data and value.
+ void addLabelDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
+ const MCSymbol *Lo);
+
/// addDIEEntry - Add a DIE attribute data and value.
void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry);
diff --git a/llvm/test/DebugInfo/AArch64/dwarfdump.ll b/llvm/test/DebugInfo/AArch64/dwarfdump.ll
index 3325f30293a..b30bd33ea3a 100644
--- a/llvm/test/DebugInfo/AArch64/dwarfdump.ll
+++ b/llvm/test/DebugInfo/AArch64/dwarfdump.ll
@@ -12,7 +12,7 @@
; A couple of ABS64s similarly:
; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
-; CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
+; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000008)
define i32 @main() nounwind {
ret i32 0, !dbg !8
diff --git a/llvm/test/DebugInfo/X86/dbg-value-location.ll b/llvm/test/DebugInfo/X86/dbg-value-location.ll
index 1e21c6a00ae..83907b1cb13 100644
--- a/llvm/test/DebugInfo/X86/dbg-value-location.ll
+++ b/llvm/test/DebugInfo/X86/dbg-value-location.ll
@@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
target triple = "x86_64-apple-darwin10.0.0"
;Radar 8950491
-;CHECK: .long Lset5
+;CHECK: .long Lset6
;CHECK-NEXT: ## DW_AT_decl_file
;CHECK-NEXT: ## DW_AT_decl_line
;CHECK-NEXT: ## DW_AT_type
OpenPOWER on IntegriCloud