From 135f735af149e305635ba3886065b493d5c2bf8c Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 26 Jun 2016 12:28:59 +0000 Subject: Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. Only minor manual fixes. No functionality change intended. llvm-svn: 273808 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp') diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index 7f90e3e8b60..1b31c5ae580 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -52,8 +52,8 @@ FunctionPass *llvm::createLowerInvokePass() { bool LowerInvoke::runOnFunction(Function &F) { bool Changed = false; - for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) - if (InvokeInst *II = dyn_cast(BB->getTerminator())) { + for (BasicBlock &BB : F) + if (InvokeInst *II = dyn_cast(BB.getTerminator())) { SmallVector CallArgs(II->op_begin(), II->op_end() - 3); // Insert a normal call instruction... CallInst *NewCall = CallInst::Create(II->getCalledValue(), @@ -68,10 +68,10 @@ bool LowerInvoke::runOnFunction(Function &F) { BranchInst::Create(II->getNormalDest(), II); // Remove any PHI node entries from the exception destination. - II->getUnwindDest()->removePredecessor(&*BB); + II->getUnwindDest()->removePredecessor(&BB); // Remove the invoke instruction now. - BB->getInstList().erase(II); + BB.getInstList().erase(II); ++NumInvokes; Changed = true; } -- cgit v1.2.3