diff options
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 11 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfPrinter.h | 4 |
3 files changed, 7 insertions, 20 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2a1ff9a..62c0d21 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -15,6 +15,7 @@ #include "llvm/Module.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSection.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCAsmInfo.h" @@ -2967,12 +2968,11 @@ void DwarfDebug::emitDebugInlineInfo() { DIE *SP = LI->second; Asm->EmitInt32(SP->getOffset()); EOL("DIE offset"); - if (TD->getPointerSize() == sizeof(int32_t)) - O << MAI->getData32bitsDirective(); - else - O << MAI->getData64bitsDirective(); - - PrintLabelName(getDWLabel("label", LI->first)); EOL("low_pc"); + // FIXME: "Labels" should hold MCSymbol*'s + MCSymbol *L = getDWLabel("label", LI->first); + if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("low_pc"); + Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(L, Asm->OutContext), + TD->getPointerSize(), 0/*AddrSpace*/); } } diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 8dd72c4..3eee561 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -209,13 +209,6 @@ void DwarfPrinter::EmitULEB128(unsigned Value, const char *Desc, } -/// PrintLabelName - Print label name in form used by Dwarf writer. -/// -void DwarfPrinter::PrintLabelName(const MCSymbol *Label) const { - // FIXME: REMOVE. - O << Label->getName(); -} - /// EmitReference - Emit a reference to a label. /// void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative, @@ -229,7 +222,7 @@ void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const { const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); PrintRelDirective(Encoding); - O << *TLOF.getSymbolForDwarfReference(Sym, Asm->MMI, Encoding);; + O << *TLOF.getSymbolForDwarfReference(Sym, Asm->MMI, Encoding); } void DwarfPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const{ @@ -300,8 +293,6 @@ void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, EmitCFAByte(dwarf::DW_CFA_advance_loc4); EmitDifference(getDWLabel("label", LabelID), getDWLabel(BaseLabel, BaseLabelID), true); - Asm->O << '\n'; - BaseLabelID = LabelID; BaseLabel = "label"; IsLocal = true; diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/lib/CodeGen/AsmPrinter/DwarfPrinter.h index cce62aa..fd55a17 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.h +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.h @@ -113,10 +113,6 @@ public: unsigned PadTo = 0) const; - /// PrintLabelName - Print label name in form used by Dwarf writer. - /// - void PrintLabelName(const MCSymbol *Label) const; - /// EmitReference - Emit a reference to a label. /// void EmitReference(const MCSymbol *Label, bool IsPCRelative = false, |