Commit 221f009
[BoundsSafety] Add build settings to control the bounds check mode for
This patch introduces two new build settings
The first is `CLANG_BOUNDS_SAFETY_BRINGUP_MISSING_CHECKS`. This setting can be used
to control which new bounds checks are enabled. It takes two special
values:
1. `none` - This disables all the new bounds checks. This corresponds to
`-fno-bounds-safety-bringup-missing-checks`.
2. `default` - This will use the compiler default (i.e. the build system
won't pass the `-fbounds-safety-bringup-missing-checks=` flag).
If the build setting value is not any of the special values it is passed
directly as an argument to `-fbounds-safety-bringup-missing-checks=`.
This allows enabling a specific set of checks. E.g.:
```
CLANG_BOUNDS_SAFETY_BRINGUP_MISSING_CHECKS=access_size,return_size
```
would pass `-fbounds-safety-bringup-missing-checks=access_size,return-size`.
The second build setting is
`CLANG_BOUNDS_SAFETY_BRINGUP_MISSING_CHECKS_OPT_OUTS`. This setting is
intended to complement the previous build setting by providing a way to
opt out of specific bounds checks. E.g.:
```
CLANG_BOUNDS_SAFETY_BRINGUP_MISSING_CHECKS=batch_0
CLANG_BOUNDS_SAFETY_BRINGUP_MISSING_CHECKS_OPT_OUTS=access_size
```
This is equivalent to
```
-fbound-safety-bringup-missing-checks=batch_0 -fno-bounds-safety-bringup-missing-checks=access_size
```
This opts the compilation unit into all checks in the `batch_0` group
except the `access_size` bounds check.
These new build settings only apply when all of the following are true:
* `CLANG_ENABLE_BOUNDS_SAFETY` or `CLANG_ENABLE_BOUNDS_ATTRIBUTES` is enabled.
* For C source files
The existing `boundsSafetyCLanguageExtension` test case has been
modified to test the behavior of these new flags.
rdar://161599307-fbounds-safety
1 parent 9ff5887 commit 221f009
File tree
2 files changed
+104
-0
lines changed- Sources/SWBUniversalPlatform/Specs
- Tests/SWBTaskConstructionTests
2 files changed
+104
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
546 | 584 | | |
547 | 585 | | |
548 | 586 | | |
| |||
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9185 | 9185 | | |
9186 | 9186 | | |
9187 | 9187 | | |
| 9188 | + | |
| 9189 | + | |
| 9190 | + | |
| 9191 | + | |
| 9192 | + | |
| 9193 | + | |
| 9194 | + | |
| 9195 | + | |
| 9196 | + | |
| 9197 | + | |
| 9198 | + | |
| 9199 | + | |
| 9200 | + | |
| 9201 | + | |
| 9202 | + | |
| 9203 | + | |
| 9204 | + | |
| 9205 | + | |
| 9206 | + | |
| 9207 | + | |
| 9208 | + | |
| 9209 | + | |
| 9210 | + | |
| 9211 | + | |
| 9212 | + | |
| 9213 | + | |
| 9214 | + | |
| 9215 | + | |
| 9216 | + | |
| 9217 | + | |
| 9218 | + | |
| 9219 | + | |
| 9220 | + | |
| 9221 | + | |
| 9222 | + | |
| 9223 | + | |
| 9224 | + | |
| 9225 | + | |
| 9226 | + | |
| 9227 | + | |
| 9228 | + | |
| 9229 | + | |
| 9230 | + | |
| 9231 | + | |
| 9232 | + | |
| 9233 | + | |
| 9234 | + | |
| 9235 | + | |
| 9236 | + | |
| 9237 | + | |
| 9238 | + | |
| 9239 | + | |
| 9240 | + | |
| 9241 | + | |
| 9242 | + | |
| 9243 | + | |
| 9244 | + | |
| 9245 | + | |
| 9246 | + | |
| 9247 | + | |
| 9248 | + | |
| 9249 | + | |
| 9250 | + | |
| 9251 | + | |
| 9252 | + | |
| 9253 | + | |
9188 | 9254 | | |
9189 | 9255 | | |
9190 | 9256 | | |
| |||
0 commit comments