Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index eeae8a33f425b23cbb9ed8bf3d7d6491de706220..6edce5a2cd94531c99aa8d5ad97e957e52625ec7 100644 (file)
@@ -1815,7 +1815,11 @@ void DwarfDebug::constructCompileUnit(const MDNode *N) {
   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
   // 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())
     addString(Die, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string, Dir);