LLVM 20.0.0git
|
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. | |
bool | isAncestorOf (const SCC &C) const |
Test if this SCC is an ancestor of C. | |
bool | isChildOf (const SCC &C) const |
Test if this SCC is a child of C. | |
bool | isDescendantOf (const SCC &C) const |
Test if this SCC is a descendant of C. | |
std::string | getName () const |
Provide a short name by printing this SCC to a std::string. | |
Friends | |
class | LazyCallGraph |
class | LazyCallGraph::Node |
raw_ostream & | operator<< (raw_ostream &OS, const SCC &C) |
Print a short description useful for debugging or logging. | |
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 415 of file LazyCallGraph.h.
using llvm::LazyCallGraph::SCC::iterator = pointee_iterator<SmallVectorImpl<Node *>::const_iterator> |
Definition at line 471 of file LazyCallGraph.h.
|
inline |
Definition at line 473 of file LazyCallGraph.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by llvm::InlinerPass::run(), and llvm::InlineAdvisorAnalysisPrinterPass::run().
|
inline |
Definition at line 474 of file LazyCallGraph.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
|
inline |
|
inline |
Definition at line 478 of file LazyCallGraph.h.
Referenced by llvm::CallGraphUpdater::replaceFunctionWith(), llvm::LazyCallGraph::RefSCC::switchInternalEdgeToCall(), and updateCGAndAnalysisManagerForPass().
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 297 of file LazyCallGraph.cpp.
References llvm::CallingConv::C, llvm::SmallVectorBase< Size_T >::empty(), G, llvm::SmallPtrSetImpl< PtrType >::insert(), N, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
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 498 of file LazyCallGraph.h.
References C.
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 504 of file LazyCallGraph.h.
References C.
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 284 of file LazyCallGraph.cpp.
References llvm::CallingConv::C, and N.
|
inline |
Definition at line 476 of file LazyCallGraph.h.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::InlinerPass::run(), llvm::InlineAdvisorAnalysisPrinterPass::run(), and llvm::LazyCallGraph::RefSCC::switchInternalEdgeToRef().
|
friend |
Definition at line 416 of file LazyCallGraph.h.
|
friend |
Definition at line 417 of file LazyCallGraph.h.
|
friend |
Print a short description 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 438 of file LazyCallGraph.h.