@@ -30,8 +30,6 @@ def parse_commandline_args(parser):
30
30
help = 'Activate CHECK line generation from this point forward' )
31
31
parser .add_argument ('--disable' , action = 'store_false' , dest = 'enabled' ,
32
32
help = 'Deactivate CHECK line generation from this point forward' )
33
- parser .add_argument ('--replace-function-regex' , nargs = '+' , default = [],
34
- help = 'List of regular expressions to replace matching function names' )
35
33
args = parser .parse_args ()
36
34
global _verbose
37
35
_verbose = args .verbose
@@ -277,8 +275,6 @@ def __init__(self, run_list, flags, scrubber_args):
277
275
self ._record_args = flags .function_signature
278
276
self ._check_attributes = flags .check_attributes
279
277
self ._scrubber_args = scrubber_args
280
- # Strip double-quotes if input was read by UTC_ARGS
281
- self ._replace_function_regex = list (map (lambda x : x .strip ('"' ), flags .replace_function_regex ))
282
278
self ._func_dict = {}
283
279
self ._func_order = {}
284
280
self ._global_var_dict = {}
@@ -352,30 +348,6 @@ def process_run_line(self, function_re, scrubber, raw_tool_output, prefixes):
352
348
self ._func_dict [prefix ][func ] = None
353
349
continue
354
350
355
- # Replace function names matching the regex.
356
- for regex in self ._replace_function_regex :
357
- # Pattern that matches capture groups in the regex in leftmost order.
358
- group_regex = re .compile ('\(.*?\)' )
359
- # Replace function name with regex.
360
- match = re .match (regex , func )
361
- if match :
362
- func_repl = regex
363
- # Replace any capture groups with their matched strings.
364
- for g in match .groups ():
365
- func_repl = group_regex .sub (g , func_repl , count = 1 )
366
- func = '{{' + func_repl + '}}'
367
-
368
- # Replace all calls to regex matching functions.
369
- matches = re .finditer (regex , scrubbed_body )
370
- for match in matches :
371
- func_repl = regex
372
- # Replace any capture groups with their matched strings.
373
- for g in match .groups ():
374
- func_repl = group_regex .sub (g , func_repl , count = 1 )
375
- # Substitute function call names that match the regex with the same
376
- # capture groups set.
377
- scrubbed_body = re .sub (func_repl , '{{' + func_repl + '}}' , scrubbed_body )
378
-
379
351
self ._func_dict [prefix ][func ] = function_body (
380
352
scrubbed_body , scrubbed_extra , args_and_sig , attrs )
381
353
self ._func_order [prefix ].append (func )
@@ -822,8 +794,6 @@ def get_autogennote_suffix(parser, args):
822
794
continue # Don't add default values
823
795
autogenerated_note_args += action .option_strings [0 ] + ' '
824
796
if action .const is None : # action takes a parameter
825
- if action .nargs == '+' :
826
- value = ' ' .join (map (lambda v : '"' + v .strip ('"' ) + '"' , value ))
827
797
autogenerated_note_args += '%s ' % value
828
798
if autogenerated_note_args :
829
799
autogenerated_note_args = ' %s %s' % (UTC_ARGS_KEY , autogenerated_note_args [:- 1 ])
0 commit comments