[llvm-commits] [llvm] r98117 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DIE.cpp DwarfDebug.cpp DwarfPrinter.cpp DwarfPrinter.h
Chris Lattner
sabre at nondot.org
Tue Mar 9 17:17:49 PST 2010
Author: lattner
Date: Tue Mar 9 19:17:49 2010
New Revision: 98117
URL: http://llvm.org/viewvc/llvm-project?rev=98117&view=rev
Log:
inline away a form of IsPCRelative, eliminating the
dead IsPCRel argument.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=98117&r1=98116&r2=98117&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Tue Mar 9 19:17:49 2010
@@ -259,7 +259,8 @@
///
void DIELabel::EmitValue(DwarfPrinter *D, unsigned Form) const {
bool IsSmall = Form == dwarf::DW_FORM_data4;
- D->EmitReference(Label, false, IsSmall);
+ unsigned Size = IsSmall ? 4 : D->getTargetData()->getPointerSize();
+ D->getAsm()->OutStreamer.EmitSymbolValue(Label, Size, 0/*AddrSpace*/);
}
/// SizeOf - Determine size of label value in bytes.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=98117&r1=98116&r2=98117&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Mar 9 19:17:49 2010
@@ -2493,7 +2493,9 @@
Asm->EmitInt8(dwarf::DW_LNE_set_address);
Asm->OutStreamer.AddComment("Section end label");
- EmitReference(getDWLabel("section_end", SectionEnd));
+
+ Asm->OutStreamer.EmitSymbolValue(getDWLabel("section_end", SectionEnd),
+ TD->getPointerSize(), 0/*AddrSpace*/);
// Mark end of matrix.
Asm->OutStreamer.AddComment("DW_LNE_end_sequence");
@@ -2627,8 +2629,9 @@
Asm->EmitInt8(dwarf::DW_LNE_set_address);
Asm->OutStreamer.AddComment("Location label");
- EmitReference(getDWLabel("label", LabelID));
-
+ Asm->OutStreamer.EmitSymbolValue(getDWLabel("label", LabelID),
+ TD->getPointerSize(), 0/*AddrSpace*/);
+
// If change of source, then switch to the new source.
if (Source != LineInfo.getSourceID()) {
Source = LineInfo.getSourceID();
@@ -2742,7 +2745,12 @@
getTempLabel("section_debug_frame"), true, false);
Asm->OutStreamer.AddComment("FDE initial location");
- EmitReference(getDWLabel("func_begin", DebugFrameInfo.Number));
+ Asm->OutStreamer.EmitSymbolValue(getDWLabel("func_begin",
+ DebugFrameInfo.Number),
+ TD->getPointerSize(), 0/*AddrSpace*/);
+
+
+
Asm->OutStreamer.AddComment("FDE address range");
EmitDifference(getDWLabel("func_end", DebugFrameInfo.Number),
getDWLabel("func_begin", DebugFrameInfo.Number));
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=98117&r1=98116&r2=98117&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Tue Mar 9 19:17:49 2010
@@ -186,27 +186,6 @@
}
-/// EmitReference - Emit a reference to a label.
-///
-void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative,
- bool Force32Bit) const {
- unsigned Size = Force32Bit ? 4 : TD->getPointerSize();
-
- if (!IsPCRelative) {
- Asm->OutStreamer.EmitSymbolValue(Sym, Size, 0/*AddrSpace*/);
- return;
- }
-
- // FIXME: Need an MCExpr for ".".
- // FIXME: MCize.
- if (Force32Bit || TD->getPointerSize() == sizeof(int32_t))
- O << MAI->getData32bitsDirective();
- else
- O << MAI->getData64bitsDirective();
- O << *Sym;
- if (IsPCRelative) O << "-" << MAI->getPCSymbol();
-}
-
void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h?rev=98117&r1=98116&r2=98117&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h Tue Mar 9 19:17:49 2010
@@ -108,9 +108,6 @@
/// EmitReference - Emit a reference to a label.
///
- void EmitReference(const MCSymbol *Label, bool IsPCRelative = false,
- bool Force32Bit = false) const;
-
void EmitReference(const MCSymbol *Sym, unsigned Encoding) const;
void EmitReference(const GlobalValue *GV, unsigned Encoding) const;
More information about the llvm-commits
mailing list