mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
eliminate InvalidateLabel and LabelIDList from MMI and replace
them with a counter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -105,17 +105,6 @@ void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) {
|
||||
while (!MBB->succ_empty())
|
||||
MBB->removeSuccessor(MBB->succ_end()-1);
|
||||
|
||||
// If there are any labels in the basic block, unregister them from
|
||||
// MachineModuleInfo.
|
||||
if (MMI && !MBB->empty()) {
|
||||
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
|
||||
I != E; ++I) {
|
||||
if (I->isLabel())
|
||||
// The label ID # is always operand #0, an immediate.
|
||||
MMI->InvalidateLabel(I->getOperand(0).getImm());
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the block.
|
||||
MF->erase(MBB);
|
||||
}
|
||||
|
@@ -41,8 +41,8 @@ MachineModuleInfoImpl::~MachineModuleInfoImpl() {}
|
||||
|
||||
MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI)
|
||||
: ImmutablePass(&ID), Context(MAI),
|
||||
ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0),
|
||||
DbgInfoAvailable(false) {
|
||||
ObjFileMMI(0), NextLabelIDToReturn(1),
|
||||
CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){
|
||||
// Always emit some info, by default "no personality" info.
|
||||
Personalities.push_back(NULL);
|
||||
}
|
||||
|
@@ -648,17 +648,6 @@ void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) {
|
||||
while (!MBB->succ_empty())
|
||||
MBB->removeSuccessor(MBB->succ_end()-1);
|
||||
|
||||
// If there are any labels in the basic block, unregister them from
|
||||
// MachineModuleInfo.
|
||||
if (MMI && !MBB->empty()) {
|
||||
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
|
||||
I != E; ++I) {
|
||||
if (I->isLabel())
|
||||
// The label ID # is always operand #0, an immediate.
|
||||
MMI->InvalidateLabel(I->getOperand(0).getImm());
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the block.
|
||||
MBB->eraseFromParent();
|
||||
}
|
||||
|
@@ -165,20 +165,8 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
|
||||
}
|
||||
|
||||
// Actually remove the blocks now.
|
||||
for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) {
|
||||
MachineBasicBlock *MBB = DeadBlocks[i];
|
||||
// If there are any labels in the basic block, unregister them from
|
||||
// MachineModuleInfo.
|
||||
if (MMI && !MBB->empty()) {
|
||||
for (MachineBasicBlock::iterator I = MBB->begin(),
|
||||
E = MBB->end(); I != E; ++I) {
|
||||
if (I->isLabel())
|
||||
// The label ID # is always operand #0, an immediate.
|
||||
MMI->InvalidateLabel(I->getOperand(0).getImm());
|
||||
}
|
||||
}
|
||||
MBB->eraseFromParent();
|
||||
}
|
||||
for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i)
|
||||
DeadBlocks[i]->eraseFromParent();
|
||||
|
||||
// Cleanup PHI nodes.
|
||||
for (MachineFunction::iterator I = F.begin(), E = F.end(); I != E; ++I) {
|
||||
|
Reference in New Issue
Block a user