diff --git a/clang/lib/Analysis/ProgramPoint.cpp b/clang/lib/Analysis/ProgramPoint.cpp index 768345c8425f0..7945c5c2fc27f 100644 --- a/clang/lib/Analysis/ProgramPoint.cpp +++ b/clang/lib/Analysis/ProgramPoint.cpp @@ -13,6 +13,7 @@ #include "clang/Analysis/ProgramPoint.h" #include "clang/AST/ASTContext.h" +#include "clang/Analysis/AnalysisDeclContext.h" #include "clang/Basic/JsonSupport.h" using namespace clang; @@ -81,7 +82,10 @@ void ProgramPoint::printJson(llvm::raw_ostream &Out, const char *NL) const { llvm_unreachable("BlockExitKind"); break; case ProgramPoint::CallEnterKind: - Out << "CallEnter\""; + Out << "CallEnter\", \"callee_decl\": \""; + Out << AnalysisDeclContext::getFunctionName( + castAs().getCalleeContext()->getDecl()) + << '\"'; break; case ProgramPoint::CallExitBeginKind: Out << "CallExitBegin\""; diff --git a/clang/utils/analyzer/exploded-graph-rewriter.py b/clang/utils/analyzer/exploded-graph-rewriter.py index 5eaa7738103f7..eca0f17beb40a 100755 --- a/clang/utils/analyzer/exploded-graph-rewriter.py +++ b/clang/utils/analyzer/exploded-graph-rewriter.py @@ -86,6 +86,8 @@ def __init__(self, json_pp): if json_pp["location"] is not None else None ) + elif self.kind == "CallEnter": + self.callee_decl = json_pp.get("callee_decl", "None") elif self.kind == "BlockEntrance": self.block_id = json_pp["block_id"] @@ -618,6 +620,13 @@ def visit_program_point(self, p): '%s' '[B%d]' % (color, p.kind, p.block_id) ) + elif p.kind == "CallEnter": + self._dump( + '' + '' + '%s' + '%s' % (color, p.kind, p.callee_decl) + ) else: # TODO: Print more stuff for other kinds of points. self._dump(