Charusso updated this revision to Diff 205209. Charusso added a comment. - Added a test case.
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63438/new/ https://reviews.llvm.org/D63438 Files: clang/lib/Analysis/ProgramPoint.cpp clang/test/Analysis/dump_egraph.c Index: clang/test/Analysis/dump_egraph.c =================================================================== --- clang/test/Analysis/dump_egraph.c +++ clang/test/Analysis/dump_egraph.c @@ -22,3 +22,5 @@ // CHECK: \"has_report\": true +// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 16, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \} + Index: clang/lib/Analysis/ProgramPoint.cpp =================================================================== --- clang/lib/Analysis/ProgramPoint.cpp +++ clang/lib/Analysis/ProgramPoint.cpp @@ -55,7 +55,8 @@ } 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: clang/test/Analysis/dump_egraph.c =================================================================== --- clang/test/Analysis/dump_egraph.c +++ clang/test/Analysis/dump_egraph.c @@ -22,3 +22,5 @@ // CHECK: \"has_report\": true +// CHECK: \"pretty\": \"*x\", \"location\": \{ \"line\": 16, \"column\": 10, \"file\": \"{{(.+)}}dump_egraph.c\" \} + Index: clang/lib/Analysis/ProgramPoint.cpp =================================================================== --- clang/lib/Analysis/ProgramPoint.cpp +++ clang/lib/Analysis/ProgramPoint.cpp @@ -55,7 +55,8 @@ } 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 {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits