summaryrefslogtreecommitdiffstats
path: root/llvm/utils/update_mir_test_checks.py
diff options
context:
space:
mode:
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2019-12-02 10:50:23 +0000
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>2019-12-02 11:06:30 +0000
commitd9542db49e90457de62af3bfe395aaf4c47b68a5 (patch)
tree377ec48c0c1ddcf014f94a3a472e29e3f6b1f80f /llvm/utils/update_mir_test_checks.py
parent160a5045c699ac523eac3c7a1984705c3e86720e (diff)
downloadbcm5719-llvm-d9542db49e90457de62af3bfe395aaf4c47b68a5.tar.gz
bcm5719-llvm-d9542db49e90457de62af3bfe395aaf4c47b68a5.zip
[UpdateTestChecks] Share the code to parse RUN: lines between all scripts
Summary: This commit also introduces a common.debug() function to avoid many `if args.verbose:` statements. Depends on D70428. Reviewers: xbolva00, MaskRay, jdoerfert Reviewed By: MaskRay Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70432
Diffstat (limited to 'llvm/utils/update_mir_test_checks.py')
-rwxr-xr-xllvm/utils/update_mir_test_checks.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/llvm/utils/update_mir_test_checks.py b/llvm/utils/update_mir_test_checks.py
index 6e906130958..46f497007fc 100755
--- a/llvm/utils/update_mir_test_checks.py
+++ b/llvm/utils/update_mir_test_checks.py
@@ -96,22 +96,6 @@ def find_triple_in_ir(lines, verbose=False):
return None
-def find_run_lines(test, lines, verbose=False):
- raw_lines = [m.group(1)
- for m in [common.RUN_LINE_RE.match(l) for l in lines] if m]
- run_lines = [raw_lines[0]] if len(raw_lines) > 0 else []
- for l in raw_lines[1:]:
- if run_lines[-1].endswith("\\"):
- run_lines[-1] = run_lines[-1].rstrip("\\") + " " + l
- else:
- run_lines.append(l)
- if verbose:
- log('Found {} RUN lines:'.format(len(run_lines)))
- for l in run_lines:
- log(' RUN: {}'.format(l))
- return run_lines
-
-
def build_run_list(test, run_lines, verbose=False):
run_list = []
all_prefixes = []
@@ -296,7 +280,6 @@ def should_add_line_to_output(input_line, prefix_set):
def update_test_file(args, test):
- log('Scanning for RUN lines in test file: {}'.format(test), args.verbose)
with open(test) as fd:
input_lines = [l.rstrip() for l in fd]
@@ -313,7 +296,7 @@ def update_test_file(args, test):
return
triple_in_ir = find_triple_in_ir(input_lines, args.verbose)
- run_lines = find_run_lines(test, input_lines, args.verbose)
+ run_lines = common.find_run_lines(test, input_lines)
run_list, common_prefixes = build_run_list(test, run_lines, args.verbose)
simple_functions = find_functions_with_one_bb(input_lines, args.verbose)
OpenPOWER on IntegriCloud