This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on.
Built by GCC 11.
Fix warnings:
clang/lib/Sema/SemaFunctionEffects.cpp:1531:5: error: this statement may
fall through [-Werror=implicit-fallthrough=]
1531 | switch (DiffKind) {
| ^~~~~~
Bug fix: `@autoreleasepool`, `@synchronized`, and `@finally` were not
being noticed and treated as function effect violations.
---------
Co-authored-by: Doug Wyatt <dwyatt@apple.com>
Correctly detect `(x ? a : b)` as nonblocking when `a` and `b` are. Use
`FunctionEffectsRef::get` to get to the actual effect set instead of trying
to retrieve it manually via the `FunctionProtoType` as we may have to
look through function pointers etc. in some cases.
---------
Co-authored-by: Doug Wyatt <dwyatt@apple.com>
- In Sema, when encountering Decls with function effects needing
verification, add them to a vector, DeclsWithEffectsToVerify.
- Update AST serialization to include DeclsWithEffectsToVerify.
- In AnalysisBasedWarnings, use DeclsWithEffectsToVerify as a work
queue, verifying functions with declared effects, and inferring (when
permitted and necessary) whether their callees have effects.
---------
Co-authored-by: Doug Wyatt <dwyatt@apple.com>
Co-authored-by: Sirraide <aeternalmail@gmail.com>
Co-authored-by: Erich Keane <ekeane@nvidia.com>