From: Artem Dergachev Date: Thu, 11 Jul 2019 21:27:42 +0000 (+0000) Subject: [analyzer] exploded-graph-rewriter: Fix filenames in program point. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a93151d4cbec4b125323daaa2db9140b33e2d38c;p=clang [analyzer] exploded-graph-rewriter: Fix filenames in program point. Fix a typo in JSON field name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365827 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/exploded-graph-rewriter/program_points.dot b/test/Analysis/exploded-graph-rewriter/program_points.dot index 342a923725..772fe4de80 100644 --- a/test/Analysis/exploded-graph-rewriter/program_points.dot +++ b/test/Analysis/exploded-graph-rewriter/program_points.dot @@ -52,7 +52,7 @@ Node0x1 [shape=record,label= // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: // CHECK-SAME:
-// CHECK-SAME: (main file):4:5: +// CHECK-SAME: main.cpp:4:5: // CHECK-SAME: // CHECK-SAME: DeclRefExpr @@ -83,6 +83,7 @@ Node0x2 [shape=record,label= "pointer": "0x3", "pretty": "x", "location": { + "file": "main.cpp", "line": 4, "column": 5 }, diff --git a/utils/analyzer/exploded-graph-rewriter.py b/utils/analyzer/exploded-graph-rewriter.py index 99f5403189..baf1be8de0 100755 --- a/utils/analyzer/exploded-graph-rewriter.py +++ b/utils/analyzer/exploded-graph-rewriter.py @@ -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.