aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LowerInvoke.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-06-26 12:28:59 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-06-26 12:28:59 +0000
commit135f735af149e305635ba3886065b493d5c2bf8c (patch)
treeefc8ab49d69279615e3d0a3563a7d05354270bf5 /llvm/lib/Transforms/Utils/LowerInvoke.cpp
parentff976c99c79d7a00f1c836a57c3e7499316553c4 (diff)
downloadllvm-135f735af149e305635ba3886065b493d5c2bf8c.zip
llvm-135f735af149e305635ba3886065b493d5c2bf8c.tar.gz
llvm-135f735af149e305635ba3886065b493d5c2bf8c.tar.bz2
Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.
Only minor manual fixes. No functionality change intended. llvm-svn: 273808
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerInvoke.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
index 7f90e3e..1b31c5a 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<InvokeInst>(BB->getTerminator())) {
+ for (BasicBlock &BB : F)
+ if (InvokeInst *II = dyn_cast<InvokeInst>(BB.getTerminator())) {
SmallVector<Value*,16> 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;
}