[clang] [clang][analyzer] Fix liveness and analysis of [[assume]] attributes (PR #198618)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Tue May 26 08:10:02 PDT 2026
================
@@ -279,6 +279,16 @@ void TransferFunctions::Visit(Stmt *S) {
}
break;
}
+ case Stmt::AttributedStmtClass: {
+ // In an attributed statement, include the assumptions of the
+ // [[assume(...)]] attributes as being live.
+ AttributedStmt *AS = cast<AttributedStmt>(S);
+ for (const auto *Attr : getSpecificAttrs<CXXAssumeAttr>(AS->getAttrs())) {
+ AddLiveExpr(val.liveExprs, LV.ESetFact, Attr->getAssumption());
+ }
+ // FIXME: Also handle other attributes that have relevant substatements.
----------------
NagyDonat wrote:
Done in https://github.com/llvm/llvm-project/pull/198618/commits/0e3622db66807868854daa24a7b3fd467f143222
https://github.com/llvm/llvm-project/pull/198618
More information about the cfe-commits
mailing list