LLVM
8.0.1
|
An SCC of the call graph. More...
#include "llvm/Analysis/LazyCallGraph.h"
Public Types | |
using | iterator = pointee_iterator< SmallVectorImpl< Node * >::const_iterator > |
Public Member Functions | |
iterator | begin () const |
iterator | end () const |
int | size () const |
RefSCC & | getOuterRefSCC () const |
bool | isParentOf (const SCC &C) const |
Test if this SCC is a parent of C. More... | |
bool | isAncestorOf (const SCC &C) const |
Test if this SCC is an ancestor of C. More... | |
bool | isChildOf (const SCC &C) const |
Test if this SCC is a child of C. More... | |
bool | isDescendantOf (const SCC &C) const |
Test if this SCC is a descendant of C. More... | |
std::string | getName () const |
Provide a short name by printing this SCC to a std::string. More... | |
Friends | |
class | LazyCallGraph |
class | LazyCallGraph::Node |
raw_ostream & | operator<< (raw_ostream &OS, const SCC &C) |
Print a short descrtiption useful for debugging or logging. More... | |
An SCC of the call graph.
This represents a Strongly Connected Component of the direct call graph – ignoring indirect calls and function references. It stores this as a collection of call graph nodes. While the order of nodes in the SCC is stable, it is not any particular order.
The SCCs are nested within a RefSCC
, see below for details about that outer structure. SCCs do not support mutation of the call graph, that must be done through the containing RefSCC
in order to fully reason about the ordering and connections of the graph.
Definition at line 431 of file LazyCallGraph.h.
using llvm::LazyCallGraph::SCC::iterator = pointee_iterator<SmallVectorImpl<Node *>::const_iterator> |
Definition at line 486 of file LazyCallGraph.h.
|
inline |
Definition at line 488 of file LazyCallGraph.h.
References llvm::SmallVectorTemplateCommon< T >::begin().
Referenced by incorporateNewSCCRange(), llvm::PassManager< Function >::run(), llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), llvm::DevirtSCCRepeatedPass< PassT >::run(), and llvm::LazyCallGraph::RefSCC::switchInternalEdgeToRef().
|
inline |
Definition at line 489 of file LazyCallGraph.h.
References llvm::SmallVectorTemplateCommon< T >::end().
Referenced by llvm::PassManager< Function >::run(), llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), llvm::DevirtSCCRepeatedPass< PassT >::run(), and llvm::LazyCallGraph::RefSCC::switchInternalEdgeToRef().
|
inline |
Provide a short name by printing this SCC to a std::string.
This copes with the fact that we don't have a name per-se for an SCC while still making the use of this in debugging and logging useful.
Definition at line 525 of file LazyCallGraph.h.
References llvm::raw_ostream::flush(), and Name.
|
inline |
Definition at line 493 of file LazyCallGraph.h.
References C.
Referenced by isAncestorOf(), llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), and llvm::LazyCallGraph::RefSCC::switchInternalEdgeToCall().
Test if this SCC is an ancestor of C.
Note that in the worst case this is linear in the number of edges departing the current SCC and every SCC in the entire graph reachable from this SCC. Thus this very well may walk every edge in the entire call graph! Do not call this in a tight loop!
Definition at line 250 of file LazyCallGraph.cpp.
References assert(), C, llvm::dbgs(), E, llvm::SmallVectorBase::empty(), G, getOuterRefSCC(), llvm::SmallPtrSetImpl< PtrType >::insert(), LLVM_DUMP_METHOD, llvm::LazyCallGraph::lookupSCC(), N, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), and Size.
Referenced by isDescendantOf().
Test if this SCC is a child of C.
See the comments for isParentOf
for detailed notes about the complexity of this routine.
Definition at line 513 of file LazyCallGraph.h.
References isParentOf().
Test if this SCC is a descendant of C.
See the comments for isParentOf
for detailed notes about the complexity of this routine.
Definition at line 519 of file LazyCallGraph.h.
References isAncestorOf().
Test if this SCC is a parent of C.
Note that this is linear in the number of edges departing the current SCC.
Definition at line 237 of file LazyCallGraph.cpp.
References llvm::LazyCallGraph::EdgeSequence::calls(), E, and N.
Referenced by isChildOf().
|
inline |
Definition at line 491 of file LazyCallGraph.h.
References llvm::SmallVectorBase::size().
Referenced by llvm::DevirtSCCRepeatedPass< PassT >::run(), and llvm::LazyCallGraph::RefSCC::switchInternalEdgeToRef().
|
friend |
Definition at line 432 of file LazyCallGraph.h.
|
friend |
Definition at line 433 of file LazyCallGraph.h.
|
friend |
Print a short descrtiption useful for debugging or logging.
We print the function names in the SCC wrapped in '()'s and skipping the middle functions if there are a large number.
Definition at line 454 of file LazyCallGraph.h.