[PATCH] D80584: [utils] change update_test_checks.py use of 'TMP' value names
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 31 07:58:27 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbfdc2552664d: [utils] change update_test_checks.py use of 'TMP' value names (authored by spatel).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80584/new/
https://reviews.llvm.org/D80584
Files:
llvm/utils/UpdateTestChecks/common.py
Index: llvm/utils/UpdateTestChecks/common.py
===================================================================
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -218,10 +218,12 @@
# spaces, commas, paren, or end of the string
IR_VALUE_RE = re.compile(r'(\s+)%([\w.-]+?)([,\s\(\)]|\Z)')
+NAMELESS_PREFIX = "NAMELESS"
+
# Create a FileCheck variable name based on an IR name.
def get_value_name(var):
if var.isdigit():
- var = 'TMP' + var
+ var = NAMELESS_PREFIX + var
var = var.replace('.', '_')
var = var.replace('-', '_')
return var.upper()
@@ -243,6 +245,8 @@
# into defs, and variables we have seen into uses.
def transform_line_vars(match):
var = match.group(2)
+ if NAMELESS_PREFIX.lower() in var.lower():
+ warn("Change IR value name '%s' to prevent possible conflict with scripted FileCheck name." % (var,))
if var in vars_seen:
rv = get_value_use(var)
else:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80584.267500.patch
Type: text/x-patch
Size: 965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200531/786ec19d/attachment.bin>
More information about the llvm-commits
mailing list