Skip to content

Commit c0cd527

Browse files
committed
[ast-dump-tool] fix regression if --empty-implementation but --json-input-path is not
Looks like this broke in one of the relands of https://reviews.llvm.org/D93164
1 parent 13877db commit c0cd527

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,16 @@ def main():
156156

157157
use_empty_implementation = options.empty_implementation
158158

159-
if not os.path.exists(options.json_input_path):
160-
use_empty_implementation = True
159+
if (not use_empty_implementation
160+
and not os.path.exists(options.json_input_path)):
161+
use_empty_implementation = True
161162

162-
with open(options.json_input_path) as f:
163-
jsonData = json.load(f)
163+
if not use_empty_implementation:
164+
with open(options.json_input_path) as f:
165+
jsonData = json.load(f)
164166

165-
if not 'classesInClade' in jsonData or not jsonData["classesInClade"]:
166-
use_empty_implementation = True
167+
if not 'classesInClade' in jsonData or not jsonData["classesInClade"]:
168+
use_empty_implementation = True
167169

168170
if use_empty_implementation:
169171
with open(os.path.join(os.getcwd(),

0 commit comments

Comments
 (0)