[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)
Justin Stitt via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 10 15:35:27 PDT 2024
================
@@ -147,6 +147,15 @@ struct BinOpInfo {
return UnOp->getSubExpr()->getType()->isFixedPointType();
return false;
}
+
+ /// Does the BinaryOperator have the wraps attribute?
+ /// If so, we can ellide overflow sanitizer checks.
+ bool oneOfWraps() const {
+ const Type *TyPtr = E->getType().getTypePtrOrNull();
+ if (TyPtr)
----------------
JustinStitt wrote:
Gotcha, checkout a2f63982920f22d795c4971800bcc5cb55356570
https://github.com/llvm/llvm-project/pull/86618
More information about the cfe-commits
mailing list