summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCarlo Kok <ck@remobjects.com>2013-08-13 17:45:53 +0000
committerCarlo Kok <ck@remobjects.com>2013-08-13 17:45:53 +0000
commitfb849b0f211687bc685fd34a34e68b45807f6ae7 (patch)
tree1473444e5edeb408da7bab0c726c5de45a11cdf6 /llvm
parent349e1c18eb37d67acfdac93344426c04f2b03341 (diff)
downloadbcm5719-llvm-fb849b0f211687bc685fd34a34e68b45807f6ae7.tar.gz
bcm5719-llvm-fb849b0f211687bc685fd34a34e68b45807f6ae7.zip
For COFF only: dwarf debug info output a label reference as a section relative item only when it's one of dw_from strp, sec_offset, ref_addr or op_call_ref instead of going by size.
llvm-svn: 188296
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/AsmPrinter.h8
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp4
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.cpp4
3 files changed, 10 insertions, 6 deletions
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 677331b3bae..59d14ccbd5d 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -359,13 +359,15 @@ namespace llvm {
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
- unsigned Size) const;
+ unsigned Size,
+ bool IsSectionRelative = false) const;
/// EmitLabelReference - Emit something like ".long Label"
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label.
- void EmitLabelReference(const MCSymbol *Label, unsigned Size) const {
- EmitLabelPlusOffset(Label, 0, Size);
+ void EmitLabelReference(const MCSymbol *Label, unsigned Size,
+ bool IsSectionRelative = false) const {
+ EmitLabelPlusOffset(Label, 0, Size, IsSectionRelative);
}
//===------------------------------------------------------------------===//
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 12c35747ee4..d8a20f800b9 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1415,9 +1415,9 @@ void AsmPrinter::EmitLabelOffsetDifference(const MCSymbol *Hi, uint64_t Offset,
/// where the size in bytes of the directive is specified by Size and Label
/// specifies the label. This implicitly uses .set if it is available.
void AsmPrinter::EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
- unsigned Size)
+ unsigned Size, bool IsSectionRelative)
const {
- if (MAI->needsDwarfSectionOffsetDirective() && Size == 4) { // secrel32 ONLY works for 32bits.
+ if (MAI->needsDwarfSectionOffsetDirective() && IsSectionRelative) {
OutStreamer.EmitCOFFSecRel32(Label);
return;
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
index a22fd6064df..7fb3c90dcb6 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -293,7 +293,9 @@ void DIEExpr::print(raw_ostream &O) const {
/// EmitValue - Emit label value.
///
void DIELabel::EmitValue(AsmPrinter *AP, uint16_t Form) const {
- AP->EmitLabelReference(Label, SizeOf(AP, Form));
+ AP->EmitLabelReference(Label, SizeOf(AP, Form), Form == dwarf::DW_FORM_strp
+ || Form == dwarf::DW_FORM_sec_offset || Form == dwarf::DW_OP_call_ref
+ || Form == dwarf::DW_FORM_ref_addr);
}
/// SizeOf - Determine size of label value in bytes.
OpenPOWER on IntegriCloud