diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-23 21:53:34 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-23 21:53:34 +0000 |
commit | 76dd96eda05c0dc7dfc62b5b5fbdd20aae86808b (patch) | |
tree | 97f5958b5fa50b87f9dbc56a6018955c87f5e18a /lib/CodeGen/SelectionDAG | |
parent | 665eff59e660d500cdf882d2ed606b6e6000d069 (diff) | |
download | external_llvm-76dd96eda05c0dc7dfc62b5b5fbdd20aae86808b.zip external_llvm-76dd96eda05c0dc7dfc62b5b5fbdd20aae86808b.tar.gz external_llvm-76dd96eda05c0dc7dfc62b5b5fbdd20aae86808b.tar.bz2 |
Arrange for FastISel code to have access to the MachineModuleInfo
object. This will be needed to support debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 3139cb3..4b77322 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -450,7 +450,7 @@ FastISel::SelectOperator(User *I, unsigned Opcode) { UpdateValueMap(I, Reg); return true; } - + default: // Unhandled instruction. Halt "fast" selection and bail. return false; @@ -458,6 +458,7 @@ FastISel::SelectOperator(User *I, unsigned Opcode) { } FastISel::FastISel(MachineFunction &mf, + MachineModuleInfo *mmi, DenseMap<const Value *, unsigned> &vm, DenseMap<const BasicBlock *, MachineBasicBlock *> &bm, DenseMap<const AllocaInst *, int> &am) @@ -466,6 +467,7 @@ FastISel::FastISel(MachineFunction &mf, MBBMap(bm), StaticAllocaMap(am), MF(mf), + MMI(mmi), MRI(MF.getRegInfo()), MFI(*MF.getFrameInfo()), MCP(*MF.getConstantPool()), diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index c2938e3..c1e80fc 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -309,7 +309,8 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { DOUT << "\n\n\n=== " << Fn.getName() << "\n"; FuncInfo->set(Fn, MF, EnableFastISel); - CurDAG->init(MF, getAnalysisToUpdate<MachineModuleInfo>()); + MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>(); + CurDAG->init(MF, MMI); SDL->init(GFI, *AA); for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) @@ -317,7 +318,7 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { // Mark landing pad. FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad(); - SelectAllBasicBlocks(Fn, MF); + SelectAllBasicBlocks(Fn, MF, MMI); // 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 @@ -710,7 +711,8 @@ void SelectionDAGISel::CodeGenAndEmitDAG() { DEBUG(BB->dump()); } -void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) { +void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, + MachineModuleInfo *MMI) { for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) { BasicBlock *LLVMBB = &*I; BB = FuncInfo->MBBMap[LLVMBB]; @@ -726,7 +728,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) { // Before doing SelectionDAG ISel, see if FastISel has been requested. // FastISel doesn't support EH landing pads, which require special handling. if (EnableFastISel && !BB->isLandingPad()) { - if (FastISel *F = TLI.createFastISel(*FuncInfo->MF, FuncInfo->ValueMap, + if (FastISel *F = TLI.createFastISel(*FuncInfo->MF, MMI, + FuncInfo->ValueMap, FuncInfo->MBBMap, FuncInfo->StaticAllocaMap)) { // Emit code for any incoming arguments. This must happen before |