summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-14 02:20:58 +0000
committerChris Lattner <sabre@nondot.org>2010-03-14 02:20:58 +0000
commitee95d4c61cba2d8d51a92db962d51d24bb37b23b (patch)
tree775ec4710349e53ec7a9379f055023bd8549bddf /llvm
parentf7aa541107162869eed6ff6e01526bb2b9f3edab (diff)
downloadbcm5719-llvm-ee95d4c61cba2d8d51a92db962d51d24bb37b23b.tar.gz
bcm5719-llvm-ee95d4c61cba2d8d51a92db962d51d24bb37b23b.zip
use Label->isDefined() instead of isLabelDeleted() now that we
consistently use MCSymbol and only call this predicate after they should have been emitted. llvm-svn: 98461
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/MachineModuleInfo.h8
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp10
3 files changed, 9 insertions, 16 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineModuleInfo.h b/llvm/include/llvm/CodeGen/MachineModuleInfo.h
index b4b641858e3..eba49bd7963 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleInfo.h
@@ -224,14 +224,6 @@ public:
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.
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 98e60a7616c..4b71cfe0036 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2615,7 +2615,8 @@ void DwarfDebug::emitDebugLines() {
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 @@ void DwarfDebug::emitDebugLines() {
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()) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 8d633f3dd6a..000d93ff1b0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -248,17 +248,17 @@ void DwarfPrinter::EmitFrameMoves(MCSymbol *BaseLabel,
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);
OpenPOWER on IntegriCloud