aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorDavid Greene <dag@cray.com>2020-01-23 14:30:32 -0600
committerDavid Greene <dag@hpe.com>2020-09-16 14:34:18 -0500
commitce0eb81c72749d1e96cfc6fb68af3c24b63753cc (patch)
treee67097ddc172bf80350594d8d6fa1759a5776340 /llvm/utils/UpdateTestChecks/asm.py
parent2a078a977e90481954eef69b489fac650ddbdaf6 (diff)
downloadllvm-ce0eb81c72749d1e96cfc6fb68af3c24b63753cc.zip
llvm-ce0eb81c72749d1e96cfc6fb68af3c24b63753cc.tar.gz
llvm-ce0eb81c72749d1e96cfc6fb68af3c24b63753cc.tar.bz2
[UpdateTestChecks] Allow $ in function names
Some compilers generation functions with '$' in their names, so recognize those functions. This also requires recognizing function names inside quotes in some contexts in order to escape certain characters. Differential Revision: https://reviews.llvm.org/D82995
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 588a287..dc35859 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -15,7 +15,7 @@ else:
##### Assembly parser
ASM_FUNCTION_X86_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
r'^\s*(?:[^:\n]+?:\s*\n\s*\.size|\.cfi_endproc|\.globl|\.comm|\.(?:sub)?section|#+ -- End function)',
flags=(re.M | re.S))
@@ -28,7 +28,7 @@ ASM_FUNCTION_ARM_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_AARCH64_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@(?P=func)\n'
+ r'^_?(?P<func>[^:]+):[ \t]*\/\/[ \t]*@"?(?P=func)"?\n'
r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise
r'(?P<body>.*?)\n'
# This list is incomplete
@@ -36,21 +36,21 @@ ASM_FUNCTION_AARCH64_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_AMDGPU_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?'
+ r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?'
r'(?P<body>.*?)\n' # (body of the function)
# This list is incomplete
r'^\s*(\.Lfunc_end[0-9]+:\n|\.section)',
flags=(re.M | re.S))
ASM_FUNCTION_HEXAGON_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*//[ \t]*@(?P=func)\n[^:]*?'
+ r'^_?(?P<func>[^:]+):[ \t]*//[ \t]*@"?(?P=func)"?\n[^:]*?'
r'(?P<body>.*?)\n' # (body of the function)
# This list is incomplete
r'.Lfunc_end[0-9]+:\n',
flags=(re.M | re.S))
ASM_FUNCTION_MIPS_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func)
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n[^:]*?' # f: (name of func)
r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue
r'(?P<body>.*?)\n' # (body of the function)
# Mips+LLVM standard asm epilogue
@@ -60,13 +60,13 @@ ASM_FUNCTION_MIPS_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_MSP430_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?'
+ r'^_?(?P<func>[^:]+):[ \t]*;+[ \t]*@"?(?P=func)"?\n[^:]*?'
r'(?P<body>.*?)\n'
r'(\$|\.L)func_end[0-9]+:\n', # $func_end0:
flags=(re.M | re.S))
ASM_FUNCTION_PPC_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n'
r'.*?'
r'\.Lfunc_begin[0-9]+:\n'
r'(?:[ \t]+.cfi_startproc\n)?'
@@ -78,7 +78,7 @@ ASM_FUNCTION_PPC_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_RISCV_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n'
r'(?:\s*\.?L(?P=func)\$local:\n)?' # optional .L<func>$local: due to -fno-semantic-interposition
r'(?:\s*\.?Lfunc_begin[^:\n]*:\n)?[^:]*?'
r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*'
@@ -86,27 +86,27 @@ ASM_FUNCTION_RISCV_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_LANAI_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@(?P=func)\n'
+ r'^_?(?P<func>[^:]+):[ \t]*!+[ \t]*@"?(?P=func)"?\n'
r'(?:[ \t]+.cfi_startproc\n)?' # drop optional cfi noise
r'(?P<body>.*?)\s*'
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<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'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n'
r'[ \t]+.cfi_startproc\n'
r'(?P<body>.*?)\n'
r'.Lfunc_end[0-9]+:\n',
flags=(re.M | re.S))
ASM_FUNCTION_AARCH64_DARWIN_RE = re.compile(
- r'^_(?P<func>[^:]+):[ \t]*;[ \t]@(?P=func)\n'
+ r'^_(?P<func>[^:]+):[ \t]*;[ \t]@"?(?P=func)"?\n'
r'([ \t]*.cfi_startproc\n[\s]*)?'
r'(?P<body>.*?)'
r'([ \t]*.cfi_endproc\n[\s]*)?'
@@ -114,7 +114,7 @@ ASM_FUNCTION_AARCH64_DARWIN_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_ARM_DARWIN_RE = re.compile(
- r'^[ \t]*\.globl[ \t]*_(?P<func>[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t](?P=func)'
+ r'^[ \t]*\.globl[ \t]*_(?P<func>[^ \t])[ \t]*@[ \t]--[ \t]Begin[ \t]function[ \t]"?(?P=func)"?'
r'(?P<directives>.*?)'
r'^_(?P=func):\n[ \t]*'
r'(?P<body>.*?)'
@@ -137,7 +137,7 @@ ASM_FUNCTION_ARM_IOS_RE = re.compile(
flags=(re.M | re.S))
ASM_FUNCTION_WASM32_RE = re.compile(
- r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
+ r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@"?(?P=func)"?\n'
r'(?P<body>.*?)\n'
r'^\s*(\.Lfunc_end[0-9]+:\n|end_function)',
flags=(re.M | re.S))