[llvm-commits] [llvm] r98461 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
Chris Lattner
sabre at nondot.org
Sat Mar 13 18:20:58 PST 2010
Author: lattner
Date: Sat Mar 13 20:20:58 2010
New Revision: 98461
URL: http://llvm.org/viewvc/llvm-project?rev=98461&view=rev
Log:
use Label->isDefined() instead of isLabelDeleted() now that we
consistently use MCSymbol and only call this predicate after
they should have been emitted.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=98461&r1=98460&r2=98461&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Sat Mar 13 20:20:58 2010
@@ -224,14 +224,6 @@
LabelIDList[LabelID - 1] = 0;
}
- /// isLabelDeleted - Return true if the label was deleted.
- /// FIXME: This should eventually be eliminated and use the 'is emitted' bit
- /// on MCSymbol.
- bool isLabelDeleted(unsigned LabelID) const {
- assert(LabelID <= LabelIDList.size() && "Debug label ID out of range.");
- return LabelID == 0 || LabelIDList[LabelID - 1] == 0;
- }
-
/// getFrameMoves - Returns a reference to a list of moves done in the current
/// function's prologue. Used to construct frame maps for debug and exception
/// handling comsumers.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=98461&r1=98460&r2=98461&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Mar 13 20:20:58 2010
@@ -2615,7 +2615,8 @@
for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
const SrcLineInfo &LineInfo = LineInfos[i];
unsigned LabelID = LineInfo.getLabelID();
- if (MMI->isLabelDeleted(LabelID)) continue;
+ MCSymbol *Label = getDWLabel("label", LabelID);
+ if (!Label->isDefined()) continue; // Not emitted, in dead code.
if (LineInfo.getLine() == 0) continue;
@@ -2638,8 +2639,8 @@
Asm->EmitInt8(dwarf::DW_LNE_set_address);
Asm->OutStreamer.AddComment("Location label");
- Asm->OutStreamer.EmitSymbolValue(getDWLabel("label", LabelID),
- TD->getPointerSize(), 0/*AddrSpace*/);
+ Asm->OutStreamer.EmitSymbolValue(Label, TD->getPointerSize(),
+ 0/*AddrSpace*/);
// If change of source, then switch to the new source.
if (Source != LineInfo.getSourceID()) {
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=98461&r1=98460&r2=98461&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Sat Mar 13 20:20:58 2010
@@ -248,17 +248,17 @@
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
const MachineMove &Move = Moves[i];
unsigned LabelID = Move.getLabelID();
-
// Throw out move if the label is invalid.
- if (LabelID && MMI->isLabelDeleted(LabelID))
- continue;
+ if (LabelID == 0) continue;
+ MCSymbol *Label = getDWLabel("label", LabelID);
+ if (!Label->isDefined()) continue; // Not emitted, in dead code.
const MachineLocation &Dst = Move.getDestination();
const MachineLocation &Src = Move.getSource();
// Advance row if new location.
- if (BaseLabel && LabelID) {
- MCSymbol *ThisSym = getDWLabel("label", LabelID);
+ if (BaseLabel) {
+ MCSymbol *ThisSym = Label;
if (ThisSym != BaseLabel) {
EmitCFAByte(dwarf::DW_CFA_advance_loc4);
EmitDifference(ThisSym, BaseLabel, true);
More information about the llvm-commits
mailing list