Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.
Only minor manual fixes. No functionality change intended. llvm-svn: 273808
This commit is contained in:
@@ -66,9 +66,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
||||
"UnifiedUnreachableBlock", &F);
|
||||
new UnreachableInst(F.getContext(), UnreachableBlock);
|
||||
|
||||
for (std::vector<BasicBlock*>::iterator I = UnreachableBlocks.begin(),
|
||||
E = UnreachableBlocks.end(); I != E; ++I) {
|
||||
BasicBlock *BB = *I;
|
||||
for (BasicBlock *BB : UnreachableBlocks) {
|
||||
BB->getInstList().pop_back(); // Remove the unreachable inst.
|
||||
BranchInst::Create(UnreachableBlock, BB);
|
||||
}
|
||||
@@ -104,10 +102,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
||||
// Loop over all of the blocks, replacing the return instruction with an
|
||||
// unconditional branch.
|
||||
//
|
||||
for (std::vector<BasicBlock*>::iterator I = ReturningBlocks.begin(),
|
||||
E = ReturningBlocks.end(); I != E; ++I) {
|
||||
BasicBlock *BB = *I;
|
||||
|
||||
for (BasicBlock *BB : ReturningBlocks) {
|
||||
// Add an incoming element to the PHI node for every return instruction that
|
||||
// is merging into this new block...
|
||||
if (PN)
|
||||
|
||||
Reference in New Issue
Block a user