[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)
Matheus Izvekov via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 17 11:49:07 PDT 2025
================
@@ -112,6 +112,25 @@ class LangOptionsBase {
SOB_Trapping
};
+ // Used by __attribute__((overflow_behavior())) to describe overflow behavior
+ // on a per-type basis.
+ enum OverflowBehaviorKind {
+ // Default C standard behavior (type dependent).
+ OB_Unset,
+
+ // __attribute__((overflow_behavior("wrap")))
+ OB_Wrap,
+
+ // __attribute__((overflow_behavior("no_wrap")))
+ OB_NoWrap,
+
+ // Signed types defined as wrapping via -fwrapv can still be instrumented
+ // by sanitizers (PR82432). This field is needed to disambiguate canonical
+ // wrapping type behaviors from -fwrapv behaviors.
+ // -fwrapv
+ OB_FWrapv
----------------
mizvekov wrote:
That makes sense, but then `OB_Unset` should probably be called `OB_Undefined` for naming consistency, right?
https://github.com/llvm/llvm-project/pull/148914
More information about the lldb-commits
mailing list