llvm.org GIT mirror llvm / 2457f45
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 3 years ago
1 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
265265 INSERT_VECTOR_ELT='IVEC',
266266 EXTRACT_VECTOR_ELT='EVEC',
267267 SHUFFLE_VECTOR='SHUF').get(base, base)
268 # Avoid ambiguity when opcodes end in numbers
269 if len(base.rstrip('0123456789')) < len(base):
270 base += '_'
268271
269272 i = 0
270273 for name in current_names:
271 if name.startswith(base):
274 if name.rstrip('0123456789') == base:
272275 i += 1
273276 if i:
274277 return '{}{}'.format(base, i)