From: Csaba Dabis Date: Mon, 24 Jun 2019 16:19:39 +0000 (+0000) Subject: [analyzer] print() JSONify: ProgramPoint revision X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8457d1559fdca373b2af14d1aa792cdfd410bb5d;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364197 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ProgramPoint.cpp b/lib/Analysis/ProgramPoint.cpp index 45f165677f..0398251b5e 100644 --- a/lib/Analysis/ProgramPoint.cpp +++ b/lib/Analysis/ProgramPoint.cpp @@ -55,7 +55,8 @@ static void printLocJson(raw_ostream &Out, SourceLocation Loc, } Out << "{ \"line\": " << SM.getExpansionLineNumber(Loc) - << ", \"column\": " << SM.getExpansionColumnNumber(Loc) << " }"; + << ", \"column\": " << SM.getExpansionColumnNumber(Loc) + << ", \"file\": \"" << SM.getFilename(Loc) << "\" }"; } void ProgramPoint::printJson(llvm::raw_ostream &Out, const char *NL) const { diff --git a/test/Analysis/dump_egraph.c b/test/Analysis/dump_egraph.c index 701e985079..5544d9fae2 100644 --- a/test/Analysis/dump_egraph.c +++ b/test/Analysis/dump_egraph.c @@ -22,3 +22,5 @@ int foo() { // CHECK: \"has_report\": true +// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 16, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \} +