diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-05-01 12:12:42 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-05-01 12:12:42 +0000 |
| commit | 4b096741b4f2d0372cc307873edbace5cc18cda8 (patch) | |
| tree | b2a33c31137690566660676f49342c2b1f4ecd51 /llvm/include | |
| parent | 80070b5598d068325701b886e43506a844dc7307 (diff) | |
| download | bcm5719-llvm-4b096741b4f2d0372cc307873edbace5cc18cda8.tar.gz bcm5719-llvm-4b096741b4f2d0372cc307873edbace5cc18cda8.zip | |
[LCG] Add some basic methods for querying the parent/child relationships
of SCCs in the SCC DAG. Exercise them in the big graph test case. These
will be especially useful for establishing invariants in insertion
logic.
llvm-svn: 207749
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/LazyCallGraph.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h index e5dd5cc2caa..df4fddf8669 100644 --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -238,6 +238,20 @@ public: return iterator_range<parent_iterator>(parent_begin(), parent_end()); } + /// \brief Test if this SCC is a parent of \a C. + bool isParentOf(const SCC &C) const { return C.isChildOf(*this); } + + /// \brief Test if this SCC is an ancestor of \a C. + bool isAncestorOf(const SCC &C) const { return C.isDescendantOf(*this); } + + /// \brief Test if this SCC is a child of \a C. + bool isChildOf(const SCC &C) const { + return ParentSCCs.count(const_cast<SCC *>(&C)); + } + + /// \brief Test if this SCC is a descendant of \a C. + bool isDescendantOf(const SCC &C) const; + ///@{ /// \name Mutation API /// |

