LLVM 24.0.0git
CallGraph.h
Go to the documentation of this file.
1//===- CallGraph.h - Build a Module's call graph ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9///
10/// This file provides interfaces used to build and manipulate a call graph,
11/// which is a very useful tool for interprocedural optimization.
12///
13/// Every function in a module is represented as a node in the call graph. The
14/// callgraph node keeps track of which functions are called by the function
15/// corresponding to the node.
16///
17/// A call graph may contain nodes where the function that they correspond to
18/// is null. These 'external' nodes are used to represent control flow that is
19/// not represented (or analyzable) in the module. In particular, this
20/// analysis builds one external node such that:
21/// 1. All functions in the module without internal linkage will have edges
22/// from this external node, indicating that they could be called by
23/// functions outside of the module.
24/// 2. All functions whose address is used for something more than a direct
25/// call, for example being stored into a memory location will also have
26/// an edge from this external node. Since they may be called by an
27/// unknown caller later, they must be tracked as such.
28///
29/// There is a second external node added for calls that leave this module.
30/// Functions have a call edge to the external node iff:
31/// 1. The function is external, reflecting the fact that they could call
32/// anything without internal linkage or that has its address taken.
33/// 2. The function contains an indirect function call.
34///
35/// As an extension in the future, there may be multiple nodes with a null
36/// function. These will be used when we can prove (through pointer analysis)
37/// that an indirect call site can call only a specific set of functions.
38///
39/// Because of these properties, the CallGraph captures a conservative superset
40/// of all of the caller-callee relationships, which is useful for
41/// transformations.
42///
43//===----------------------------------------------------------------------===//
44
45#ifndef LLVM_ANALYSIS_CALLGRAPH_H
46#define LLVM_ANALYSIS_CALLGRAPH_H
47
48#include "llvm/IR/InstrTypes.h"
49#include "llvm/IR/PassManager.h"
50#include "llvm/IR/ValueHandle.h"
51#include "llvm/Pass.h"
53#include <cassert>
54#include <map>
55#include <memory>
56#include <utility>
57#include <vector>
58
59namespace llvm {
60
61template <class GraphType> struct GraphTraits;
62class CallGraphNode;
63class Function;
64class Module;
65class raw_ostream;
66
67/// The basic data container for the call graph of a \c Module of IR.
68///
69/// This class exposes both the interface to the call graph for a module of IR.
70///
71/// The core call graph itself can also be updated to reflect changes to the IR.
72class CallGraph {
73 Module &M;
74
75 using FunctionMapTy =
76 std::map<const Function *, std::unique_ptr<CallGraphNode>>;
77
78 /// A map from \c Function* to \c CallGraphNode*.
79 FunctionMapTy FunctionMap;
80
81 /// This node has edges to all external functions and those internal
82 /// functions that have their address taken.
83 CallGraphNode *ExternalCallingNode;
84
85 /// This node has edges to it from all functions making indirect calls
86 /// or calling an external function.
87 std::unique_ptr<CallGraphNode> CallsExternalNode;
88
89public:
90 LLVM_ABI explicit CallGraph(Module &M);
93
94 LLVM_ABI void print(raw_ostream &OS) const;
95 LLVM_ABI void dump() const;
96
97 using iterator = FunctionMapTy::iterator;
98 using const_iterator = FunctionMapTy::const_iterator;
99
100 /// Returns the module the call graph corresponds to.
101 Module &getModule() const { return M; }
102
104 ModuleAnalysisManager::Invalidator &);
105
106 inline iterator begin() { return FunctionMap.begin(); }
107 inline iterator end() { return FunctionMap.end(); }
108 inline const_iterator begin() const { return FunctionMap.begin(); }
109 inline const_iterator end() const { return FunctionMap.end(); }
110
111 /// Returns the call graph node for the provided function.
112 inline const CallGraphNode *operator[](const Function *F) const {
113 const_iterator I = FunctionMap.find(F);
114 assert(I != FunctionMap.end() && "Function not in callgraph!");
115 return I->second.get();
116 }
117
118 /// Returns the call graph node for the provided function.
120 const_iterator I = FunctionMap.find(F);
121 assert(I != FunctionMap.end() && "Function not in callgraph!");
122 return I->second.get();
123 }
124
125 /// Returns the \c CallGraphNode which is used to represent
126 /// undetermined calls into the callgraph.
127 CallGraphNode *getExternalCallingNode() const { return ExternalCallingNode; }
128
130 return CallsExternalNode.get();
131 }
132
133 //===---------------------------------------------------------------------
134 // Functions to keep a call graph up to date with a function that has been
135 // modified.
136 //
137
138 /// Unlink the function from this module, returning it.
139 ///
140 /// Because this removes the function from the module, the call graph node is
141 /// destroyed. This is only valid if the function does not call any other
142 /// functions (ie, there are no edges in it's CGN). The easiest way to do
143 /// this is to dropAllReferences before calling this.
145
146 /// Similar to operator[], but this will insert a new CallGraphNode for
147 /// \c F if one does not already exist.
149
150 /// Populate \p CGN based on the calls inside the associated function.
152
153 /// Add a function to the call graph, and link the node to all of the
154 /// functions that it calls.
156};
157
158/// A node in the call graph for a module.
159///
160/// Typically represents a function in the call graph. There are also special
161/// "null" nodes used to represent theoretical entries in the call graph.
163public:
164 /// A pair of the calling instruction (a call or invoke)
165 /// and the call graph node being called.
166 /// Call graph node may have two types of call records which represent an edge
167 /// in the call graph - reference or a call edge. Reference edges are not
168 /// associated with any call instruction and are created with the first field
169 /// set to `None`, while real call edges have instruction address in this
170 /// field. Therefore, all real call edges are expected to have a value in the
171 /// first field and it is not supposed to be `nullptr`.
172 /// Reference edges, for example, are used for connecting broker function
173 /// caller to the callback function for callback call sites.
174 using CallRecord = std::pair<std::optional<WeakTrackingVH>, CallGraphNode *>;
175
176public:
177 using CalledFunctionsVector = std::vector<CallRecord>;
178
179 /// Creates a node for the specified function.
180 inline CallGraphNode(CallGraph *CG, Function *F) : CG(CG), F(F) {}
181
182 CallGraphNode(const CallGraphNode &) = delete;
184
186 assert(NumReferences == 0 && "Node deleted while references remain");
187 }
188
189 using iterator = std::vector<CallRecord>::iterator;
190 using const_iterator = std::vector<CallRecord>::const_iterator;
191
192 /// Returns the function that this call graph node represents.
193 Function *getFunction() const { return F; }
194
195 inline iterator begin() { return CalledFunctions.begin(); }
196 inline iterator end() { return CalledFunctions.end(); }
197 inline const_iterator begin() const { return CalledFunctions.begin(); }
198 inline const_iterator end() const { return CalledFunctions.end(); }
199 inline bool empty() const { return CalledFunctions.empty(); }
200 inline unsigned size() const { return (unsigned)CalledFunctions.size(); }
201
202 /// Returns the number of other CallGraphNodes in this CallGraph that
203 /// reference this node in their callee list.
204 unsigned getNumReferences() const { return NumReferences; }
205
206 /// Returns the i'th called function.
207 CallGraphNode *operator[](unsigned i) const {
208 assert(i < CalledFunctions.size() && "Invalid index");
209 return CalledFunctions[i].second;
210 }
211
212 /// Print out this call graph node.
213 LLVM_ABI void dump() const;
214 LLVM_ABI void print(raw_ostream &OS) const;
215
216 //===---------------------------------------------------------------------
217 // Methods to keep a call graph up to date with a function that has been
218 // modified
219 //
220
221 /// Adds a function to the list of functions called by this one.
223 CalledFunctions.emplace_back(Call ? std::optional<WeakTrackingVH>(Call)
224 : std::optional<WeakTrackingVH>(),
225 M);
226 M->AddRef();
227 }
228
230 I->second->DropRef();
231 *I = CalledFunctions.back();
232 CalledFunctions.pop_back();
233 }
234
235 /// Removes one edge associated with a null callsite from this node to
236 /// the specified callee function.
238
239 /// Replaces the edge in the node for the specified call site with a
240 /// new one.
241 ///
242 /// Note that this method takes linear time, so it should be used sparingly.
244 CallGraphNode *NewNode);
245
246private:
247 friend class CallGraph;
248
249 CallGraph *CG;
250 Function *F;
251
252 std::vector<CallRecord> CalledFunctions;
253
254 /// The number of times that this CallGraphNode occurs in the
255 /// CalledFunctions array of this or other CallGraphNodes.
256 unsigned NumReferences = 0;
257
258 void DropRef() { --NumReferences; }
259 void AddRef() { ++NumReferences; }
260
261 /// A special function that should only be used by the CallGraph class.
262 void allReferencesDropped() { NumReferences = 0; }
263};
264
265/// An analysis pass to compute the \c CallGraph for a \c Module.
266///
267/// This class implements the concept of an analysis pass used by the \c
268/// ModuleAnalysisManager to run an analysis over a module and cache the
269/// resulting data.
270class CallGraphAnalysis : public AnalysisInfoMixin<CallGraphAnalysis> {
272
273 LLVM_ABI static AnalysisKey Key;
274
275public:
276 /// A formulaic type to inform clients of the result type.
278
279 /// Compute the \c CallGraph for the module \c M.
280 ///
281 /// The real work here is done in the \c CallGraph constructor.
283};
284
285/// Printer pass for the \c CallGraphAnalysis results.
287 : public RequiredPassInfoMixin<CallGraphPrinterPass> {
288 raw_ostream &OS;
289
290public:
291 explicit CallGraphPrinterPass(raw_ostream &OS) : OS(OS) {}
292
294};
295
296/// Printer pass for the summarized \c CallGraphAnalysis results.
298 : public RequiredPassInfoMixin<CallGraphSCCsPrinterPass> {
299 raw_ostream &OS;
300
301public:
302 explicit CallGraphSCCsPrinterPass(raw_ostream &OS) : OS(OS) {}
303
305};
306
307/// The \c ModulePass which wraps up a \c CallGraph and the logic to
308/// build it.
309///
310/// This class exposes both the interface to the call graph container and the
311/// module pass which runs over a module of IR and produces the call graph. The
312/// call graph interface is entirelly a wrapper around a \c CallGraph object
313/// which is stored internally for each module.
315 std::unique_ptr<CallGraph> G;
316
317public:
318 static char ID; // Class identification, replacement for typeinfo
319
322
323 /// The internal \c CallGraph around which the rest of this interface
324 /// is wrapped.
325 const CallGraph &getCallGraph() const { return *G; }
326 CallGraph &getCallGraph() { return *G; }
327
330
331 /// Returns the module the call graph corresponds to.
332 Module &getModule() const { return G->getModule(); }
333
334 inline iterator begin() { return G->begin(); }
335 inline iterator end() { return G->end(); }
336 inline const_iterator begin() const { return G->begin(); }
337 inline const_iterator end() const { return G->end(); }
338
339 /// Returns the call graph node for the provided function.
340 inline const CallGraphNode *operator[](const Function *F) const {
341 return (*G)[F];
342 }
343
344 /// Returns the call graph node for the provided function.
345 inline CallGraphNode *operator[](const Function *F) { return (*G)[F]; }
346
347 /// Returns the \c CallGraphNode which is used to represent
348 /// undetermined calls into the callgraph.
350 return G->getExternalCallingNode();
351 }
352
354 return G->getCallsExternalNode();
355 }
356
357 //===---------------------------------------------------------------------
358 // Functions to keep a call graph up to date with a function that has been
359 // modified.
360 //
361
362 /// Unlink the function from this module, returning it.
363 ///
364 /// Because this removes the function from the module, the call graph node is
365 /// destroyed. This is only valid if the function does not call any other
366 /// functions (ie, there are no edges in it's CGN). The easiest way to do
367 /// this is to dropAllReferences before calling this.
369 return G->removeFunctionFromModule(CGN);
370 }
371
372 /// Similar to operator[], but this will insert a new CallGraphNode for
373 /// \c F if one does not already exist.
375 return G->getOrInsertFunction(F);
376 }
377
378 //===---------------------------------------------------------------------
379 // Implementation of the ModulePass interface needed here.
380 //
381
382 void getAnalysisUsage(AnalysisUsage &AU) const override;
383 bool runOnModule(Module &M) override;
384 void releaseMemory() override;
385
386 void print(raw_ostream &o, const Module *) const override;
387 void dump() const;
388};
389
390//===----------------------------------------------------------------------===//
391// GraphTraits specializations for call graphs so that they can be treated as
392// graphs by the generic graph algorithms.
393//
394
395// Provide graph traits for traversing call graphs using standard graph
396// traversals.
397template <> struct GraphTraits<CallGraphNode *> {
400
401 static NodeRef getEntryNode(CallGraphNode *CGN) { return CGN; }
402 static CallGraphNode *CGNGetValue(CGNPairTy P) { return P.second; }
403
406
408 return ChildIteratorType(N->begin(), &CGNGetValue);
409 }
410
412 return ChildIteratorType(N->end(), &CGNGetValue);
413 }
414};
415
416template <> struct GraphTraits<const CallGraphNode *> {
417 using NodeRef = const CallGraphNode *;
420
421 static NodeRef getEntryNode(const CallGraphNode *CGN) { return CGN; }
422 static const CallGraphNode *CGNGetValue(CGNPairTy P) { return P.second; }
423
427
429 return ChildIteratorType(N->begin(), &CGNGetValue);
430 }
431
433 return ChildIteratorType(N->end(), &CGNGetValue);
434 }
435
437 return N->begin();
438 }
439 static ChildEdgeIteratorType child_edge_end(NodeRef N) { return N->end(); }
440
441 static NodeRef edge_dest(EdgeRef E) { return E.second; }
442};
443
444template <>
446 using PairTy =
447 std::pair<const Function *const, std::unique_ptr<CallGraphNode>>;
448
450 return CGN->getExternalCallingNode(); // Start at the external node!
451 }
452
454 return P.second.get();
455 }
456
457 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
460
462 return nodes_iterator(CG->begin(), &CGGetValuePtr);
463 }
464
466 return nodes_iterator(CG->end(), &CGGetValuePtr);
467 }
468};
469
470template <>
472 const CallGraphNode *> {
473 using PairTy =
474 std::pair<const Function *const, std::unique_ptr<CallGraphNode>>;
475
476 static NodeRef getEntryNode(const CallGraph *CGN) {
477 return CGN->getExternalCallingNode(); // Start at the external node!
478 }
479
480 static const CallGraphNode *CGGetValuePtr(const PairTy &P) {
481 return P.second.get();
482 }
483
484 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
487
489 return nodes_iterator(CG->begin(), &CGGetValuePtr);
490 }
491
493 return nodes_iterator(CG->end(), &CGGetValuePtr);
494 }
495};
496
497} // end namespace llvm
498
499#endif // LLVM_ANALYSIS_CALLGRAPH_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
aarch64 promote const
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:215
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
#define P(N)
Represent the analysis usage information of a pass.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
An analysis pass to compute the CallGraph for a Module.
Definition CallGraph.h:270
CallGraph Result
A formulaic type to inform clients of the result type.
Definition CallGraph.h:277
CallGraph run(Module &M, ModuleAnalysisManager &)
Compute the CallGraph for the module M.
Definition CallGraph.h:282
A node in the call graph for a module.
Definition CallGraph.h:162
friend class CallGraph
Definition CallGraph.h:247
LLVM_ABI void print(raw_ostream &OS) const
std::vector< CallRecord >::const_iterator const_iterator
Definition CallGraph.h:190
std::vector< CallRecord > CalledFunctionsVector
Definition CallGraph.h:177
bool empty() const
Definition CallGraph.h:199
CallGraphNode(const CallGraphNode &)=delete
void addCalledFunction(CallBase *Call, CallGraphNode *M)
Adds a function to the list of functions called by this one.
Definition CallGraph.h:222
CallGraphNode(CallGraph *CG, Function *F)
Creates a node for the specified function.
Definition CallGraph.h:180
LLVM_ABI void replaceCallEdge(CallBase &Call, CallBase &NewCall, CallGraphNode *NewNode)
Replaces the edge in the node for the specified call site with a new one.
const_iterator end() const
Definition CallGraph.h:198
CallGraphNode * operator[](unsigned i) const
Returns the i'th called function.
Definition CallGraph.h:207
LLVM_ABI void dump() const
Print out this call graph node.
Function * getFunction() const
Returns the function that this call graph node represents.
Definition CallGraph.h:193
const_iterator begin() const
Definition CallGraph.h:197
LLVM_ABI void removeOneAbstractEdgeTo(CallGraphNode *Callee)
Removes one edge associated with a null callsite from this node to the specified callee function.
std::vector< CallRecord >::iterator iterator
Definition CallGraph.h:189
unsigned getNumReferences() const
Returns the number of other CallGraphNodes in this CallGraph that reference this node in their callee...
Definition CallGraph.h:204
unsigned size() const
Definition CallGraph.h:200
CallGraphNode & operator=(const CallGraphNode &)=delete
void removeCallEdge(iterator I)
Definition CallGraph.h:229
std::pair< std::optional< WeakTrackingVH >, CallGraphNode * > CallRecord
A pair of the calling instruction (a call or invoke) and the call graph node being called.
Definition CallGraph.h:174
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
CallGraphPrinterPass(raw_ostream &OS)
Definition CallGraph.h:291
CallGraphSCCsPrinterPass(raw_ostream &OS)
Definition CallGraph.h:302
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
CallGraph::const_iterator const_iterator
Definition CallGraph.h:329
const CallGraph & getCallGraph() const
The internal CallGraph around which the rest of this interface is wrapped.
Definition CallGraph.h:325
const_iterator begin() const
Definition CallGraph.h:336
CallGraphNode * getCallsExternalNode() const
Definition CallGraph.h:353
const_iterator end() const
Definition CallGraph.h:337
const CallGraphNode * operator[](const Function *F) const
Returns the call graph node for the provided function.
Definition CallGraph.h:340
CallGraphNode * operator[](const Function *F)
Returns the call graph node for the provided function.
Definition CallGraph.h:345
CallGraph::iterator iterator
Definition CallGraph.h:328
Module & getModule() const
Returns the module the call graph corresponds to.
Definition CallGraph.h:332
CallGraphNode * getOrInsertFunction(const Function *F)
Similar to operator[], but this will insert a new CallGraphNode for F if one does not already exist.
Definition CallGraph.h:374
CallGraphNode * getExternalCallingNode() const
Returns the CallGraphNode which is used to represent undetermined calls into the callgraph.
Definition CallGraph.h:349
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Function * removeFunctionFromModule(CallGraphNode *CGN)
Unlink the function from this module, returning it.
Definition CallGraph.h:368
CallGraph & getCallGraph()
Definition CallGraph.h:326
The basic data container for the call graph of a Module of IR.
Definition CallGraph.h:72
LLVM_ABI Function * removeFunctionFromModule(CallGraphNode *CGN)
Unlink the function from this module, returning it.
LLVM_ABI void print(raw_ostream &OS) const
const CallGraphNode * operator[](const Function *F) const
Returns the call graph node for the provided function.
Definition CallGraph.h:112
LLVM_ABI void dump() const
LLVM_ABI void populateCallGraphNode(CallGraphNode *CGN)
Populate CGN based on the calls inside the associated function.
Definition CallGraph.cpp:88
LLVM_ABI ~CallGraph()
Definition CallGraph.cpp:53
LLVM_ABI void addToCallGraph(Function *F)
Add a function to the call graph, and link the node to all of the functions that it calls.
Definition CallGraph.cpp:74
const_iterator begin() const
Definition CallGraph.h:108
iterator end()
Definition CallGraph.h:107
LLVM_ABI CallGraphNode * getOrInsertFunction(const Function *F)
Similar to operator[], but this will insert a new CallGraphNode for F if one does not already exist.
iterator begin()
Definition CallGraph.h:106
LLVM_ABI bool invalidate(Module &, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &)
Definition CallGraph.cpp:66
FunctionMapTy::const_iterator const_iterator
Definition CallGraph.h:98
CallGraphNode * getCallsExternalNode() const
Definition CallGraph.h:129
Module & getModule() const
Returns the module the call graph corresponds to.
Definition CallGraph.h:101
FunctionMapTy::iterator iterator
Definition CallGraph.h:97
CallGraphNode * getExternalCallingNode() const
Returns the CallGraphNode which is used to represent undetermined calls into the callgraph.
Definition CallGraph.h:127
LLVM_ABI CallGraph(Module &M)
Definition CallGraph.cpp:32
CallGraphNode * operator[](const Function *F)
Returns the call graph node for the provided function.
Definition CallGraph.h:119
const_iterator end() const
Definition CallGraph.h:109
ModulePass(char &pid)
Definition Pass.h:257
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
CallInst * Call
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
#define N
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
static NodeRef getEntryNode(CallGraphNode *CGN)
Definition CallGraph.h:401
mapped_iterator< CallGraphNode::iterator, decltype(&CGNGetValue)> ChildIteratorType
Definition CallGraph.h:404
static ChildIteratorType child_end(NodeRef N)
Definition CallGraph.h:411
static CallGraphNode * CGNGetValue(CGNPairTy P)
Definition CallGraph.h:402
CallGraphNode::CallRecord CGNPairTy
Definition CallGraph.h:399
static ChildIteratorType child_begin(NodeRef N)
Definition CallGraph.h:407
std::pair< const Function *const, std::unique_ptr< CallGraphNode > > PairTy
Definition CallGraph.h:446
static CallGraphNode * CGGetValuePtr(const PairTy &P)
Definition CallGraph.h:453
static nodes_iterator nodes_begin(CallGraph *CG)
Definition CallGraph.h:461
static nodes_iterator nodes_end(CallGraph *CG)
Definition CallGraph.h:465
mapped_iterator< CallGraph::iterator, decltype(&CGGetValuePtr)> nodes_iterator
Definition CallGraph.h:458
static NodeRef getEntryNode(CallGraph *CGN)
Definition CallGraph.h:449
static ChildIteratorType child_begin(NodeRef N)
Definition CallGraph.h:428
static ChildEdgeIteratorType child_edge_begin(NodeRef N)
Definition CallGraph.h:436
const CallGraphNode::CallRecord & EdgeRef
Definition CallGraph.h:419
CallGraphNode::CallRecord CGNPairTy
Definition CallGraph.h:418
mapped_iterator< CallGraphNode::const_iterator, decltype(&CGNGetValue)> ChildIteratorType
Definition CallGraph.h:424
static NodeRef edge_dest(EdgeRef E)
Definition CallGraph.h:441
static ChildIteratorType child_end(NodeRef N)
Definition CallGraph.h:432
static ChildEdgeIteratorType child_edge_end(NodeRef N)
Definition CallGraph.h:439
static NodeRef getEntryNode(const CallGraphNode *CGN)
Definition CallGraph.h:421
CallGraphNode::const_iterator ChildEdgeIteratorType
Definition CallGraph.h:426
static const CallGraphNode * CGNGetValue(CGNPairTy P)
Definition CallGraph.h:422
static NodeRef getEntryNode(const CallGraph *CGN)
Definition CallGraph.h:476
static nodes_iterator nodes_begin(const CallGraph *CG)
Definition CallGraph.h:488
static const CallGraphNode * CGGetValuePtr(const PairTy &P)
Definition CallGraph.h:480
static nodes_iterator nodes_end(const CallGraph *CG)
Definition CallGraph.h:492
mapped_iterator< CallGraph::const_iterator, decltype(&CGGetValuePtr)> nodes_iterator
Definition CallGraph.h:485
std::pair< const Function *const, std::unique_ptr< CallGraphNode > > PairTy
Definition CallGraph.h:473
typename CallGraph *::UnknownGraphTypeError NodeRef
Definition GraphTraits.h:95
A CRTP mix-in for passes that should not be skipped.