diff options
Diffstat (limited to 'include/clang/Analysis/Analyses/PostOrderCFGView.h')
-rw-r--r-- | include/clang/Analysis/Analyses/PostOrderCFGView.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/clang/Analysis/Analyses/PostOrderCFGView.h b/include/clang/Analysis/Analyses/PostOrderCFGView.h index 4e3244e7b7ca..91bf51cd613f 100644 --- a/include/clang/Analysis/Analyses/PostOrderCFGView.h +++ b/include/clang/Analysis/Analyses/PostOrderCFGView.h @@ -52,7 +52,7 @@ public: // make sure that Block is non-null. Moreover, the CFGBlock iterator will // occasionally hand out null pointers for pruned edges, so we catch those // here. - if (Block == 0) + if (!Block) return false; // if an edge is trivially false. if (VisitedBlockIDs.test(Block->getBlockID())) return false; @@ -76,14 +76,18 @@ private: BlockOrderTy BlockOrder; public: - typedef std::vector<const CFGBlock*>::reverse_iterator iterator; + typedef std::vector<const CFGBlock *>::reverse_iterator iterator; + typedef std::vector<const CFGBlock *>::const_reverse_iterator const_iterator; PostOrderCFGView(const CFG *cfg); iterator begin() { return Blocks.rbegin(); } iterator end() { return Blocks.rend(); } - bool empty() { return begin() == end(); } + const_iterator begin() const { return Blocks.rbegin(); } + const_iterator end() const { return Blocks.rend(); } + + bool empty() const { return begin() == end(); } struct BlockOrderCompare; friend struct BlockOrderCompare; |