* Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
InstrTypes.h anymore
llvm-svn: 1750
diff --git a/llvm/lib/Target/Sparc/Sparc.cpp b/llvm/lib/Target/Sparc/Sparc.cpp
index b026ccd..a4556d1 100644
--- a/llvm/lib/Target/Sparc/Sparc.cpp
+++ b/llvm/lib/Target/Sparc/Sparc.cpp
@@ -84,15 +84,16 @@
void InsertPrologEpilogCode::InsertEpilogCode(Method* method)
{
- for (Method::iterator I=method->begin(), E=method->end(); I != E; ++I)
- if ((*I)->getTerminator()->getOpcode() == Instruction::Ret)
+ for (Method::iterator I=method->begin(), E=method->end(); I != E; ++I) {
+ Instruction *TermInst = (Instruction*)(*I)->getTerminator();
+ if (TermInst->getOpcode() == Instruction::Ret)
{
BasicBlock* exitBB = *I;
unsigned N = GetInstructionsForEpilog(exitBB, Target, minstrVec);
MachineCodeForBasicBlock& bbMvec = exitBB->getMachineInstrVec();
MachineCodeForInstruction &termMvec =
- MachineCodeForInstruction::get(exitBB->getTerminator());
+ MachineCodeForInstruction::get(TermInst);
// Remove the NOPs in the delay slots of the return instruction
const MachineInstrInfo &mii = Target.getInstrInfo();
@@ -115,6 +116,7 @@
// Append the epilog code to the end of the basic block.
bbMvec.push_back(minstrVec[0]);
}
+ }
}