[PATCH] D39789: Add RISC-V support to update_llc_test_checks.py
Alex Bradbury via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 06:25:31 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317693: [utils] Add RISC-V support to update_llc_test_checks.py (authored by asb).
Changed prior to commit:
https://reviews.llvm.org/D39789?vs=122052&id=122084#toc
Repository:
rL LLVM
https://reviews.llvm.org/D39789
Files:
llvm/trunk/utils/update_llc_test_checks.py
Index: llvm/trunk/utils/update_llc_test_checks.py
===================================================================
--- llvm/trunk/utils/update_llc_test_checks.py
+++ llvm/trunk/utils/update_llc_test_checks.py
@@ -58,6 +58,12 @@
r'.Lfunc_end[0-9]+:\n',
flags=(re.M | re.S))
+ASM_FUNCTION_RISCV_RE = re.compile(
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?'
+ r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
+ r'.Lfunc_end[0-9]+:\n',
+ flags=(re.M | re.S))
+
ASM_FUNCTION_SYSTEMZ_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
r'[ \t]+.cfi_startproc\n'
@@ -135,6 +141,16 @@
asm = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
+def scrub_asm_riscv(asm):
+ # Scrub runs of whitespace out of the assembly, but leave the leading
+ # whitespace in place.
+ asm = SCRUB_WHITESPACE_RE.sub(r' ', asm)
+ # Expand the tabs used for indentation.
+ asm = string.expandtabs(asm, 2)
+ # Strip trailing whitespace.
+ asm = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
+ return asm
+
def scrub_asm_systemz(asm, args):
# Scrub runs of whitespace out of the assembly, but leave the leading
# whitespace in place.
@@ -161,6 +177,8 @@
'armeb-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
'powerpc64': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
'powerpc64le': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
+ 'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
+ 'riscv64': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
's390x': (scrub_asm_systemz, ASM_FUNCTION_SYSTEMZ_RE),
}
handlers = None
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39789.122084.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171108/ccdda966/attachment.bin>
More information about the llvm-commits
mailing list