r365827 - [analyzer] exploded-graph-rewriter: Fix filenames in program point.
Artem Dergachev via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 11 14:27:42 PDT 2019
Author: dergachev
Date: Thu Jul 11 14:27:42 2019
New Revision: 365827
URL: http://llvm.org/viewvc/llvm-project?rev=365827&view=rev
Log:
[analyzer] exploded-graph-rewriter: Fix filenames in program point.
Fix a typo in JSON field name.
Modified:
cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot
cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
Modified: cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot?rev=365827&r1=365826&r2=365827&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot (original)
+++ cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot Thu Jul 11 14:27:42 2019
@@ -52,7 +52,7 @@ Node0x1 [shape=record,label=
// CHECK-SAME: <table border="0" align="left" width="0">
// CHECK-SAME: <tr>
// CHECK-SAME: <td align="left" width="0">
-// CHECK-SAME: (main file):<b>4</b>:<b>5</b>:
+// CHECK-SAME: main.cpp:<b>4</b>:<b>5</b>:
// CHECK-SAME: </td>
// CHECK-SAME: <td align="left" width="0">
// CHECK-SAME: <font color="cyan4">DeclRefExpr</font>
@@ -83,6 +83,7 @@ Node0x2 [shape=record,label=
"pointer": "0x3",
"pretty": "x",
"location": {
+ "file": "main.cpp",
"line": 4,
"column": 5
},
Modified: cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/exploded-graph-rewriter.py?rev=365827&r1=365826&r2=365827&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/exploded-graph-rewriter.py (original)
+++ cfe/trunk/utils/analyzer/exploded-graph-rewriter.py Thu Jul 11 14:27:42 2019
@@ -16,6 +16,7 @@ import collections
import difflib
import json
import logging
+import os
import re
@@ -50,8 +51,8 @@ class SourceLocation(object):
super(SourceLocation, self).__init__()
self.line = json_loc['line']
self.col = json_loc['column']
- self.filename = json_loc['filename'] \
- if 'filename' in json_loc else '(main file)'
+ self.filename = os.path.basename(json_loc['file']) \
+ if 'file' in json_loc else '(main file)'
# A deserialized program point.
More information about the cfe-commits
mailing list