mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
Revert "Replace func name with regex in update_cc_test_checks"
This reverts commit bf58d6a1f92244c797a280d318a56d7d3fc4a704. Breaks tests, fix
This commit is contained in:
parent
01ffce4e06
commit
8177520036
@ -30,8 +30,6 @@ def parse_commandline_args(parser):
|
||||
help='Activate CHECK line generation from this point forward')
|
||||
parser.add_argument('--disable', action='store_false', dest='enabled',
|
||||
help='Deactivate CHECK line generation from this point forward')
|
||||
parser.add_argument('--replace-function-regex', nargs='+', default=[],
|
||||
help='List of regular expressions to replace matching function names')
|
||||
args = parser.parse_args()
|
||||
global _verbose
|
||||
_verbose = args.verbose
|
||||
@ -266,8 +264,6 @@ class FunctionTestBuilder:
|
||||
self._record_args = flags.function_signature
|
||||
self._check_attributes = flags.check_attributes
|
||||
self._scrubber_args = scrubber_args
|
||||
# Strip double-quotes if input was read by UTC_ARGS
|
||||
self._replace_function_regex = list(map(lambda x: x.strip('"'), flags.replace_function_regex))
|
||||
self._func_dict = {}
|
||||
self._func_order = {}
|
||||
for tuple in run_list:
|
||||
@ -335,30 +331,6 @@ class FunctionTestBuilder:
|
||||
self._func_dict[prefix][func] = None
|
||||
continue
|
||||
|
||||
# Replace function names matching the regex.
|
||||
for regex in self._replace_function_regex:
|
||||
# Pattern that matches capture groups in the regex in leftmost order.
|
||||
group_regex = re.compile('\(.*?\)')
|
||||
# Replace function name with regex.
|
||||
match = re.match(regex, func)
|
||||
if match:
|
||||
func_repl = regex
|
||||
# Replace any capture groups with their matched strings.
|
||||
for g in match.groups():
|
||||
func_repl = group_regex.sub(g, func_repl, count=1)
|
||||
func = '{{' + func_repl + '}}'
|
||||
|
||||
# Replace all calls to regex matching functions.
|
||||
matches = re.finditer(regex, scrubbed_body)
|
||||
for match in matches:
|
||||
func_repl = regex
|
||||
# Replace any capture groups with their matched strings.
|
||||
for g in match.groups():
|
||||
func_repl = group_regex.sub(g, func_repl, count=1)
|
||||
# Substitute function call names that match the regex with the same
|
||||
# capture groups set.
|
||||
scrubbed_body = re.sub(func_repl, '{{' + func_repl + '}}', scrubbed_body)
|
||||
|
||||
self._func_dict[prefix][func] = function_body(
|
||||
scrubbed_body, scrubbed_extra, args_and_sig, attrs)
|
||||
self._func_order[prefix].append(func)
|
||||
@ -661,8 +633,6 @@ def get_autogennote_suffix(parser, args):
|
||||
continue # Don't add default values
|
||||
autogenerated_note_args += action.option_strings[0] + ' '
|
||||
if action.const is None: # action takes a parameter
|
||||
if action.nargs == '+':
|
||||
value = ' '.join(map(lambda v: '"' + v.strip('"') + '"', value))
|
||||
autogenerated_note_args += '%s ' % value
|
||||
if autogenerated_note_args:
|
||||
autogenerated_note_args = ' %s %s' % (UTC_ARGS_KEY, autogenerated_note_args[:-1])
|
||||
|
Loading…
Reference in New Issue
Block a user