remove some redundant MMI arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-04-05 06:10:13 +00:00
parent ed3a8067a6
commit de6e783b24
4 changed files with 9 additions and 14 deletions

View File

@@ -180,7 +180,7 @@ public:
/// init - Prepare this SelectionDAG to process code in the given /// init - Prepare this SelectionDAG to process code in the given
/// MachineFunction. /// MachineFunction.
/// ///
void init(MachineFunction &mf, MachineModuleInfo *mmi); void init(MachineFunction &mf);
/// clear - Clear state and free memory necessary to make this /// clear - Clear state and free memory necessary to make this
/// SelectionDAG ready to process a new block. /// SelectionDAG ready to process a new block.

View File

@@ -29,7 +29,6 @@ namespace llvm {
class MachineBasicBlock; class MachineBasicBlock;
class MachineFunction; class MachineFunction;
class MachineInstr; class MachineInstr;
class MachineModuleInfo;
class TargetLowering; class TargetLowering;
class TargetInstrInfo; class TargetInstrInfo;
class FunctionLoweringInfo; class FunctionLoweringInfo;
@@ -283,7 +282,6 @@ private:
const SDValue *Ops, unsigned NumOps, unsigned EmitNodeInfo); const SDValue *Ops, unsigned NumOps, unsigned EmitNodeInfo);
void SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, void SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
MachineModuleInfo *MMI,
const TargetInstrInfo &TII); const TargetInstrInfo &TII);
void FinishBasicBlock(); void FinishBasicBlock();

View File

@@ -801,9 +801,9 @@ SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli)
DbgInfo = new SDDbgInfo(); DbgInfo = new SDDbgInfo();
} }
void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi) { void SelectionDAG::init(MachineFunction &mf) {
MF = &mf; MF = &mf;
MMI = mmi; MMI = &mf.getMMI();
Context = &mf.getFunction()->getContext(); Context = &mf.getFunction()->getContext();
} }
@@ -2256,8 +2256,7 @@ bool SelectionDAG::isVerifiedDebugInfoDesc(SDValue Op) const {
if (GA->getOffset() != 0) return false; if (GA->getOffset() != 0) return false;
GlobalVariable *GV = dyn_cast<GlobalVariable>(GA->getGlobal()); GlobalVariable *GV = dyn_cast<GlobalVariable>(GA->getGlobal());
if (!GV) return false; if (!GV) return false;
MachineModuleInfo *MMI = getMachineModuleInfo(); return MMI->hasDebugInfo();
return MMI && MMI->hasDebugInfo();
} }

View File

@@ -328,8 +328,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
RegInfo = &MF->getRegInfo(); RegInfo = &MF->getRegInfo();
DEBUG(dbgs() << "\n\n\n=== " << Fn.getName() << "\n"); DEBUG(dbgs() << "\n\n\n=== " << Fn.getName() << "\n");
MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>(); CurDAG->init(*MF);
CurDAG->init(*MF, MMI);
FuncInfo->set(Fn, *MF, EnableFastISel); FuncInfo->set(Fn, *MF, EnableFastISel);
SDB->init(GFI, *AA); SDB->init(GFI, *AA);
@@ -338,7 +337,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
// Mark landing pad. // Mark landing pad.
FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad(); FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
SelectAllBasicBlocks(Fn, *MF, MMI, TII); SelectAllBasicBlocks(Fn, *MF, TII);
// If the first basic block in the function has live ins that need to be // If the first basic block in the function has live ins that need to be
// copied into vregs, emit the copies into the top of the block before // copied into vregs, emit the copies into the top of the block before
@@ -840,7 +839,6 @@ void SelectionDAGISel::DoInstructionSelection() {
void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
MachineFunction &MF, MachineFunction &MF,
MachineModuleInfo *MMI,
const TargetInstrInfo &TII) { const TargetInstrInfo &TII) {
// Initialize the Fast-ISel state, if needed. // Initialize the Fast-ISel state, if needed.
FastISel *FastIS = 0; FastISel *FastIS = 0;
@@ -881,10 +879,10 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
} }
} }
if (MMI && BB->isLandingPad()) { if (BB->isLandingPad()) {
// Add a label to mark the beginning of the landing pad. Deletion of the // Add a label to mark the beginning of the landing pad. Deletion of the
// landing pad can thus be detected via the MachineModuleInfo. // landing pad can thus be detected via the MachineModuleInfo.
MCSymbol *Label = MMI->addLandingPad(BB); MCSymbol *Label = MF.getMMI().addLandingPad(BB);
const TargetInstrDesc &II = TII.get(TargetOpcode::EH_LABEL); const TargetInstrDesc &II = TII.get(TargetOpcode::EH_LABEL);
BuildMI(BB, SDB->getCurDebugLoc(), II).addSym(Label); BuildMI(BB, SDB->getCurDebugLoc(), II).addSym(Label);
@@ -918,7 +916,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn,
if (I == E) if (I == E)
// No catch info found - try to extract some from the successor. // No catch info found - try to extract some from the successor.
CopyCatchInfo(Br->getSuccessor(0), LLVMBB, MMI, *FuncInfo); CopyCatchInfo(Br->getSuccessor(0), LLVMBB, &MF.getMMI(), *FuncInfo);
} }
} }