Fix a typo in JSON field name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365827
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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>
"pointer": "0x3",
"pretty": "x",
"location": {
+ "file": "main.cpp",
"line": 4,
"column": 5
},
import difflib
import json
import logging
+import os
import re
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.