[mips] Use range-based for loops. NFC.

llvm-svn: 263438
This commit is contained in:
Vasileios Kalintiris 2016-03-14 15:05:30 +00:00
parent 1082fa66a5
commit 42db3ff47f
1 changed files with 5 additions and 7 deletions

View File

@ -387,11 +387,9 @@ static bool fixupFPReturnAndCall(Function &F, Module *M,
bool Modified = false;
LLVMContext &C = M->getContext();
Type *MyVoid = Type::getVoidTy(C);
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
for (BasicBlock::iterator I = BB->begin(), E = BB->end();
I != E; ++I) {
Instruction &Inst = *I;
if (const ReturnInst *RI = dyn_cast<ReturnInst>(I)) {
for (auto &BB: F)
for (auto &I: BB) {
if (const ReturnInst *RI = dyn_cast<ReturnInst>(&I)) {
Value *RVal = RI->getReturnValue();
if (!RVal) continue;
//
@ -425,8 +423,8 @@ static bool fixupFPReturnAndCall(Function &F, Module *M,
A = A.addAttribute(C, AttributeSet::FunctionIndex,
Attribute::NoInline);
Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T, nullptr));
CallInst::Create(F, Params, "", &Inst );
} else if (const CallInst *CI = dyn_cast<CallInst>(I)) {
CallInst::Create(F, Params, "", &I);
} else if (const CallInst *CI = dyn_cast<CallInst>(&I)) {
FunctionType *FT = CI->getFunctionType();
Function *F_ = CI->getCalledFunction();
if (needsFPReturnHelper(*FT) &&