[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 10 07:01:09 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)
----------------
erichkeane wrote:
Also would be simplified with the above suggestion. Also, since `QualType` has an operator -> and *, we typically don't fall to `Type*` unless we REALLY have to.
https://github.com/llvm/llvm-project/pull/86618
More information about the cfe-commits
mailing list