[llvm] r327564 - [UpdateTestChecks] Handle IR variables with a '-' in the name

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 13:28:53 PDT 2018


Author: arichardson
Date: Wed Mar 14 13:28:53 2018
New Revision: 327564

URL: http://llvm.org/viewvc/llvm-project?rev=327564&view=rev
Log:
[UpdateTestChecks] Handle IR variables with a '-' in the name

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

Modified:
    llvm/trunk/utils/UpdateTestChecks/common.py

Modified: llvm/trunk/utils/UpdateTestChecks/common.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/UpdateTestChecks/common.py?rev=327564&r1=327563&r2=327564&view=diff
==============================================================================
--- llvm/trunk/utils/UpdateTestChecks/common.py (original)
+++ llvm/trunk/utils/UpdateTestChecks/common.py Wed Mar 14 13:28:53 2018
@@ -106,13 +106,14 @@ SCRUB_IR_COMMENT_RE = re.compile(r'\s*;.
 
 # 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()
 
 




More information about the llvm-commits mailing list