]> granicus.if.org Git - clang/commitdiff
[analyzer] exploded-graph-rewriter: Fix filenames in program point.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 11 Jul 2019 21:27:42 +0000 (21:27 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 11 Jul 2019 21:27:42 +0000 (21:27 +0000)
Fix a typo in JSON field name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365827 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/exploded-graph-rewriter/program_points.dot
utils/analyzer/exploded-graph-rewriter.py

index 342a923725ec5e8b0d26ab16a8c225e44d0b5c35..772fe4de806275ce2569ece3dccbad491d32d600 100644 (file)
@@ -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
         },
index 99f5403189bf499a16b86b7d7cdb40c9f4ebf204..baf1be8de06a4a2457f8ad0dd7724cda9721d9eb 100755 (executable)
@@ -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.