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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188296 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp
index a22fd60..7fb3c90 100644
--- a/lib/CodeGen/AsmPrinter/DIE.cpp
+++ b/lib/CodeGen/AsmPrinter/DIE.cpp
@@ -293,7 +293,9 @@
/// 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.