diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-03-15 11:19:41 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-03-15 11:19:41 +0000 |
commit | 847d3812adab7385c64783c004f679708f0d7924 (patch) | |
tree | 186811ce31a9dbddeb25ab342a4dd38e68e55208 /lib/Transforms | |
parent | d03a29b69d7285ed2ca523d70a45174e33716727 (diff) | |
download | external_llvm-847d3812adab7385c64783c004f679708f0d7924.zip external_llvm-847d3812adab7385c64783c004f679708f0d7924.tar.gz external_llvm-847d3812adab7385c64783c004f679708f0d7924.tar.bz2 |
Use an iterator instead of calling .size() on the worklist every time, which is wasteful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineWorklist.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineWorklist.h b/lib/Transforms/InstCombine/InstCombineWorklist.h index 32009c3..99a02fc 100644 --- a/lib/Transforms/InstCombine/InstCombineWorklist.h +++ b/lib/Transforms/InstCombine/InstCombineWorklist.h @@ -55,9 +55,9 @@ public: Worklist.reserve(NumEntries+16); WorklistMap.resize(NumEntries); DEBUG(errs() << "IC: ADDING: " << NumEntries << " instrs to worklist\n"); - for (; NumEntries; --NumEntries) { + for (unsigned Idx = 0; NumEntries; --NumEntries) { Instruction *I = List[NumEntries-1]; - WorklistMap.insert(std::make_pair(I, Worklist.size())); + WorklistMap.insert(std::make_pair(I, Idx++)); Worklist.push_back(I); } } |