diff options
| author | Justin Bogner <mail@justinbogner.com> | 2017-11-06 21:06:09 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2017-11-06 21:06:09 +0000 |
| commit | f7b1007345831e20e6b89bbc1dfcac6dbcaf9a99 (patch) | |
| tree | 628c7092a74b98fdb6320e8eec0147cc0f9d3237 /llvm/utils | |
| parent | 52a52a6cab40b35ed65e641a198cda93cbcb88c8 (diff) | |
| download | bcm5719-llvm-f7b1007345831e20e6b89bbc1dfcac6dbcaf9a99.tar.gz bcm5719-llvm-f7b1007345831e20e6b89bbc1dfcac6dbcaf9a99.zip | |
update_mir_test_checks: Be careful about replacing entire vregs
Previously, this could end up replacing a vreg like %14 with
[[VREG1]]4, where VREG1 was the match for %1. That's obviously not
correct, though it hasn't actually come up in any tests I've converted
so far.
llvm-svn: 317509
Diffstat (limited to 'llvm/utils')
| -rwxr-xr-x | llvm/utils/update_mir_test_checks.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/utils/update_mir_test_checks.py b/llvm/utils/update_mir_test_checks.py index 015c4279bad..2934f09f6b3 100755 --- a/llvm/utils/update_mir_test_checks.py +++ b/llvm/utils/update_mir_test_checks.py @@ -254,7 +254,8 @@ def add_check_lines(test, output_lines, prefix, func_name, single_bb, func_line = func_line.replace( vreg.group(1), '[[{}:%[0-9]+]]'.format(name), 1) for number, name in vreg_map.items(): - func_line = func_line.replace(number, '[[{}]]'.format(name)) + func_line = re.sub(r'{}\b'.format(number), '[[{}]]'.format(name), + func_line) check_line = '{}: {}'.format(check, func_line[indent:]).rstrip() output_lines.append(check_line) |

