summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BlockFrequencyInfo.cpp
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2016-08-19 21:20:13 +0000
committerTim Shen <timshen91@gmail.com>2016-08-19 21:20:13 +0000
commitb5e0f5ac953243829d52aaa0bab65899810b880b (patch)
treed20eb83e0345ef7c1da8278f0a3baa0fadef4b98 /llvm/lib/Analysis/BlockFrequencyInfo.cpp
parente4582d4a2e36a29b8b7bf3d6e2b20c7ce600ece3 (diff)
downloadbcm5719-llvm-b5e0f5ac953243829d52aaa0bab65899810b880b.tar.gz
bcm5719-llvm-b5e0f5ac953243829d52aaa0bab65899810b880b.zip
[GraphTraits] Make nodes_iterator dereference to NodeType*/NodeRef
Currently nodes_iterator may dereference to a NodeType* or a NodeType&. Make them all dereference to NodeType*, which is NodeRef later. Differential Revision: https://reviews.llvm.org/D23704 Differential Revision: https://reviews.llvm.org/D23705 llvm-svn: 279326
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfo.cpp')
-rw-r--r--llvm/lib/Analysis/BlockFrequencyInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp
index 600f945a8b2..a20c8fb280d 100644
--- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp
+++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp
@@ -63,7 +63,7 @@ struct GraphTraits<BlockFrequencyInfo *> {
typedef const BasicBlock NodeType;
typedef const BasicBlock *NodeRef;
typedef succ_const_iterator ChildIteratorType;
- typedef Function::const_iterator nodes_iterator;
+ typedef pointer_iterator<Function::const_iterator> nodes_iterator;
static inline const NodeType *getEntryNode(const BlockFrequencyInfo *G) {
return &G->getFunction()->front();
@@ -75,10 +75,10 @@ struct GraphTraits<BlockFrequencyInfo *> {
return succ_end(N);
}
static nodes_iterator nodes_begin(const BlockFrequencyInfo *G) {
- return G->getFunction()->begin();
+ return nodes_iterator(G->getFunction()->begin());
}
static nodes_iterator nodes_end(const BlockFrequencyInfo *G) {
- return G->getFunction()->end();
+ return nodes_iterator(G->getFunction()->end());
}
};
OpenPOWER on IntegriCloud