[llvm-commits] [llvm] r100347 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DIE.cpp DwarfDebug.cpp DwarfException.cpp DwarfPrinter.cpp DwarfPrinter.h
Chris Lattner
sabre at nondot.org
Sun Apr 4 12:58:12 PDT 2010
Author: lattner
Date: Sun Apr 4 14:58:12 2010
New Revision: 100347
URL: http://llvm.org/viewvc/llvm-project?rev=100347&view=rev
Log:
inline EmitDifference away.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.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=100347&r1=100346&r2=100347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Sun Apr 4 14:58:12 2010
@@ -285,8 +285,8 @@
/// EmitValue - Emit delta value.
///
void DIEDelta::EmitValue(DwarfPrinter *D, unsigned Form) const {
- bool IsSmall = Form == dwarf::DW_FORM_data4;
- D->EmitDifference(LabelHi, LabelLo, IsSmall);
+ D->getAsm()->EmitLabelDifference(LabelHi, LabelLo,
+ SizeOf(D->getTargetData(), Form));
}
/// SizeOf - Determine size of delta 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=100347&r1=100346&r2=100347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sun Apr 4 14:58:12 2010
@@ -2655,16 +2655,16 @@
// Construct the section header.
Asm->OutStreamer.AddComment("Length of Source Line Info");
- EmitDifference(Asm->GetTempSymbol("line_end"),
- Asm->GetTempSymbol("line_begin"), true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("line_end"),
+ Asm->GetTempSymbol("line_begin"), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("line_begin"));
Asm->OutStreamer.AddComment("DWARF version number");
Asm->EmitInt16(dwarf::DWARF_VERSION);
Asm->OutStreamer.AddComment("Prolog Length");
- EmitDifference(Asm->GetTempSymbol("line_prolog_end"),
- Asm->GetTempSymbol("line_prolog_begin"), true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("line_prolog_end"),
+ Asm->GetTempSymbol("line_prolog_begin"), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("line_prolog_begin"));
Asm->OutStreamer.AddComment("Minimum Instruction Length");
@@ -2833,8 +2833,8 @@
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_frame_common"));
Asm->OutStreamer.AddComment("Length of Common Information Entry");
- EmitDifference(Asm->GetTempSymbol("debug_frame_common_end"),
- Asm->GetTempSymbol("debug_frame_common_begin"), true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("debug_frame_common_end"),
+ Asm->GetTempSymbol("debug_frame_common_begin"), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_frame_common_begin"));
Asm->OutStreamer.AddComment("CIE Identifier Tag");
@@ -2873,7 +2873,7 @@
Asm->GetTempSymbol("debug_frame_begin", DebugFrameInfo.Number);
MCSymbol *DebugFrameEnd =
Asm->GetTempSymbol("debug_frame_end", DebugFrameInfo.Number);
- EmitDifference(DebugFrameEnd, DebugFrameBegin, true);
+ Asm->EmitLabelDifference(DebugFrameEnd, DebugFrameBegin, 4);
Asm->OutStreamer.EmitLabel(DebugFrameBegin);
@@ -2889,8 +2889,8 @@
Asm->OutStreamer.AddComment("FDE address range");
- EmitDifference(Asm->GetTempSymbol("func_end", DebugFrameInfo.Number),
- FuncBeginSym);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("func_end",DebugFrameInfo.Number),
+ FuncBeginSym, TD->getPointerSize());
EmitFrameMoves(FuncBeginSym, DebugFrameInfo.Moves, false);
@@ -2906,8 +2906,9 @@
Asm->getObjFileLowering().getDwarfPubNamesSection());
Asm->OutStreamer.AddComment("Length of Public Names Info");
- EmitDifference(Asm->GetTempSymbol("pubnames_end", ModuleCU->getID()),
- Asm->GetTempSymbol("pubnames_begin", ModuleCU->getID()), true);
+ Asm->EmitLabelDifference(
+ Asm->GetTempSymbol("pubnames_end", ModuleCU->getID()),
+ Asm->GetTempSymbol("pubnames_begin", ModuleCU->getID()), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("pubnames_begin",
ModuleCU->getID()));
@@ -2920,9 +2921,9 @@
Asm->GetTempSymbol("section_info"), true);
Asm->OutStreamer.AddComment("Compilation Unit Length");
- EmitDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
- Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
- true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
+ Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
+ 4);
const StringMap<DIE*> &Globals = ModuleCU->getGlobals();
for (StringMap<DIE*>::const_iterator
@@ -2949,8 +2950,9 @@
Asm->OutStreamer.SwitchSection(
Asm->getObjFileLowering().getDwarfPubTypesSection());
Asm->OutStreamer.AddComment("Length of Public Types Info");
- EmitDifference(Asm->GetTempSymbol("pubtypes_end", ModuleCU->getID()),
- Asm->GetTempSymbol("pubtypes_begin", ModuleCU->getID()), true);
+ Asm->EmitLabelDifference(
+ Asm->GetTempSymbol("pubtypes_end", ModuleCU->getID()),
+ Asm->GetTempSymbol("pubtypes_begin", ModuleCU->getID()), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("pubtypes_begin",
ModuleCU->getID()));
@@ -2963,9 +2965,9 @@
Asm->GetTempSymbol("section_info"), true);
Asm->OutStreamer.AddComment("Compilation ModuleCU Length");
- EmitDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
- Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
- true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
+ Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
+ 4);
const StringMap<DIE*> &Globals = ModuleCU->getGlobalTypes();
for (StringMap<DIE*>::const_iterator
@@ -3079,8 +3081,8 @@
Asm->getObjFileLowering().getDwarfDebugInlineSection());
Asm->OutStreamer.AddComment("Length of Debug Inlined Information Entry");
- EmitDifference(Asm->GetTempSymbol("debug_inlined_end", 1),
- Asm->GetTempSymbol("debug_inlined_begin", 1), true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("debug_inlined_end", 1),
+ Asm->GetTempSymbol("debug_inlined_begin", 1), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_inlined_begin", 1));
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=100347&r1=100346&r2=100347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Sun Apr 4 14:58:12 2010
@@ -80,8 +80,9 @@
// Define the eh frame length.
Asm->OutStreamer.AddComment("Length of Common Information Entry");
- EmitDifference(Asm->GetTempSymbol("eh_frame_common_end", Index),
- Asm->GetTempSymbol("eh_frame_common_begin", Index), true);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("eh_frame_common_end", Index),
+ Asm->GetTempSymbol("eh_frame_common_begin", Index),
+ 4);
// EH frame header.
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_common_begin",Index));
@@ -209,9 +210,9 @@
// EH frame header.
Asm->OutStreamer.AddComment("Length of Frame Information Entry");
- EmitDifference(Asm->GetTempSymbol("eh_frame_end", EHFrameInfo.Number),
- Asm->GetTempSymbol("eh_frame_begin", EHFrameInfo.Number),
- true);
+ Asm->EmitLabelDifference(
+ Asm->GetTempSymbol("eh_frame_end", EHFrameInfo.Number),
+ Asm->GetTempSymbol("eh_frame_begin", EHFrameInfo.Number), 4);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_begin",
EHFrameInfo.Number));
@@ -229,8 +230,9 @@
EmitReference(EHFuncBeginSym, FDEEncoding);
Asm->OutStreamer.AddComment("FDE address range");
- EmitDifference(Asm->GetTempSymbol("eh_func_end", EHFrameInfo.Number),
- EHFuncBeginSym, SizeOfEncodedValue(FDEEncoding) == 4);
+ Asm->EmitLabelDifference(Asm->GetTempSymbol("eh_func_end",
+ EHFrameInfo.Number),
+ EHFuncBeginSym, SizeOfEncodedValue(FDEEncoding));
// If there is a personality and landing pads then point to the language
// specific data area in the exception table.
@@ -810,7 +812,7 @@
EmitSectionOffset(BeginLabel, EHFuncBeginSym, true, true);
Asm->OutStreamer.AddComment("Region length");
- EmitDifference(EndLabel, BeginLabel, true);
+ Asm->EmitLabelDifference(EndLabel, BeginLabel, 4);
// Offset of the landing pad, counted in 16-byte bundles relative to the
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=100347&r1=100346&r2=100347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Sun Apr 4 14:58:12 2010
@@ -130,14 +130,6 @@
Asm->OutStreamer.EmitValue(Exp, SizeOfEncodedValue(Encoding), /*addrspace*/0);
}
-/// EmitDifference - Emit the difference between two labels. If this assembler
-/// supports .set, we emit a .set of a temporary and then use it in the .word.
-void DwarfPrinter::EmitDifference(const MCSymbol *TagHi, const MCSymbol *TagLo,
- bool IsSmall) {
- unsigned Size = IsSmall ? 4 : TD->getPointerSize();
- Asm->EmitLabelDifference(TagHi, TagLo, Size);
-}
-
void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
const MCSymbol *Section,
bool IsSmall, bool isEH) {
@@ -148,7 +140,8 @@
isAbsolute = MAI->isAbsoluteDebugSectionOffsets();
if (!isAbsolute)
- return EmitDifference(Label, Section, IsSmall);
+ return Asm->EmitLabelDifference(Label, Section,
+ IsSmall ? 4 : TD->getPointerSize());
// On COFF targets, we have to emit the weird .secrel32 directive.
if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
@@ -184,7 +177,7 @@
MCSymbol *ThisSym = Label;
if (ThisSym != BaseLabel) {
EmitCFAByte(dwarf::DW_CFA_advance_loc4);
- EmitDifference(ThisSym, BaseLabel, true);
+ Asm->EmitLabelDifference(ThisSym, BaseLabel, 4);
BaseLabel = ThisSym;
}
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h?rev=100347&r1=100346&r2=100347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h Sun Apr 4 14:58:12 2010
@@ -92,10 +92,6 @@
void EmitReference(const MCSymbol *Sym, unsigned Encoding) const;
void EmitReference(const GlobalValue *GV, unsigned Encoding) const;
- /// EmitDifference - Emit the difference between two labels.
- void EmitDifference(const MCSymbol *LabelHi, const MCSymbol *LabelLo,
- bool IsSmall = false);
-
/// EmitSectionOffset - Emit Label-Section or use a special purpose directive
/// to emit a section offset if the target has one.
void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *Section,
More information about the llvm-commits
mailing list