Skip to content

Commit fc1e5f9

Browse files
committed
update_test_checks: simplify is_local_def_ir_value
The match argument is unused.
1 parent 4484190 commit fc1e5f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/utils/UpdateTestChecks/common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ def __init__(
933933
self.variable_mapping = {}
934934

935935
# Return true if this kind of IR value is "local", basically if it matches '%{{.*}}'.
936-
def is_local_def_ir_value_match(self, match):
936+
def is_local_def_ir_value(self):
937937
return self.ir_prefix == "%"
938938

939939
# Return true if this kind of IR value is "global", basically if it matches '#{{.*}}'.
@@ -949,7 +949,7 @@ def get_ir_prefix_from_ir_value_match(self, match):
949949
# Return the IR regexp we use for this kind or IR value, e.g., [\w.-]+? for locals
950950
def get_ir_regex_from_ir_value_re_match(self, match):
951951
# for backwards compatibility we check locals with '.*'
952-
if self.is_local_def_ir_value_match(match):
952+
if self.is_local_def_ir_value():
953953
return ".*"
954954
return self.ir_regexp
955955

@@ -990,7 +990,7 @@ def get_value_definition(self, var, match):
990990
else:
991991
regex = self.get_ir_regex_from_ir_value_re_match(match)
992992
capture_start = "[["
993-
if self.is_local_def_ir_value_match(match):
993+
if self.is_local_def_ir_value():
994994
return capture_start + varname + ":" + prefix + regex + "]]"
995995
return prefix + capture_start + varname + ":" + regex + "]]"
996996

@@ -999,7 +999,7 @@ def get_value_use(self, var, match, var_prefix=None):
999999
if var_prefix is None:
10001000
var_prefix = self.check_prefix
10011001
capture_start = "[[#" if self.is_number else "[["
1002-
if self.is_local_def_ir_value_match(match):
1002+
if self.is_local_def_ir_value():
10031003
return capture_start + self.get_value_name(var, var_prefix) + "]]"
10041004
prefix = self.get_ir_prefix_from_ir_value_match(match)[0]
10051005
return prefix + capture_start + self.get_value_name(var, var_prefix) + "]]"
@@ -1209,7 +1209,7 @@ def transform_line_vars(match):
12091209
" with scripted FileCheck name." % (var,)
12101210
)
12111211
key = (var, nameless_value.check_key)
1212-
is_local_def = nameless_value.is_local_def_ir_value_match(match)
1212+
is_local_def = nameless_value.is_local_def_ir_value()
12131213
if is_local_def and key in vars_seen:
12141214
rv = nameless_value.get_value_use(var, match)
12151215
elif not is_local_def and key in global_vars_seen:

0 commit comments

Comments
 (0)