diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-02-04 10:46:48 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-02-04 10:46:48 +0000 |
commit | e375095392a637d56fb32c0ea4cf4c92ebcab6e4 (patch) | |
tree | f0bbc1d4bda6ec354192ebefdf934a8ddcf32cc2 /llvm | |
parent | 493c3a127f64766ddc1bc05a297c2c53052bee62 (diff) | |
download | bcm5719-llvm-e375095392a637d56fb32c0ea4cf4c92ebcab6e4.tar.gz bcm5719-llvm-e375095392a637d56fb32c0ea4cf4c92ebcab6e4.zip |
[x86] Teach the test update script to strip trailing whitespace.
This is done in a bit of a strange way to use a multiline RE instead of
looping over the lines. Suggestions welcome here for a more pythonic way
of doing this as long as its reasonably fast.
llvm-svn: 228131
Diffstat (limited to 'llvm')
-rwxr-xr-x | llvm/utils/update_llc_test_checks.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py index c99872313da..cb1ae09dedb 100755 --- a/llvm/utils/update_llc_test_checks.py +++ b/llvm/utils/update_llc_test_checks.py @@ -24,6 +24,7 @@ def llc(args, cmd_args, ir): ASM_SCRUB_WHITESPACE_RE = re.compile(r'(?!^(| \w))[ \t]+', flags=re.M) +ASM_SCRUB_TRAILING_WHITESPACE_RE = re.compile(r'[ \t]+$', flags=re.M) ASM_SCRUB_SHUFFLES_RE = ( re.compile( r'^(\s*\w+) [^#\n]+#+ ((?:[xyz]mm\d+|mem) = .*)$', @@ -47,6 +48,8 @@ def scrub_asm(asm): asm = ASM_SCRUB_RIP_RE.sub(r'{{.*}}(%rip)', asm) # Strip kill operands inserted into the asm. asm = ASM_SCRUB_KILL_COMMENT_RE.sub('', asm) + # Strip trailing whitespace. + asm = ASM_SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) return asm |