OSDN Git Service

Util: Improve update_llc_test_checks to scrub macosx-style assembly annotations
authorZvi Rackover <zvi.rackover@intel.com>
Wed, 6 Sep 2017 23:04:28 +0000 (23:04 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Wed, 6 Sep 2017 23:04:28 +0000 (23:04 +0000)
Summary:
In D37523 Sanjay pointed out that the tool does not scrub macosx-style 'End of Function' annotations,
where the comments begin with a double-#.

I tested this patch by verifying all existing occurences of 'End function' are scrubbed:
find ./test/CodeGen/X86 -name '*.ll' | xargs grep -l "End function" | xargs utils/update_llc_test_checks.py --llc-binary build/bin/llc

Reviewers: spatel, chandlerc, craig.topper

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37532

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312678 91177308-0d34-0410-b5e6-96231b3b80d8

utils/update_llc_test_checks.py

index 612422d..02bcc2d 100755 (executable)
@@ -29,7 +29,7 @@ def llc(args, cmd_args, ir):
 ASM_FUNCTION_X86_RE = re.compile(
     r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?'
     r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
-    r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|# -- End function)',
+    r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)',
     flags=(re.M | re.S))
 
 ASM_FUNCTION_ARM_RE = re.compile(