LabelIDList[LabelID - 1] = 0;
}
- /// MappedLabel - Find out the label's final ID. Zero indicates deletion.
- /// ID != Mapped ID indicates that the label was folded into another label.
- unsigned MappedLabel(unsigned LabelID) const {
+ /// 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 ? LabelIDList[LabelID - 1] : 0;
+ 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.
/// constructLexicalScope - Construct new DW_TAG_lexical_block
/// for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
DIE *DwarfDebug::constructLexicalScopeDIE(DbgScope *Scope) {
- unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID());
- unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID());
+ unsigned StartID = Scope->getStartLabelID();
+ unsigned EndID = Scope->getEndLabelID();
+ assert(!MMI->isLabelDeleted(StartID) &&
+ "Invalid starting label for an inlined scope!");
+ assert(!MMI->isLabelDeleted(EndID) &&
+ "Invalid end label for an inlined scope!");
+
// Ignore empty scopes.
if (StartID == EndID && StartID != 0)
return NULL;
/// a function. Construct DIE to represent this concrete inlined copy
/// of the function.
DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
- unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID());
- unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID());
- assert (StartID && "Invalid starting label for an inlined scope!");
- assert (EndID && "Invalid end label for an inlined scope!");
+ unsigned StartID = Scope->getStartLabelID();
+ unsigned EndID = Scope->getEndLabelID();
+ assert(!MMI->isLabelDeleted(StartID) &&
+ "Invalid starting label for an inlined scope!");
+ assert(!MMI->isLabelDeleted(EndID) &&
+ "Invalid end label for an inlined scope!");
// Ignore empty scopes.
- if (StartID == EndID && StartID != 0)
+ if (StartID == EndID)
return NULL;
if (!Scope->getScopeNode())
return NULL;
// Construct rows of the address, source, line, column matrix.
for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
const SrcLineInfo &LineInfo = LineInfos[i];
- unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID());
- if (!LabelID) continue;
+ unsigned LabelID = LineInfo.getLabelID();
+ if (MMI->isLabelDeleted(LabelID)) continue;
if (LineInfo.getLine() == 0) continue;
const MachineMove &Move = Moves[i];
unsigned LabelID = Move.getLabelID();
- if (LabelID) {
- LabelID = MMI->MappedLabel(LabelID);
-
- // Throw out move if the label is invalid.
- if (!LabelID) continue;
- }
+ // Throw out move if the label is invalid.
+ if (LabelID && MMI->isLabelDeleted(LabelID))
+ continue;
const MachineLocation &Dst = Move.getDestination();
const MachineLocation &Src = Move.getSource();
void MachineModuleInfo::TidyLandingPads() {
for (unsigned i = 0; i != LandingPads.size(); ) {
LandingPadInfo &LandingPad = LandingPads[i];
- LandingPad.LandingPadLabel = MappedLabel(LandingPad.LandingPadLabel);
+ if (isLabelDeleted(LandingPad.LandingPadLabel))
+ LandingPad.LandingPadLabel = 0;
// Special case: we *should* emit LPs with null LP MBB. This indicates
// "nounwind" case.
}
for (unsigned j=0; j != LandingPads[i].BeginLabels.size(); ) {
- unsigned BeginLabel = MappedLabel(LandingPad.BeginLabels[j]);
- unsigned EndLabel = MappedLabel(LandingPad.EndLabels[j]);
-
- if (!BeginLabel || !EndLabel) {
+ unsigned BeginLabel = LandingPad.BeginLabels[j];
+ unsigned EndLabel = LandingPad.EndLabels[j];
+ if (isLabelDeleted(BeginLabel) || isLabelDeleted(EndLabel)) {
LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
continue;
}
- LandingPad.BeginLabels[j] = BeginLabel;
- LandingPad.EndLabels[j] = EndLabel;
++j;
}
unsigned LabelID = Move.getLabelID();
if (LabelID) {
- LabelID = MMI->MappedLabel(LabelID);
-
// Throw out move if the label is invalid.
- if (!LabelID) continue;
+ if (MMI->isLabelDeleted(LabelID))
+ continue;
}
intptr_t LabelPtr = 0;
unsigned LabelID = Move.getLabelID();
if (LabelID) {
- LabelID = MMI->MappedLabel(LabelID);
-
// Throw out move if the label is invalid.
- if (!LabelID) continue;
+ if (MMI->isLabelDeleted(LabelID))
+ continue;
}
intptr_t LabelPtr = 0;