Skip to content

Commit

Permalink
[UpdateTestChecks] Handle IR variables with a '-' in the name
Browse files Browse the repository at this point in the history
Summary:
I noticed that clang will emit variables such as %indirect-arg-temp when
running update_cc1_test_checks.py and therefore update_cc1_test_checks.py
wasn't adding FileCheck captures for those variables.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

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

llvm-svn: 327564
  • Loading branch information
arichardson committed Mar 14, 2018
1 parent 8364901 commit 115b067
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/utils/UpdateTestChecks/common.py
Expand Up @@ -106,13 +106,14 @@ def build_function_body_dictionary(function_re, scrubber, scrubber_args, raw_too

# Match things that look at identifiers, but only if they are followed by
# spaces, commas, paren, or end of the string
IR_VALUE_RE = re.compile(r'(\s+)%([\w\.]+?)([,\s\(\)]|\Z)')
IR_VALUE_RE = re.compile(r'(\s+)%([\w\.\-]+?)([,\s\(\)]|\Z)')

# Create a FileCheck variable name based on an IR name.
def get_value_name(var):
if var.isdigit():
var = 'TMP' + var
var = var.replace('.', '_')
var = var.replace('-', '_')
return var.upper()


Expand Down

0 comments on commit 115b067

Please sign in to comment.