mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228131 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ff01f89466
commit
f95422a37c
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user