Sink DwarfUnit::addLocationList down into DwarfCompileUnit
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfCompileUnit.cpp
index 0b7f0f339f7b11f9a403a90414d06aaddfed995d..b9efb250a64b8ab92369c9d6b1253b18920b920c 100644 (file)
@@ -800,4 +800,13 @@ void DwarfCompileUnit::addComplexAddress(const DbgVariable &DV, DIE &Die,
   // Now attach the location information to the DIE.
   addBlock(Die, Attribute, Loc);
 }
+
+/// Add a Dwarf loclistptr attribute data and value.
+void DwarfCompileUnit::addLocationList(DIE &Die, dwarf::Attribute Attribute,
+                                       unsigned Index) {
+  DIEValue *Value = new (DIEValueAllocator) DIELocList(Index);
+  dwarf::Form Form = DD->getDwarfVersion() >= 4 ? dwarf::DW_FORM_sec_offset
+                                                : dwarf::DW_FORM_data4;
+  Die.addValue(Attribute, Form, Value);
+}
 } // end llvm namespace