https://reviews.llvm.org/D69701 added support for on-the-fly argument
changes for update scripts. I recently wanted to keep some manual check
lines in a test generated by update_cc_test_checks.py in our CHERI fork, so
this commit adds support for UTC_ARGS in update_cc_test_checks.py. And since
I was refactoring the code to be in common.py, I also added it for
update_llc_test_checks.py.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I feel there is a lot of good stuff here but it seems to mix two things. A rewrite of the script infrastructure and the UTC_ARGS stuff. If so, do you think we could split them? I feel there are also minor NFC changes that could go in on their own without review, I marked on of them below.
(Partially related: Does this handle the mismatch between enabled configuration status and the flag names enable/disable or will it still add --enabled to the UTC_ARGS?)
llvm/utils/update_cc_test_checks.py | ||
---|---|---|
122 | I guess these 7 lines can be committed on their own as NFC cleanup. |
It will now read the command line flag that was specified when calling parser.add_argument() and should do the right thing.
I'll split out the unrelated changes to separate reviews.
Nice cleanup again!
I think eventually we need to teach the common logic to recognize top-level entities, e.g., functions, and with these changes it will be accessible w/o duplication in all update scripts, YaY!
The idea look good to me, but I want some opinions on the name UTC_ARGS (I can't help associating it with Coordinated Universal Time). Adding some folks who may have opinions: @greened @lebedev.ri @RKSimon @spatel @xbolva00
UTC_ARGS (I can't help associating it with Coordinated Universal Time).
Me too. Any suggestions for new name? TCU_ARGS?
I agree that UTC_ARGS could be a bit confusing. However, there are currently 145 UTC_ARGS uses in tests/Transforms and I'd rather not update them as part of this change.
I feel that changing the name should be a separate change that can be committed after this patch.
Yes, please. The name is my fault, but naming things is hard :(
@MaskRay If you have an alternative name, I propose a sed -e/UTC_ARGS/.../ patch, maybe with a check in here warning if UTC_ARGS is used.
I also reflexively think of universal time when reading "UTC". I think we always print this with the script name advertisement line, so "SCRIPT_ARGS" seems non-ambiguous.
@MaskRay are you okay with me committing this change and delaying the global search-replace?
I guess these 7 lines can be committed on their own as NFC cleanup.