This is an archive of the discontinued LLVM Phabricator instance.

[Utils] Add --full-function-signature to update_cc_test_checks.py to match return type as well as args
AbandonedPublic

Authored by asb on Jan 23 2023, 8:34 AM.

Details

Summary

This is an alternative, less intrusive take on D133943 (where we were unable to find consensus on how to handle updating existing in-tree tests).

Zooming right out, the basic problem is that --function-signature checks arguments but not the return type. This limitation means it's not very useful for my use case (making RISC-V ABI tests more maintainable). The value of this is huge - manually updating CHECK lines in the previous ABI tests was a massive timesink, and with this feature it is _massively_ easier.

Although it would be cleaner in a sense to update --function-signature and find agreement on transitioning in-tree tests to the new behaviour, I think adding the separate command-line flag is the best option available at this point. It's hopefully much easier to get this reviewed and landed, thus unblocking the ABI test refactorings and follow-on bug fixes that rely on it. There's also a clear migration path - in the future --function-signature could be updated to act like --full-function-signature and --full-function-signature be either removed or left as an alias. It would be slightly better to support --function-signature=full, but I couldn't find a way to accept an optional argument but only with --foo=bar syntax (rather than --foo bar, which could break existing command lines) with default argparse routines.

I'd really, really, really appreciate help on unblocking this (reviews or other feedback). Thank you in advance.

Diff Detail

Event Timeline

asb created this revision.Jan 23 2023, 8:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 8:34 AM
asb requested review of this revision.Jan 23 2023, 8:34 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 23 2023, 8:34 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
asb retitled this revision from [Utils] Add --full-function-signature to update_cc_test_checks.pyh to match return type as well as args to [Utils] Add --full-function-signature to update_cc_test_checks.py to match return type as well as args.Jan 23 2023, 8:34 AM

Do we actually want to include the dso_local in the full signature?

asb added a comment.Jan 24 2023, 1:43 AM

Do we actually want to include the dso_local in the full signature?

That's a fair question. I could imagine it's useful to include these attributes in some test scenarios and not in others. I'm not sure it's worth adding another flag and more logic to optionally strip it.

I'm probably not the best person to review this but, for what it's worth, it LGTM.

nikic added a comment.Jan 24 2023, 4:05 AM

Please give me a day to propose another alternative... Seeing D142452 we now have three different patches that would like to change UTC output, so I really think we need that --version flag.

asb added a comment.Jan 24 2023, 4:57 AM

Please give me a day to propose another alternative... Seeing D142452 we now have three different patches that would like to change UTC output, so I really think we need that --version flag.

Of course, thanks for taking a look. This incarnation of the patch of course is explicitly trying to avoid change default UTC output, at the cost of adding yet another command line option.

asb edited the summary of this revision. (Show Details)Jan 24 2023, 5:02 AM
nikic added a comment.Jan 24 2023, 7:30 AM

D142473 would be my proposal to fix the test churn problem going forward.

asb abandoned this revision.Mar 1 2023, 3:40 AM

Abandoned in favour of https://reviews.llvm.org/D144963 which rebases this logic on top of the new --version support.