It is very common to check callbacks and completion handlers for null.
This patch supports such checks using built-in functions:
- __builtin_expect
- __builtin_expect_with_probablity
- __builtin_unpredictable
rdar://73455388
Paths
| Differential D96268
[-Wcompletion-handler] Support checks with builtins ClosedPublic Authored by vsavchenko on Feb 8 2021, 7:53 AM.
Details
Summary It is very common to check callbacks and completion handlers for null.
rdar://73455388
Diff Detail
Event TimelineComment Actions Aha, yup, makes sense!
This revision is now accepted and ready to land.Feb 8 2021, 7:13 PM
This revision was landed with ongoing or failed builds.Feb 9 2021, 12:36 AM Closed by commit rGd1522d349f4d: [-Wcompletion-handler] Support checks with builtins (authored by vsavchenko). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 322307 clang/lib/Analysis/CalledOnceCheck.cpp
clang/test/SemaObjC/warn-called-once.m
|
Otherwise it's a compile error and analysis based warnings aren't run when there are compile errors, right? If it was a normal function call there's no way we would have gotten away with such assertion. Like, even if it was a standard library function the user could still override that. But for builtins I guess that should work.