[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-25 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-25 Thread Justin Stitt via lldb-commits
@@ -359,6 +366,16 @@ class DeclSpec { LLVM_PREFERRED_TYPE(TQ) unsigned TypeQualifiers : 5; // Bitwise OR of TQ. + // overflow behavior qualifiers + LLVM_PREFERRED_TYPE(bool) JustinStitt wrote: Sounds good to me. I'll make the change. https://github.co

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-25 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
@@ -4043,6 +4043,33 @@ def note_cannot_use_trivial_abi_reason : Note< "it has a __weak field|it has a field of a non-trivial class type|" "it has an address-discriminated '__ptrauth' field}1">; +// OverflowBehavior attribute +def err_overflow_behavior_unknown_ident +:

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
@@ -9744,6 +9744,16 @@ static void DiagnoseNarrowingInInitList(Sema &S, case NK_Constant_Narrowing: { // A constant value was narrowed. + +// Overflow behavior destination types with a 'wrap' kind can elide JustinStitt wrote: > Why is that a reasona

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
@@ -2845,6 +2866,41 @@ bool Sema::IsComplexPromotion(QualType FromType, QualType ToType) { ToComplex->getElementType()); } +bool Sema::IsOverflowBehaviorTypePromotion(QualType FromType, QualType ToType) { JustinStitt wrote: Yes the i

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
@@ -4043,6 +4043,33 @@ def note_cannot_use_trivial_abi_reason : Note< "it has a __weak field|it has a field of a non-trivial class type|" "it has an address-discriminated '__ptrauth' field}1">; +// OverflowBehavior attribute +def err_overflow_behavior_unknown_ident +:

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via lldb-commits
@@ -1146,23 +1161,16 @@ def Parentheses : DiagGroup<"parentheses", // - conversion warnings for literals are on by default // - bool-to-pointer conversion warnings are on by default // - __null-to-integer conversion warnings are on by default -def Conversion : DiagGroup<"

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-20 Thread Justin Stitt via lldb-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -foverflow-behavior-types -std=c++11 -ast-print %s -o - | FileCheck %s + +extern int __attribute__((overflow_behavior(no_wrap))) a; +extern int __attribute__((overflow_behavior(wrap))) b; + +// CHECK: extern __no_wrap int a; +// CHECK: extern _

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Justin Stitt via lldb-commits
@@ -339,6 +389,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, << "' " << Values << ")"; return DecoratedString; } + +TryConvertOverflowBehaviorTypeToDiagnosticString(Context, Ty, S); JustinStitt wrote: > If you fee

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Justin Stitt via lldb-commits
@@ -339,6 +389,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, << "' " << Values << ")"; return DecoratedString; } + +TryConvertOverflowBehaviorTypeToDiagnosticString(Context, Ty, S); JustinStitt wrote: OK, so shoul

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-18 Thread Justin Stitt via lldb-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -foverflow-behavior-types -std=c++11 -ast-print %s -o - | FileCheck %s + +extern int __attribute__((overflow_behavior(no_wrap))) a; +extern int __attribute__((overflow_behavior(wrap))) b; + +// CHECK: extern __no_wrap int a; +// CHECK: extern _

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
@@ -2165,6 +2167,26 @@ void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T, printAfter(T->getWrappedType(), OS); } +void TypePrinter::printOverflowBehaviorBefore(const OverflowBehaviorType *T, + raw_ostream

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
@@ -7477,6 +7477,10 @@ void TypeLocReader::VisitBTFTagAttributedTypeLoc(BTFTagAttributedTypeLoc TL) { // Nothing to do. } +void TypeLocReader::VisitOverflowBehaviorTypeLoc(OverflowBehaviorTypeLoc TL) { + // Nothing to do. +} JustinStitt wrote: Right. Done

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
@@ -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, +

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Justin Stitt via lldb-commits
@@ -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, +

[Lldb-commits] [clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-16 Thread Justin Stitt via lldb-commits
JustinStitt wrote: ping. rebased and fixed tests after `Commit b24769855d97: [Clang] [Sema] Make -Wincompatible-pointer-types an error by default (#157364)` caused some tests to fail. https://github.com/llvm/llvm-project/pull/148914 ___ lldb-commits