mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 20:32:19 +00:00
strength reduce MMI::MappedLabel to MMI::isLabelDeleted,
and add a FIXME about how we are eventually going to zap this lookup table once mc world domination is complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
23071ce80b
commit
a34ec2290f
@ -222,13 +222,14 @@ public:
|
|||||||
LabelIDList[LabelID - 1] = 0;
|
LabelIDList[LabelID - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// MappedLabel - Find out the label's final ID. Zero indicates deletion.
|
/// isLabelDeleted - Return true if the label was deleted.
|
||||||
/// ID != Mapped ID indicates that the label was folded into another label.
|
/// FIXME: This should eventually be eliminated and use the 'is emitted' bit
|
||||||
unsigned MappedLabel(unsigned LabelID) const {
|
/// on MCSymbol.
|
||||||
|
bool isLabelDeleted(unsigned LabelID) const {
|
||||||
assert(LabelID <= LabelIDList.size() && "Debug label ID out of range.");
|
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
|
/// 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
|
/// function's prologue. Used to construct frame maps for debug and exception
|
||||||
/// handling comsumers.
|
/// handling comsumers.
|
||||||
|
@ -1362,9 +1362,14 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(MDNode *SPNode) {
|
|||||||
/// constructLexicalScope - Construct new DW_TAG_lexical_block
|
/// constructLexicalScope - Construct new DW_TAG_lexical_block
|
||||||
/// for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
|
/// for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
|
||||||
DIE *DwarfDebug::constructLexicalScopeDIE(DbgScope *Scope) {
|
DIE *DwarfDebug::constructLexicalScopeDIE(DbgScope *Scope) {
|
||||||
unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID());
|
unsigned StartID = Scope->getStartLabelID();
|
||||||
unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID());
|
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.
|
// Ignore empty scopes.
|
||||||
if (StartID == EndID && StartID != 0)
|
if (StartID == EndID && StartID != 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1387,12 +1392,14 @@ DIE *DwarfDebug::constructLexicalScopeDIE(DbgScope *Scope) {
|
|||||||
/// a function. Construct DIE to represent this concrete inlined copy
|
/// a function. Construct DIE to represent this concrete inlined copy
|
||||||
/// of the function.
|
/// of the function.
|
||||||
DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
|
DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
|
||||||
unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID());
|
unsigned StartID = Scope->getStartLabelID();
|
||||||
unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID());
|
unsigned EndID = Scope->getEndLabelID();
|
||||||
assert (StartID && "Invalid starting label for an inlined scope!");
|
assert(!MMI->isLabelDeleted(StartID) &&
|
||||||
assert (EndID && "Invalid end label for an inlined scope!");
|
"Invalid starting label for an inlined scope!");
|
||||||
|
assert(!MMI->isLabelDeleted(EndID) &&
|
||||||
|
"Invalid end label for an inlined scope!");
|
||||||
// Ignore empty scopes.
|
// Ignore empty scopes.
|
||||||
if (StartID == EndID && StartID != 0)
|
if (StartID == EndID)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!Scope->getScopeNode())
|
if (!Scope->getScopeNode())
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -2589,8 +2596,8 @@ void DwarfDebug::emitDebugLines() {
|
|||||||
// Construct rows of the address, source, line, column matrix.
|
// Construct rows of the address, source, line, column matrix.
|
||||||
for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
|
for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
|
||||||
const SrcLineInfo &LineInfo = LineInfos[i];
|
const SrcLineInfo &LineInfo = LineInfos[i];
|
||||||
unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID());
|
unsigned LabelID = LineInfo.getLabelID();
|
||||||
if (!LabelID) continue;
|
if (MMI->isLabelDeleted(LabelID)) continue;
|
||||||
|
|
||||||
if (LineInfo.getLine() == 0) continue;
|
if (LineInfo.getLine() == 0) continue;
|
||||||
|
|
||||||
|
@ -277,12 +277,9 @@ void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
|
|||||||
const MachineMove &Move = Moves[i];
|
const MachineMove &Move = Moves[i];
|
||||||
unsigned LabelID = Move.getLabelID();
|
unsigned LabelID = Move.getLabelID();
|
||||||
|
|
||||||
if (LabelID) {
|
// Throw out move if the label is invalid.
|
||||||
LabelID = MMI->MappedLabel(LabelID);
|
if (LabelID && MMI->isLabelDeleted(LabelID))
|
||||||
|
continue;
|
||||||
// Throw out move if the label is invalid.
|
|
||||||
if (!LabelID) continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MachineLocation &Dst = Move.getDestination();
|
const MachineLocation &Dst = Move.getDestination();
|
||||||
const MachineLocation &Src = Move.getSource();
|
const MachineLocation &Src = Move.getSource();
|
||||||
|
@ -185,7 +185,8 @@ void MachineModuleInfo::addCleanup(MachineBasicBlock *LandingPad) {
|
|||||||
void MachineModuleInfo::TidyLandingPads() {
|
void MachineModuleInfo::TidyLandingPads() {
|
||||||
for (unsigned i = 0; i != LandingPads.size(); ) {
|
for (unsigned i = 0; i != LandingPads.size(); ) {
|
||||||
LandingPadInfo &LandingPad = LandingPads[i];
|
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
|
// Special case: we *should* emit LPs with null LP MBB. This indicates
|
||||||
// "nounwind" case.
|
// "nounwind" case.
|
||||||
@ -195,17 +196,14 @@ void MachineModuleInfo::TidyLandingPads() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned j=0; j != LandingPads[i].BeginLabels.size(); ) {
|
for (unsigned j=0; j != LandingPads[i].BeginLabels.size(); ) {
|
||||||
unsigned BeginLabel = MappedLabel(LandingPad.BeginLabels[j]);
|
unsigned BeginLabel = LandingPad.BeginLabels[j];
|
||||||
unsigned EndLabel = MappedLabel(LandingPad.EndLabels[j]);
|
unsigned EndLabel = LandingPad.EndLabels[j];
|
||||||
|
if (isLabelDeleted(BeginLabel) || isLabelDeleted(EndLabel)) {
|
||||||
if (!BeginLabel || !EndLabel) {
|
|
||||||
LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
|
LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
|
||||||
LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
|
LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LandingPad.BeginLabels[j] = BeginLabel;
|
|
||||||
LandingPad.EndLabels[j] = EndLabel;
|
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,10 +75,9 @@ JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr,
|
|||||||
unsigned LabelID = Move.getLabelID();
|
unsigned LabelID = Move.getLabelID();
|
||||||
|
|
||||||
if (LabelID) {
|
if (LabelID) {
|
||||||
LabelID = MMI->MappedLabel(LabelID);
|
|
||||||
|
|
||||||
// Throw out move if the label is invalid.
|
// Throw out move if the label is invalid.
|
||||||
if (!LabelID) continue;
|
if (MMI->isLabelDeleted(LabelID))
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t LabelPtr = 0;
|
intptr_t LabelPtr = 0;
|
||||||
@ -722,10 +721,9 @@ JITDwarfEmitter::GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
|
|||||||
unsigned LabelID = Move.getLabelID();
|
unsigned LabelID = Move.getLabelID();
|
||||||
|
|
||||||
if (LabelID) {
|
if (LabelID) {
|
||||||
LabelID = MMI->MappedLabel(LabelID);
|
|
||||||
|
|
||||||
// Throw out move if the label is invalid.
|
// Throw out move if the label is invalid.
|
||||||
if (!LabelID) continue;
|
if (MMI->isLabelDeleted(LabelID))
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t LabelPtr = 0;
|
intptr_t LabelPtr = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user