Skip to content

Commit 3a4a60e

Browse files
author
Csaba Dabis
committed
[analyzer] print() JSONify: ProgramPoint revision
Summary: Now we also print out the filename with its path. Reviewers: NoQ Reviewed By: NoQ Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63438 llvm-svn: 364197
1 parent ae171f1 commit 3a4a60e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clang/lib/Analysis/ProgramPoint.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static void printLocJson(raw_ostream &Out, SourceLocation Loc,
5555
}
5656

5757
Out << "{ \"line\": " << SM.getExpansionLineNumber(Loc)
58-
<< ", \"column\": " << SM.getExpansionColumnNumber(Loc) << " }";
58+
<< ", \"column\": " << SM.getExpansionColumnNumber(Loc)
59+
<< ", \"file\": \"" << SM.getFilename(Loc) << "\" }";
5960
}
6061

6162
void ProgramPoint::printJson(llvm::raw_ostream &Out, const char *NL) const {

clang/test/Analysis/dump_egraph.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ int foo() {
2222

2323
// CHECK: \"has_report\": true
2424

25+
// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 16, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \}
26+

0 commit comments

Comments
 (0)