[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
@@ -5910,6 +5910,28 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -verify %s + +struct A { + enum E : unsigned {}; + [[clang::preferred_type(E)]] unsigned b : 2; + [[clang::preferred_type(E)]] int b2 : 2; + // expected-warning@-1 {{underlying type 'unsigned int' of enumeration 'E' doesn't match bit-field

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,28 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: >I meant warning on something like https://godbolt.org/z/Ma17xjjc5. That >doesn't seem like it should be that hard. Yeah, that one wouldn't be too hard (and isn't a pattern I've ever seen TBH), but doesn't solve the problem at hand, which is that it is very common to need to

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
@@ -5910,6 +5910,30 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,30 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: >>@erichkeane I guess you'd be pretty happy if our enums were declared the >> following way: >Not really? That doesn't gain us the 'we must change where this is stored' >situation like a preferred_type attribute would/could. We MIGHT be able to get >away with a comment on t

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > @erichkeane I guess you'd be pretty happy if our enums were declared the > > > following way: > > > Not really? That doesn't gain us the 'we must change where this is stored' > > situation like a preferred_type attribute would/could. We MIGHT be able to > > get away wi

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Taking the example above, I think it would have to look the following way to fully complement a check for bit-field width in `preferred_type`: ```cpp enum StoredNameKind : unsigned _BitInt(3) { StoredIdentifier = 0, StoredObjCZeroArgSelector = Selector::ZeroArg, Store

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: Ah, found it: https://godbolt.org/z/59sc87Y3Y See how on the assignment to a bitfield we check to make sure the largest value of the enum will fit in the bitfield? I'm saying I want us to do this EARLIER, on declaration with this attribute. https://github.com/llvm/llvm-proj

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > See how on the assignment to a bitfield we check to make sure the largest > value of the enum will fit in the bitfield? I'm saying I want us to do this > EARLIER, on declaration with this attribute. I totally do. Thank you for pointing out to `-Wbitfield-enum-conversion`! But

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > > See how on the assignment to a bitfield we check to make sure the largest > > value of the enum will fit in the bitfield? I'm saying I want us to do this > > EARLIER, on declaration with this attribute. > > I totally do. Thank you for pointing out to `-Wbitfield-enum-conv

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > when does someone have an enum value that they don't intend to ever be in the > enum In my previous comments (https://github.com/llvm/llvm-project/pull/69104#issuecomment-1771167758, https://github.com/llvm/llvm-project/pull/69104#issuecomment-1771204043) I provided an examp

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: >In my previous comments >(https://github.com/llvm/llvm-project/pull/69104#issuecomment-1771167758, >https://github.com/llvm/llvm-project/pull/69104#issuecomment-1771204043) I >provided an example of StoredNameKind enum that has enumerators 0 through 8 (9 >total, 4 bits to s

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > which brings up an additional concern/thing to deal with for the non_storable > attribute (that is, do we apply it to assignments? how about > exact-assignments like you've done there?). Conservative approach would be to issue diagnostics based on `non_storable` only when LHS

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > > which brings up an additional concern/thing to deal with for the > > non_storable attribute (that is, do we apply it to assignments? how about > > exact-assignments like you've done there?). > > Conservative approach would be to issue diagnostics based on `non_storable`

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Taking the example above, I think it would have to look the following way to > fully complement a check for bit-field width in `preferred_type`: > > ```c++ > enum StoredNameKind : unsigned _BitInt(3) { > ... snip ... >``` > I think we can robustly diagnose new enumerator

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: >>I'm still thinking my way through a non_storable attribute, but on its face, >>it seems like it could be overkill. I suspect (but haven't measured!) that >>there is way more code out there that maps enumerations to bit-fields that >>expect all members of the enumeration to

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > There's some danger here. _BitInt is a C23 feature as are enumerations with a > fixed underlying type. Enumerations with a fixed underlying type explicitly > disallow using a bit-precise integer type as the underlying type. See C23 > 6.7.2.2p4, which says in part, "For all the

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > There's some danger here. _BitInt is a C23 feature as are enumerations with > > a fixed underlying type. Enumerations with a fixed underlying type > > explicitly disallow using a bit-precise integer type as the underlying > > type. See C23 6.7.2.2p4, which says in part,

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > > > There's some danger here. _BitInt is a C23 feature as are enumerations > > > with a fixed underlying type. Enumerations with a fixed underlying type > > > explicitly disallow using a bit-precise integer type as the underlying > > > type. See C23 6.7.2.2p4, which says in

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 1/6] [clang] Add clang::debug_info_type attribute --- clang

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
@@ -5910,6 +5910,30 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,28 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > I filed an issue for this, automatically mentioned above. Fixed! https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 1/7] [clang] Add clang::debug_info_type attribute --- clang

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Aaron Ballman via cfe-commits
@@ -5910,6 +5910,30 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,30 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I'm ignoring signed/unsigned mismatch as @erichkeane and @AaronBallman suggested. The only outstanding aspect is the following diagnostic I added today and haven't received feedback on: ```cpp [[clang::preferred_type(bool)]] unsigned b4 : 1; [[clang::preferred_type(bool)]] un

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 1/8] [clang] Add clang::debug_info_type attribute --- clang

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-19 Thread Erich Keane via cfe-commits
erichkeane wrote: > I'm ignoring signed/unsigned mismatch as @erichkeane and @AaronBallman > suggested. The only outstanding aspect is the following diagnostic I added > today and haven't received feedback on: > > ```c++ > [[clang::preferred_type(bool)]] unsigned b4 : 1; > [[clang::preferr

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > While I think that warning is accurate, I somewhat question the value of the > 'bool' as working on this type I'm not sure what you mean by "working" here, but I'd like to highlight that we have hundreds of single-bit bit-fields across Clang that would benefit from `[[clang::

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > While I think that warning is accurate, I somewhat question the value of > > the 'bool' as working on this type > > I'm not sure what you mean by "working" here, but I'd like to highlight that > we have hundreds of single-bit bit-fields across Clang that would benefit

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Erich Keane via cfe-commits
erichkeane wrote: >As I mentioned in >https://github.com/llvm/llvm-project/pull/69104#discussion_r1365269451, I'm >not putting any restrictions on type parameter of the attribute, which makes >even more sense for more generic preferred_type. >But I'm confused by the fact you are raising this

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 1/9] [clang] Add clang::debug_info_type attribute --- clang

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,51 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > However, will this actually work in practice in the debugger? If not, perhaps > we should limit to just integer and enumeration types for now, leaving the > extension for the future. I composed an example of that: ```cpp struct A { short a1; short a2; }; struct B { [[cl

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: > ```c++ > struct A { > short a1; > short a2; > }; > > struct B { > [[clang::preferred_type(A)]] unsigned b1 : 32 = 0x000F'000C; > }; > > int main() > { > B b; > return b.b1; > } > ``` An example where the layout doesn't match the normal struct layout might be m

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I wonder if we should treat one-bit bit-fields as if they were bool > > automatically (e.g., create this attribute implicitly in that case). How > > often do we expect to see one-bit bit-fields that are arithmetic? I'm sure > > it happens (to multiply against -1, 0, or

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Aaron Ballman via cfe-commits
@@ -3153,6 +3153,12 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def warn_attribute_und

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread David Blaikie via cfe-commits
@@ -3153,6 +3153,12 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def warn_attribute_und

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread David Blaikie via cfe-commits
@@ -3153,6 +3153,12 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def warn_attribute_und

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
@@ -3153,6 +3153,12 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def warn_attribute_und

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Aaron Ballman via cfe-commits
@@ -3153,6 +3153,12 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def warn_attribute_und

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Aaron Ballman via cfe-commits
@@ -5910,6 +5910,51 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 01/10] [clang] Add clang::debug_info_type attribute --- cla

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,51 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Erich Keane via cfe-commits
erichkeane wrote: > > However, will this actually work in practice in the debugger? If not, > > perhaps we should limit to just integer and enumeration types for now, > > leaving the extension for the future. > > I composed an example of that: > > ```c++ > struct A { > short a1; > short a

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 01/11] [clang] Add clang::debug_info_type attribute --- cla

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
@@ -3153,6 +3153,12 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def warn_attribute_und

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 01/12] [clang] Add clang::debug_info_type attribute --- cla

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-20 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > but I also see "you got what you asked for!" as being a reasonable defense to > that. That's my thinking indeed, and the reason why I opposed to Aaron's proposal to implicitly mark 1-bit bit-fields as `preferred_type(bool)`. https://github.com/llvm/llvm-project/pull/69104 ___

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Vlad Serebrennikov via cfe-commits
@@ -5910,6 +5910,30 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { +S.Diag(AL.get

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Aaron Ballman via cfe-commits
@@ -7219,6 +7219,31 @@ its underlying representation to be a WebAssembly ``funcref``. }]; } +def PreferredTypeDocumentation : Documentation { + let Category = DocCatField; + let Content = [{ +This attribute allows adjusting the type of a bit-field in debug information. +T

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Aaron Ballman via cfe-commits
@@ -7219,6 +7219,31 @@ its underlying representation to be a WebAssembly ``funcref``. }]; } +def PreferredTypeDocumentation : Documentation { + let Category = DocCatField; + let Content = [{ +This attribute allows adjusting the type of a bit-field in debug information. +T

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes should also come with a release note, but I'm generally happy with the code. I did have some suggestions for changes to documentation though. https://github.com/llvm/llvm-project/pull/69104 ___ cf

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > The changes should also come with a release note, but I'm generally happy > with the code. I did have some suggestions for changes to documentation > though. Suggestion for the release note would be something along these lines: ``` - Clang now supports ``[[clang::preferre

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/69104 >From 976aa5c8f3d936a15e7123069a49d97ad3bf7a05 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 15 Oct 2023 13:14:55 +0300 Subject: [PATCH 01/14] [clang] Add clang::debug_info_type attribute --- cla

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Vlad Serebrennikov via cfe-commits
@@ -7219,6 +7219,31 @@ its underlying representation to be a WebAssembly ``funcref``. }]; } +def PreferredTypeDocumentation : Documentation { + let Category = DocCatField; + let Content = [{ +This attribute allows adjusting the type of a bit-field in debug information. +T

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Vlad Serebrennikov via cfe-commits
@@ -7219,6 +7219,31 @@ its underlying representation to be a WebAssembly ``funcref``. }]; } +def PreferredTypeDocumentation : Documentation { + let Category = DocCatField; + let Content = [{ +This attribute allows adjusting the type of a bit-field in debug information. +T

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Thank you @AaronBallman for writing even more documentation! https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. These changes LGTM, but please give @erichkeane a chance to chime in given his previous feedback. https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. LGTM, i think we're in an acceptable way forward, particularly on diagnostics. https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang] Add clang::preferred_type attribute for bitfields (PR #69104)

2023-10-23 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/69104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits