X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FAsmPrinter%2FDIE.cpp;h=0c6e01504ef6ed8dfa7d2524b572f5941bdf4d40;hb=517aaf27d7802c919b82c6bd9f95eceda5f3d535;hp=e8be7ad626d6939f0b09b66eaf44d997c72cd97b;hpb=f698d7775a96afd6385b0f9b9c66646df8feb88a;p=oota-llvm.git diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index e8be7ad626d..0c6e01504ef 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -524,3 +524,34 @@ void DIEBlock::print(raw_ostream &O) const { DIE::print(O, 5); } #endif + +//===----------------------------------------------------------------------===// +// DIELocList Implementation +//===----------------------------------------------------------------------===// + +unsigned DIELocList::SizeOf(AsmPrinter *AP, dwarf::Form Form) const { + if (Form == dwarf::DW_FORM_data4) + return 4; + if (Form == dwarf::DW_FORM_sec_offset) + return 4; + return AP->getDataLayout().getPointerSize(); +} + +/// EmitValue - Emit label value. +/// +void DIELocList::EmitValue(AsmPrinter *AP, dwarf::Form Form) const { + MCSymbol *Label = AP->GetTempSymbol("debug_loc", Index); + MCSymbol *DwarfDebugLocSectionSym = AP->getDwarfDebug()->getDebugLocSym(); + + if (AP->MAI->doesDwarfUseRelocationsAcrossSections()) + AP->EmitSectionOffset(Label, DwarfDebugLocSectionSym); + else + AP->EmitLabelDifference(Label, DwarfDebugLocSectionSym, 4); +} + +#ifndef NDEBUG +void DIELocList::print(raw_ostream &O) const { + O << "LocList: " << Index; + +} +#endif