Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion clang/lib/Analysis/ProgramPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<CallEnter>().getCalleeContext()->getDecl())
<< '\"';
break;
case ProgramPoint::CallExitBeginKind:
Out << "CallExitBegin\"";
Expand Down
9 changes: 9 additions & 0 deletions clang/utils/analyzer/exploded-graph-rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -618,6 +620,13 @@ def visit_program_point(self, p):
'<font color="%s">%s</font></td>'
'<td align="left">[B%d]</td></tr>' % (color, p.kind, p.block_id)
)
elif p.kind == "CallEnter":
self._dump(
'<td width="0"></td>'
'<td align="left" width="0">'
'<font color="%s">%s</font></td>'
'<td align="left">%s</td></tr>' % (color, p.kind, p.callee_decl)
)
else:
# TODO: Print more stuff for other kinds of points.
self._dump(
Expand Down
Loading