diff options
| author | Dan Gohman <gohman@apple.com> | 2010-04-14 19:53:31 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-04-14 19:53:31 +0000 |
| commit | 7deb447781bee7639ffb12a31c8e4f74a2ba9db8 (patch) | |
| tree | 54ee7d7853cb815db63556b572e3dc5d6b234963 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | |
| parent | c2c08d19b80f08c9fd6c1b17181665b983157885 (diff) | |
| download | llvm-7deb447781bee7639ffb12a31c8e4f74a2ba9db8.zip llvm-7deb447781bee7639ffb12a31c8e4f74a2ba9db8.tar.gz llvm-7deb447781bee7639ffb12a31c8e4f74a2ba9db8.tar.bz2 | |
Factor out EH landing pad code into a separate function, and constify
a bunch of stuff to support it.
llvm-svn: 101273
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index a934adf8..f88cfb0 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -305,10 +305,10 @@ GlobalVariable *llvm::ExtractTypeInfo(Value *V) { /// AddCatchInfo - Extract the personality and type infos from an eh.selector /// call, and add them to the specified machine basic block. -void llvm::AddCatchInfo(CallInst &I, MachineModuleInfo *MMI, +void llvm::AddCatchInfo(const CallInst &I, MachineModuleInfo *MMI, MachineBasicBlock *MBB) { // Inform the MachineModuleInfo of the personality for this landing pad. - ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(2)); + const ConstantExpr *CE = cast<ConstantExpr>(I.getOperand(2)); assert(CE->getOpcode() == Instruction::BitCast && isa<Function>(CE->getOperand(0)) && "Personality should be a function"); @@ -320,7 +320,7 @@ void llvm::AddCatchInfo(CallInst &I, MachineModuleInfo *MMI, unsigned N = I.getNumOperands(); for (unsigned i = N - 1; i > 2; --i) { - if (ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i))) { + if (const ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(i))) { unsigned FilterLength = CI->getZExtValue(); unsigned FirstCatch = i + FilterLength + !FilterLength; assert (FirstCatch <= N && "Invalid filter length"); @@ -357,10 +357,11 @@ void llvm::AddCatchInfo(CallInst &I, MachineModuleInfo *MMI, } } -void llvm::CopyCatchInfo(BasicBlock *SrcBB, BasicBlock *DestBB, +void llvm::CopyCatchInfo(const BasicBlock *SrcBB, const BasicBlock *DestBB, MachineModuleInfo *MMI, FunctionLoweringInfo &FLI) { - for (BasicBlock::iterator I = SrcBB->begin(), E = --SrcBB->end(); I != E; ++I) - if (EHSelectorInst *EHSel = dyn_cast<EHSelectorInst>(I)) { + for (BasicBlock::const_iterator I = SrcBB->begin(), E = --SrcBB->end(); + I != E; ++I) + if (const EHSelectorInst *EHSel = dyn_cast<EHSelectorInst>(I)) { // Apply the catch info to DestBB. AddCatchInfo(*EHSel, MMI, FLI.MBBMap[DestBB]); #ifndef NDEBUG |
