diff options
Diffstat (limited to 'include/llvm/Support/PredIteratorCache.h')
-rw-r--r-- | include/llvm/Support/PredIteratorCache.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/Support/PredIteratorCache.h b/include/llvm/Support/PredIteratorCache.h index 9eb7a77044..cef9de0b27 100644 --- a/include/llvm/Support/PredIteratorCache.h +++ b/include/llvm/Support/PredIteratorCache.h @@ -31,7 +31,7 @@ namespace llvm { /// Memory - This is the space that holds cached preds. BumpPtrAllocator Memory; public: - + /// GetPreds - Get a cached list for the null-terminated predecessor list of /// the specified block. This can be used in a loop like this: /// for (BasicBlock **PI = PredCache->GetPreds(BB); *PI; ++PI) @@ -41,15 +41,15 @@ namespace llvm { BasicBlock **GetPreds(BasicBlock *BB) { BasicBlock **&Entry = BlockToPredsMap[BB]; if (Entry) return Entry; - + SmallVector<BasicBlock*, 32> PredCache(pred_begin(BB), pred_end(BB)); PredCache.push_back(0); // null terminator. - + Entry = Memory.Allocate<BasicBlock*>(PredCache.size()); std::copy(PredCache.begin(), PredCache.end(), Entry); return Entry; } - + /// clear - Remove all information. void clear() { BlockToPredsMap.clear(); |