Skip to content

Commit d7a5b94

Browse files
committed
update_test_checks: refactor to use a new GeneralizerInfo object
This change is motivated primarily by the desire to change the list of "NamelessValue" (not a great name) objects based on the --version passed to update_test_checks. In order to be able to use the version number e.g. when building up regular expressions, but also to just reduce the number of surprises caused by global state, this change introduces the GeneralizerInfo class which is meant to hold a bunch of information about how to generalize check lines. The GeneralizerInfo must be instantiated by the "driver" script (update_*_test_checks.py) and is passed around various common functions. Beware that the GeneralizerInfo objects are *not* stateless. The NamelessValue objects currently hold mapping information for "global" values.
1 parent 55f7c86 commit d7a5b94

File tree

7 files changed

+306
-297
lines changed

7 files changed

+306
-297
lines changed

llvm/utils/UpdateTestChecks/asm.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ def add_checks(
605605
prefix_list,
606606
func_dict,
607607
func_name,
608+
ginfo: common.GeneralizerInfo,
608609
global_vars_seen_dict,
609610
is_filtered,
610611
):
@@ -617,9 +618,7 @@ def add_checks(
617618
func_dict,
618619
func_name,
619620
check_label_format,
620-
True,
621-
False,
622-
1,
621+
ginfo,
623622
global_vars_seen_dict,
624623
is_filtered=is_filtered,
625624
)

0 commit comments

Comments
 (0)