[PATCH] D45809: Add SPARC support to update_llc_test_checks.py

Daniel Cederman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 01:02:26 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL330401: Add SPARC support to update_llc_test_checks.py (authored by dcederman, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D45809?vs=143069&id=143247#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D45809

Files:
  llvm/trunk/utils/UpdateTestChecks/asm.py


Index: llvm/trunk/utils/UpdateTestChecks/asm.py
===================================================================
--- llvm/trunk/utils/UpdateTestChecks/asm.py
+++ llvm/trunk/utils/UpdateTestChecks/asm.py
@@ -60,6 +60,12 @@
     r'.Lfunc_end[0-9]+:\n',
     flags=(re.M | re.S))
 
+ASM_FUNCTION_SPARC_RE = re.compile(
+    r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@(?P=func)\n'
+    r'(?P<body>.*?)\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'
@@ -154,6 +160,16 @@
   asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
   return asm
 
+def scrub_asm_sparc(asm, args):
+  # Scrub runs of whitespace out of the assembly, but leave the leading
+  # whitespace in place.
+  asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm)
+  # Expand the tabs used for indentation.
+  asm = string.expandtabs(asm, 2)
+  # Strip trailing whitespace.
+  asm = common.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.
@@ -198,6 +214,8 @@
       'powerpc64le': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
       'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
       'riscv64': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
+      'sparc': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE),
+      'sparcv9': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE),
       's390x': (scrub_asm_systemz, ASM_FUNCTION_SYSTEMZ_RE),
   }
   handlers = None


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45809.143247.patch
Type: text/x-patch
Size: 1587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180420/857dcb3d/attachment.bin>


More information about the llvm-commits mailing list