[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


================
@@ -4077,6 +4077,9 @@ class BinaryOperator : public Expr {
   static unsigned sizeOfTrailingObjects(bool HasFPFeatures) {
     return HasFPFeatures * sizeof(FPOptionsOverride);
   }
+
+  /// Do one of the subexpressions have the wraps attribute?
+  bool oneOfWraps(const ASTContext &Ctx) const;
----------------
erichkeane wrote:

The name here is pretty annoyingly vague here, and even with the comment, had I not been in this in this review, wouldn't have known what this means. Feel free to come up with a better name, but for now, I am suggesting:

```suggestion
  bool hasWrappingOperand(const ASTContext &Ctx) const;
```

https://github.com/llvm/llvm-project/pull/86618


More information about the cfe-commits mailing list