Add getDecl() to CallGraph and CallGraphNode.
llvm-svn: 76940
This commit is contained in:
parent
6c82313375
commit
30ac7607be
|
@ -49,6 +49,8 @@ public:
|
|||
bool hasCallee() const { return begin() != end(); }
|
||||
|
||||
std::string getName() const { return F.getPrintableName(); }
|
||||
|
||||
Decl *getDecl(ASTContext &Ctx) const { return F.getDecl(Ctx); }
|
||||
};
|
||||
|
||||
class CallGraph {
|
||||
|
@ -91,6 +93,8 @@ public:
|
|||
|
||||
CallGraphNode *getOrInsertFunction(idx::Entity F);
|
||||
|
||||
Decl *getDecl(CallGraphNode *Node);
|
||||
|
||||
void print(llvm::raw_ostream &os);
|
||||
void dump();
|
||||
|
||||
|
|
|
@ -108,6 +108,13 @@ CallGraphNode *CallGraph::getOrInsertFunction(Entity F) {
|
|||
return Node = new CallGraphNode(F);
|
||||
}
|
||||
|
||||
Decl *CallGraph::getDecl(CallGraphNode *Node) {
|
||||
// Get the function's context.
|
||||
ASTContext *Ctx = CallerCtx[Node];
|
||||
|
||||
return Node->getDecl(*Ctx);
|
||||
}
|
||||
|
||||
void CallGraph::print(llvm::raw_ostream &os) {
|
||||
for (iterator I = begin(), E = end(); I != E; ++I) {
|
||||
if (I->second->hasCallee()) {
|
||||
|
|
Loading…
Reference in New Issue