diff options
| author | Craig Topper <craig.topper@gmail.com> | 2015-10-22 16:35:56 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2015-10-22 16:35:56 +0000 |
| commit | 42526d33728a9a374af539c35a8d3c12064b44cf (patch) | |
| tree | 2bf2c6c0877da85920394eae041a54470c39abe2 /llvm/include | |
| parent | 8f509a7044e588bc74ed6d1b3256dab3915c550f (diff) | |
| download | bcm5719-llvm-42526d33728a9a374af539c35a8d3c12064b44cf.tar.gz bcm5719-llvm-42526d33728a9a374af539c35a8d3c12064b44cf.zip | |
Use ArrayRef instead of pointer and size. NFC
llvm-svn: 251029
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h b/llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h index a6bad343db4..5d2b2d00000 100644 --- a/llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h +++ b/llvm/include/llvm/Transforms/InstCombine/InstCombineWorklist.h @@ -60,13 +60,13 @@ public: /// AddInitialGroup - Add the specified batch of stuff in reverse order. /// which should only be done when the worklist is empty and when the group /// has no duplicates. - void AddInitialGroup(Instruction *const *List, unsigned NumEntries) { + void AddInitialGroup(ArrayRef<Instruction *> List) { assert(Worklist.empty() && "Worklist must be empty to add initial group"); - Worklist.reserve(NumEntries+16); - WorklistMap.resize(NumEntries); - DEBUG(dbgs() << "IC: ADDING: " << NumEntries << " instrs to worklist\n"); - for (unsigned Idx = 0; NumEntries; --NumEntries) { - Instruction *I = List[NumEntries-1]; + Worklist.reserve(List.size()+16); + WorklistMap.resize(List.size()); + DEBUG(dbgs() << "IC: ADDING: " << List.size() << " instrs to worklist\n"); + unsigned Idx = 0; + for (Instruction *I : reverse(List)) { WorklistMap.insert(std::make_pair(I, Idx++)); Worklist.push_back(I); } |

