diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-26 14:10:56 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-26 14:10:56 +0000 |
commit | af28e7d6fa1fdaf3a7a63e4564b3b8d30d4e9133 (patch) | |
tree | 5beb9de8291820460f0297b7389e2e8f28218bf4 /llvm/lib/IR/AsmWriter.cpp | |
parent | 57819aa185196b8d3c4dda3c2282d2128aef3a51 (diff) | |
download | bcm5719-llvm-af28e7d6fa1fdaf3a7a63e4564b3b8d30d4e9133.tar.gz bcm5719-llvm-af28e7d6fa1fdaf3a7a63e4564b3b8d30d4e9133.zip |
Apply clang-tidy's modernize-loop-convert to most of lib/IR.
Only minor manual fixes. No functionality change intended.
llvm-svn: 273813
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 0aa0b8014f0..b0c6984943e 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -2709,8 +2709,8 @@ void AssemblyWriter::printFunction(const Function *F) { Out << " {"; // Output all of the function's basic blocks. - for (Function::const_iterator I = F->begin(), E = F->end(); I != E; ++I) - printBasicBlock(&*I); + for (const BasicBlock &BB : *F) + printBasicBlock(&BB); // Output the function's use-lists. printUseLists(F); @@ -2782,8 +2782,8 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { if (AnnotationWriter) AnnotationWriter->emitBasicBlockStartAnnot(BB, Out); // Output all of the instructions in the basic block... - for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { - printInstructionLine(*I); + for (const Instruction &I : *BB) { + printInstructionLine(I); } if (AnnotationWriter) AnnotationWriter->emitBasicBlockEndAnnot(BB, Out); @@ -3243,10 +3243,9 @@ void AssemblyWriter::writeAllAttributeGroups() { I != E; ++I) asVec[I->second] = *I; - for (std::vector<std::pair<AttributeSet, unsigned> >::iterator - I = asVec.begin(), E = asVec.end(); I != E; ++I) - Out << "attributes #" << I->second << " = { " - << I->first.getAsString(AttributeSet::FunctionIndex, true) << " }\n"; + for (const auto &I : asVec) + Out << "attributes #" << I.second << " = { " + << I.first.getAsString(AttributeSet::FunctionIndex, true) << " }\n"; } void AssemblyWriter::printUseListOrder(const UseListOrder &Order) { |