[PATCH] D145149: [UTC] Enable --function-signature by default

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 01:59:20 PST 2023


nikic created this revision.
nikic added reviewers: arichardson, asb, spatel, sebastian-ne, jdoerfert, bogner.
Herald added subscribers: luismarques, StephenFan.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch enables `--function-signature` by default under `--version 2` and makes `--version 2` the default. This means that all newly created tests will check the function signature, while leaving old tests alone.

There's two motivations for this change:

- Without `--function-signature`, the generated check lines may fail in a very hard to understand way if the test both includes a function definition and a call to that function. (Though we could address this by making the CHECK-LABEL stricter, without checking the full signature.)
- This actually checks that uses of the arguments in the function body use the correct argument, instead of matching against any variable.

This is a replacement for D139006 <https://reviews.llvm.org/D139006> and D140212 <https://reviews.llvm.org/D140212> based on the `--version` mechanism.

I did not include an opt-out flag `--no-function-signature` because I'm not sure we need it. Would be happy to include it though, if desired.


https://reviews.llvm.org/D145149

Files:
  clang/test/utils/update_cc_test_checks/Inputs/mangled_names.c.v2.expected
  clang/test/utils/update_cc_test_checks/mangled_names.test
  llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/basic.ll.v2.expected
  llvm/test/tools/UpdateTestChecks/update_test_checks/basic.test
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_analyze_test_checks.py
  llvm/utils/update_cc_test_checks.py
  llvm/utils/update_llc_test_checks.py
  llvm/utils/update_test_checks.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145149.501810.patch
Type: text/x-patch
Size: 11058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230302/14d5d475/attachment.bin>


More information about the llvm-commits mailing list