This commit addresses some trials and tribulations I encountered while working on (#71786). It:
1. fixes the auto-registration regex
2. fixes the auto-generated array's name
3. generates the current year for the license header
4. generates some dashes for the license header
The optimizer managed to eliminate this entire benchmark,
resulting in useless 0 second timings.
I made a couple of changes to ensure the optimizer cannot
eliminate the loop:
* The individual checks now actually use the loop parameter
* `identity()` is used to ensure conservatism
While here, I reduced the loop count since these benchmarks seem
to run for a long time.
Without additional options, build-script -B was badly broken:
* It added a broken --independent-samples option to the driver command line
* Slow tests that ran only 1 sample by default would break the statistics
Fix the first issue by adding `--independent-samples` to the command
line only when a sample was actually provided by other options.
Fix the second issue by including `--min-samples=2` in the command.
So that it cannot interfere with some leftovers from other compiler runs.
This is important for SDK modules which are generated from swiftinterface files (like Foundation).
The cached SDK module should be built with the compiler to benchmark (and not being reused from other compiler runs).
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:
- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
expands to 1, where it would previously coerce to a string.
- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
left-hand side expands twice.
In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:
- Quoted right-hand side of `STREQUAL` where I was confident it was
intended to be a string literal.
- Removed manual variable expansion on left-hand side of `STREQUAL`,
`MATCHES` and `IN_LIST` where I was confident it was unintended.
Fixes#65028.