diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-26 17:27:42 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-26 17:27:42 +0000 |
commit | aa2091505f6de0ababf8a6ec54e8a26c8b0be2be (patch) | |
tree | 124f3edf32b0d056358b0d313f04fee8feb2d1cb /llvm/lib/Analysis/CostModel.cpp | |
parent | d8db1e172cf320490c273380b847690007247b11 (diff) | |
download | bcm5719-llvm-aa2091505f6de0ababf8a6ec54e8a26c8b0be2be.tar.gz bcm5719-llvm-aa2091505f6de0ababf8a6ec54e8a26c8b0be2be.zip |
Apply clang-tidy's modernize-loop-convert to lib/Analysis.
Only minor manual fixes. No functionality change intended.
llvm-svn: 273816
Diffstat (limited to 'llvm/lib/Analysis/CostModel.cpp')
-rw-r--r-- | llvm/lib/Analysis/CostModel.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp index 36a1db664e1..68a4bea96ba 100644 --- a/llvm/lib/Analysis/CostModel.cpp +++ b/llvm/lib/Analysis/CostModel.cpp @@ -522,16 +522,15 @@ void CostModelAnalysis::print(raw_ostream &OS, const Module*) const { if (!F) return; - for (Function::iterator B = F->begin(), BE = F->end(); B != BE; ++B) { - for (BasicBlock::iterator it = B->begin(), e = B->end(); it != e; ++it) { - Instruction *Inst = &*it; - unsigned Cost = getInstructionCost(Inst); + for (BasicBlock &B : *F) { + for (Instruction &Inst : B) { + unsigned Cost = getInstructionCost(&Inst); if (Cost != (unsigned)-1) OS << "Cost Model: Found an estimated cost of " << Cost; else OS << "Cost Model: Unknown cost"; - OS << " for instruction: "<< *Inst << "\n"; + OS << " for instruction: " << Inst << "\n"; } } } |