Home | History | Annotate | Download | only in Analysis

Lines Matching refs:Node

114   class Node;
132 /// edges. The edges are stored in the source node and point at the target
133 /// node. This allows the edge structure itself to be a very compact data
141 explicit Edge(Node &N, Kind K);
157 /// Get the call graph node referenced by this edge.
160 Node &getNode() const;
171 PointerIntPair<Node *, 1, Kind> Value;
178 /// This typically exists entirely within the node but is exposed as
179 /// a separate type because a node doesn't initially have edges. An explicit
181 /// then cached in the node. It is also used to represent edges entering the
188 friend class LazyCallGraph::Node;
200 friend class LazyCallGraph::Node;
231 friend class LazyCallGraph::Node;
262 Edge &operator[](Node &N) {
269 Edge *lookup(Node &N) {
296 DenseMap<Node *, int> EdgeIndexMap;
300 /// Internal helper to insert an edge to a node.
301 void insertEdgeInternal(Node &ChildN, Edge::Kind EK);
304 void setEdgeKind(Node &ChildN, Edge::Kind EK);
307 bool removeEdgeInternal(Node &ChildN);
311 /// This should be used when the function for a particular node in the
312 /// graph gets replaced and we are updating all of the edges to that node
317 /// A node in the call graph.
319 /// This represents a single node. It's primary roles are to cache the list of
323 /// The node works much like an optional in order to lazily populate the
324 /// edges of each node. Until populated, there are no edges. Once populated,
325 /// you can access the edges by dereferencing the node or using the `->`
326 /// operator as if the node was an `Optional<EdgeSequence>`.
327 class Node {
339 bool operator==(const Node &N) const { return this == &N; }
340 bool operator!=(const Node &N) const { return !operator==(N); }
342 /// Tests whether the node has been populated with edges.
345 /// Tests whether this is actually a dead node and no longer valid.
348 /// invalid. This is used to model a node in an edge list where the
359 // Rip const off because the node itself isn't changing here.
364 /// Populate the edges of this node if necessary.
366 /// The first time this is called it will populate the edges for this node
388 // stored directly within the node. These are both '-1' when nodes are part
397 Node(LazyCallGraph &G, Function &F) : G(&G), F(&F) {}
411 /// Print the name of this node's function.
412 friend raw_ostream &operator<<(raw_ostream &OS, const Node &N) {
416 /// Dump the name of this node's function to stderr.
433 friend class LazyCallGraph::Node;
436 SmallVector<Node *, 1> Nodes;
457 for (LazyCallGraph::Node &N : C) {
486 using iterator = pointee_iterator<SmallVectorImpl<Node *>::const_iterator>;
549 friend class LazyCallGraph::Node;
611 void handleTrivialEdgeInsertion(Node &SourceN, Node &TargetN);
697 Node &SourceN, Node &TargetN,
706 void switchTrivialInternalEdgeToRef(Node &SourceN, Node &TargetN);
726 iterator_range<iterator> switchInternalEdgeToRef(Node &SourceN,
727 Node &TargetN);
733 void switchOutgoingEdgeToCall(Node &SourceN, Node &TargetN);
739 void switchOutgoingEdgeToRef(Node &SourceN, Node &TargetN);
741 /// Insert a ref edge from one node in this RefSCC to another in this
753 void insertInternalRefEdge(Node &SourceN, Node &TargetN);
761 void insertOutgoingEdge(Node &SourceN, Node &TargetN, Edge::Kind EK);
788 SmallVector<RefSCC *, 1> insertIncomingRefEdge(Node &SourceN,
789 Node &TargetN);
801 void removeOutgoingEdge(Node &SourceN, Node &TargetN);
841 SmallVector<RefSCC *, 1> removeInternalRefEdge(Node &SourceN,
842 ArrayRef<Node *> TargetNs);
853 void insertTrivialCallEdge(Node &SourceN, Node &TargetN);
864 void insertTrivialRefEdge(Node &SourceN, Node &TargetN);
866 /// Directly replace a node's function with a new function.
872 /// It requires that the old function in the provided node have zero uses
875 void replaceNodeFunction(Node &N, Function &NewF);
890 friend class LazyCallGraph::Node;
898 /// Build the begin iterator for a node.
901 /// Build the end iterator for a node. This is selected purely by overload.
963 Node *lookup(const Function &F) const { return NodeMap.lookup(&F); }
969 SCC *lookupSCC(Node &N) const { return SCCMap.lookup(&N); }
975 RefSCC *lookupRefSCC(Node &N) const {
982 /// Get a graph node for a given function, scanning it to populate the graph
984 Node &get(Function &F) {
985 Node *&N = NodeMap[&F];
1012 /// call graph. They can be used to update the core node-graph during
1013 /// a node-based inorder traversal that precedes any SCC-based traversal.
1020 void insertEdge(Node &SourceN, Node &TargetN, Edge::Kind EK);
1028 void removeEdge(Node &SourceN, Node &TargetN);
1104 using node_stack_iterator = SmallVectorImpl<Node *>::reverse_iterator;
1108 SpecificBumpPtrAllocator<Node> BPA;
1110 /// Maps function->node for fast lookup.
1111 DenseMap<const Function *, Node *> NodeMap;
1123 DenseMap<Node *, SCC *> SCCMap;
1144 Node &insertInto(Function &F, Node *&MappedN);
1197 inline LazyCallGraph::Edge::Edge(Node &N, Kind K) : Value(&N, K) {}
1213 inline LazyCallGraph::Node &LazyCallGraph::Edge::getNode() const {
1224 template <> struct GraphTraits<LazyCallGraph::Node *> {
1225 using NodeRef = LazyCallGraph::Node *;
1233 using NodeRef = LazyCallGraph::Node *;