================
@@ -6660,6 +6672,51 @@ class BTFTagAttributedType : public Type, public 
llvm::FoldingSetNode {
   }
 };
 
+class OverflowBehaviorType : public Type, public llvm::FoldingSetNode {
+public:
+  enum OverflowBehaviorKind { Wrap, NoWrap };
+
+private:
+  friend class ASTContext; // ASTContext creates these
+
+  QualType UnderlyingType;
+  OverflowBehaviorKind BehaviorKind;
+
+  OverflowBehaviorType(QualType Canon, QualType Underlying,
+                       OverflowBehaviorKind Kind);
+
+public:
+  QualType getUnderlyingType() const { return UnderlyingType; }
+  OverflowBehaviorKind getBehaviorKind() const { return BehaviorKind; }
+
+  bool isWrapKind() const { return BehaviorKind == OverflowBehaviorKind::Wrap; 
}
+  bool isNoWrapKind() const {
+    return BehaviorKind == OverflowBehaviorKind::NoWrap;
+  }
+
+  OverflowBehaviorKind setBehaviorKind(OverflowBehaviorKind Kind) {
+    BehaviorKind = Kind;
+    return BehaviorKind;
+  }
----------------
mizvekov wrote:

```suggestion
```

Type nodes are supposed to be immutable, otherwise this would play badly with 
uniquing. It would be preferable to only allow to specify this on construction.

https://github.com/llvm/llvm-project/pull/148914
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to