[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 25 17:19:11 PDT 2024
================
@@ -1016,17 +1018,22 @@ class Analyzer {
// Check for a call to a builtin function, whose effects are
// handled specially.
if (const auto *FD = dyn_cast<FunctionDecl>(CI.CDecl)) {
+ bool IgnoreIfNoexceptNoreturn = true;
if (unsigned BuiltinID = FD->getBuiltinID()) {
CI.Effects = getBuiltinFunctionEffects(BuiltinID);
if (CI.Effects.empty()) {
// A builtin with no known effects is assumed safe.
return;
}
+ // A builtin WITH effects doesn't get any special treatment for
+ // being noreturn/noexcept, e.g. longjmp().
+ IgnoreIfNoexceptNoreturn = false;
----------------
Sirraide wrote:
I think it would be less confusing in the long run to just call this variable `IsBuiltin` seeing as that’s what it actually means right now.
(bringing up a lot of nits today I know, but that’s also a sign that there aren’t any major changes left ;Þ)
https://github.com/llvm/llvm-project/pull/99656
More information about the cfe-commits
mailing list