diff options
author | Vasileios Kalintiris <Vasileios.Kalintiris@imgtec.com> | 2016-03-14 15:05:30 +0000 |
---|---|---|
committer | Vasileios Kalintiris <Vasileios.Kalintiris@imgtec.com> | 2016-03-14 15:05:30 +0000 |
commit | 42db3ff47fccf3e38d4229e3dd1a4864b21321fe (patch) | |
tree | 06288bef8d12692ec3d54706bfd8b597e62377c4 /llvm/lib/Target/Mips/Mips16HardFloat.cpp | |
parent | 1082fa66a5ba321f55120ab26c996c7c86ac1e56 (diff) | |
download | bcm5719-llvm-42db3ff47fccf3e38d4229e3dd1a4864b21321fe.tar.gz bcm5719-llvm-42db3ff47fccf3e38d4229e3dd1a4864b21321fe.zip |
[mips] Use range-based for loops. NFC.
llvm-svn: 263438
Diffstat (limited to 'llvm/lib/Target/Mips/Mips16HardFloat.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/Mips16HardFloat.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp index d5de409ecc3..1e90870b0d1 100644 --- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp +++ b/llvm/lib/Target/Mips/Mips16HardFloat.cpp @@ -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) && |