Explorar o código

update_mir_test_checks: Do a better job of disambiguating names

Matching prefixes isn't good enough, because it leads to things like
calling the first constant C3 just because there were two copies
before it. Tighten up the check to match more precisely, but also be
careful about ambiguity when dealing with target opcodes that end in a
number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316088 91177308-0d34-0410-b5e6-96231b3b80d8
Justin Bogner %!s(int64=7) %!d(string=hai) anos
pai
achega
2457f45686
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      utils/update_mir_test_checks.py

+ 4 - 1
utils/update_mir_test_checks.py

@@ -266,10 +266,13 @@ def mangle_vreg(opcode, current_names):
                 INSERT_VECTOR_ELT='IVEC',
                 INSERT_VECTOR_ELT='IVEC',
                 EXTRACT_VECTOR_ELT='EVEC',
                 EXTRACT_VECTOR_ELT='EVEC',
                 SHUFFLE_VECTOR='SHUF').get(base, base)
                 SHUFFLE_VECTOR='SHUF').get(base, base)
+    # Avoid ambiguity when opcodes end in numbers
+    if len(base.rstrip('0123456789')) < len(base):
+        base += '_'
 
 
     i = 0
     i = 0
     for name in current_names:
     for name in current_names:
-        if name.startswith(base):
+        if name.rstrip('0123456789') == base:
             i += 1
             i += 1
     if i:
     if i:
         return '{}{}'.format(base, i)
         return '{}{}'.format(base, i)