llvm/clang/lib/Analysis/CallGraph.cpp

//===- CallGraph.cpp - AST-based Call graph -------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
//  This file defines the AST-based CallGraph.
//
//===----------------------------------------------------------------------===//

#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 {

/// A helper class, which walks the AST and locates all the call sites in the
/// given function body.
class CGBuilder : public StmtVisitor<CGBuilder> {};

} // namespace

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 {};

} // namespace llvm