]> granicus.if.org Git - clang/commitdiff
[analyzer] print() JSONify: ProgramPoint revision
authorCsaba Dabis <dabis.csaba98@gmail.com>
Mon, 24 Jun 2019 16:19:39 +0000 (16:19 +0000)
committerCsaba Dabis <dabis.csaba98@gmail.com>
Mon, 24 Jun 2019 16:19:39 +0000 (16:19 +0000)
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

lib/Analysis/ProgramPoint.cpp
test/Analysis/dump_egraph.c

index 45f165677f99d13d0b03ea213f6a343e1b33e824..0398251b5eab64067d95f164f0bd58b8fd56222a 100644 (file)
@@ -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 {
index 701e9850798322d0eb3943d8d66b4881544bc2bf..5544d9fae2e26fb7ee72c2510a0219e92febcaf6 100644 (file)
@@ -22,3 +22,5 @@ int foo() {
 
 // CHECK: \"has_report\": true
 
+// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 16, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \}
+