#include "clang/Analysis/CallGraph.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DOTGraphTraits.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <memory>
#include <string>
usingnamespaceclang;
#define DEBUG_TYPE …
STATISTIC(NumObjCCallEdges, "Number of Objective-C method call edges");
STATISTIC(NumBlockCallEdges, "Number of block call edges");
namespace {
class CGBuilder : public StmtVisitor<CGBuilder> { … };
}
void CallGraph::addNodesForBlocks(DeclContext *D) { … }
CallGraph::CallGraph() { … }
CallGraph::~CallGraph() = default;
bool CallGraph::includeInGraph(const Decl *D) { … }
bool CallGraph::includeCalleeInGraph(const Decl *D) { … }
void CallGraph::addNodeForDecl(Decl* D, bool IsGlobal) { … }
CallGraphNode *CallGraph::getNode(const Decl *F) const { … }
CallGraphNode *CallGraph::getOrInsertNode(Decl *F) { … }
void CallGraph::print(raw_ostream &OS) const { … }
LLVM_DUMP_METHOD void CallGraph::dump() const { … }
void CallGraph::viewGraph() const { … }
void CallGraphNode::print(raw_ostream &os) const { … }
LLVM_DUMP_METHOD void CallGraphNode::dump() const { … }
namespace llvm {
template <>
struct DOTGraphTraits<const CallGraph*> : public DefaultDOTGraphTraits { … };
}