[PATCH] D142473: [UTC] Add --version argument

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 07:18:48 PST 2023


nikic created this revision.
nikic added reviewers: asb, arichardson, nhaehnle.
Herald added a subscriber: StephenFan.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We have a number of pending changes to update_test_checks.py (and friends) that are essentially blocked on test churn: If the output of UTC for an existing flag combination changes, then the next time a test is regenerated, it will contain many spurious changes. This makes changes to UTC default behavior essentially impossible.

Examples of such changes are:

- D133943 <https://reviews.llvm.org/D133943>/D142373 <https://reviews.llvm.org/D142373> want `--function-signature` to also check the return type/attributes.
- D139006 <https://reviews.llvm.org/D139006>/D140212 <https://reviews.llvm.org/D140212> want to make `--function-signature` the default behavior.
- D142452 <https://reviews.llvm.org/D142452> wants to add wildcards for block labels.

This patch tries to resolve this issue by adding a `--version` argument, which works as follows:

- When regenerating an old test, the default version is 1.
- When generating a new test, the default version is the newest.
- When an explicit version is specified, that of course wins.

This means that any currently existing tests will keep using `--version 1` format, while any new tests will automatically embed `--version 2` (or whatever the latest is), and then keep using that test format from then on.

This patch implements the new `--function-signature` behavior from D142373 <https://reviews.llvm.org/D142373> under `--version 2` -- the actual implementation of that is shamelessly stolen.

(We might want to keep the default at `--version 1` for now, and only bump it once all three patches have landed. That would reduce the number of different versions we have to deal with going forward.)


https://reviews.llvm.org/D142473

Files:
  clang/test/utils/update_cc_test_checks/lit.local.cfg
  clang/test/utils/update_cc_test_checks/mangled_names.test
  llvm/test/tools/UpdateTestChecks/lit.local.cfg
  llvm/utils/UpdateTestChecks/asm.py
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/UpdateTestChecks/isel.py
  llvm/utils/update_cc_test_checks.py
  llvm/utils/update_test_checks.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142473.491771.patch
Type: text/x-patch
Size: 14358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230124/94164c57/attachment-0001.bin>


More information about the llvm-commits mailing list