[clang-tools-extra] [lit] Are all RUN lines skipped in windows cmd? (PR #65242)

2023-09-06 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Whatever we do, I consider it important for us to understand how widely `cmd` is used. https://github.com/llvm/llvm-project/pull/65242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [lit] Are all RUN lines skipped in windows cmd? (PR #65242)

2023-09-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > When I install Visual Studio, it creates a widget that brings up a cmd shell > with the right environment. I'm not aware of a similar widget for PowerShell. At least in VS 2022, there is a `Developer PowerShell for VS 2022` in Start menu beside the usual `x64 Native Tools

[clang] [clang][NFC] Replace TypeAlignment with alignof(T) (PR #69185)

2023-10-16 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: It's in our public headers, and downstream users were supposed to rely on it, because `alignof` for `Type` and all its derived types reported the wrong value. So while I agree with you, I lean towards it being a breaking change which should be handled appropriately.

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-16 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Thank you for updating our status page! The following papers were applied as defect reports. Have you considered them? N4891: P2156 (Allow Duplicate Attributes) N4916: P2280 (Using unknown pointers and references in constant expressions) I agree with your analysis in

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67673)

2023-10-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: If Aaron weren't able to fix this in several commits, I'm not sure it's a `good first issue`. https://github.com/llvm/llvm-project/pull/67673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/68846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Replace TypeAlignment with alignof(T) (PR #69185)

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

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

2023-10-15 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/3] [clang] Add clang::debug_info_type attribute ---

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

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

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

2023-10-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/69104 This attribute allows user to specify type of the bitfield that will be emitted to debug info without affecting semantics of the program. Since it doesn't affect semantics, this attribute can be safely ignored

[clang] [clang][NFC] Refactor `Selector` to use `PointerIntPair` inside (PR #69916)

2023-10-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/69916 ___ 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/8] [clang] Add clang::debug_info_type attribute ---

[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] 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] 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 , Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema , Decl *D, const ParsedAttr ) { + if (!AL.hasParsedType()) { +S.Diag(AL.getLoc(),

[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)]]

[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 , Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handleDebugInfoTypeAttr(Sema , Decl *D, const ParsedAttr ) { + if (!AL.hasParsedType()) { +S.Diag(AL.getLoc(),

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-27 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: That's a good point. I'm not opposed to wrap this attribute if we must. I'd like to hear from @AaronBallman on this matter. https://github.com/llvm/llvm-project/pull/70349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-27 Thread Vlad Serebrennikov via cfe-commits
@@ -20,7 +20,7 @@ namespace clang { /// Describes the different kinds of linkage /// (C++ [basic.link], C99 6.2.2) that an entity may have. -enum Linkage : unsigned char { +enum Linkage : unsigned { Endilll wrote: This case is similar to `TypeDependence` we

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

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

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -49,7 +49,7 @@ struct ExprDependenceScope { using ExprDependence = ExprDependenceScope::ExprDependence; struct TypeDependenceScope { - enum TypeDependence : uint8_t { + enum TypeDependence : unsigned { Endilll wrote: In this particular case, width of

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

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

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -49,7 +49,7 @@ struct ExprDependenceScope { using ExprDependence = ExprDependenceScope::ExprDependence; struct TypeDependenceScope { - enum TypeDependence : uint8_t { + enum TypeDependence : unsigned { Endilll wrote: The only place this enum is stored

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: [Mozilla](https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html), [WebKit](https://webkit.org/code-style-guidelines/), [GCC](https://gcc.gnu.org/codingconventions.html#Cxx_Conventions),

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-27 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @tbaederr As highlighted in https://github.com/llvm/llvm-project/pull/69104, this attribute doesn't change semantics of the program, so it's safe to ignore. https://github.com/llvm/llvm-project/pull/70349 ___ cfe-commits mailing list

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70360 >From 3866a77d62a34e612ff869cde7c743e31350eed2 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 20:41:25 +0300 Subject: [PATCH 1/2] [clang-format] Change LLVM style to

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Vlad Serebrennikov via cfe-commits
@@ -26179,7 +26179,7 @@ TEST_F(FormatTest, RemoveSemicolon) { TEST_F(FormatTest, BreakAfterAttributes) { FormatStyle Style = getLLVMStyle(); - EXPECT_EQ(Style.BreakAfterAttributes, FormatStyle::ABS_Never); + EXPECT_EQ(Style.BreakAfterAttributes, FormatStyle::ABS_Leave);

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-27 Thread Vlad Serebrennikov via cfe-commits
@@ -794,6 +794,7 @@ clang-format - Add ``AllowBreakBeforeNoexceptSpecifier`` option. - Add ``AllowShortCompoundRequirementOnASingleLine`` option. +- Change ``BreakAfterAttributes`` from ``Never`` to ``Leave`` in LLVM style Endilll wrote: Fixed.

[llvm] [clang] [clang-tools-extra] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

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

[clang] aaba376 - [clang][NFC] Refactor `ObjCMethodDecl::ImplementationControl`

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-01T13:40:11+03:00 New Revision: aaba3761db84032541712899964714f3184e8b3d URL: https://github.com/llvm/llvm-project/commit/aaba3761db84032541712899964714f3184e8b3d DIFF:

[clang] 50dec54 - [clang][NFC] Refactor `OMPDeclareReductionDecl::InitKind`

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-01T12:40:13+03:00 New Revision: 50dec541f328a251c2830421f354e4439e635def URL: https://github.com/llvm/llvm-project/commit/50dec541f328a251c2830421f354e4439e635def DIFF:

[llvm] [clang] [clang-tools-extra] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-31 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70349 >From 7329f68092d5f8f5a5978e5a6cbad6ada87d4fe8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 16:09:25 +0300 Subject: [PATCH 1/4] [clang][NFC] Annotate `Type` bit-fields with

[llvm] [clang] [clang-tools-extra] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70349 >From 7329f68092d5f8f5a5978e5a6cbad6ada87d4fe8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 16:09:25 +0300 Subject: [PATCH 1/5] [clang][NFC] Annotate `Type` bit-fields with

[clang] b120fe8 - [clang][NFC] Refactor `ArgPassingKind`

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-01T11:49:59+03:00 New Revision: b120fe8d3288c4dca1b5427ca34839ce8833f71c URL: https://github.com/llvm/llvm-project/commit/b120fe8d3288c4dca1b5427ca34839ce8833f71c DIFF:

[clang] 6576120 - [clang][NFC] Refactor `LinkageSpecDecl::LanguageIDs`

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-01T16:44:34+03:00 New Revision: 65761200ce4e1f366e8418652efdafd2f744291b URL: https://github.com/llvm/llvm-project/commit/65761200ce4e1f366e8418652efdafd2f744291b DIFF:

[lldb] [clang] [clang][NFC] Rename ArgPassingKind to RecordArgPassingKind (PR #70955)

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

[clang] [lldb] [clang][NFC] Rename ArgPassingKind to RecordArgPassingKind (PR #70955)

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70955 During the recent refactoring (b120fe8d3288c4dca1b5427ca34839ce8833f71c) this enum was moved out of `RecordDecl`. During post-commit review it was found out that its association with `RecordDecl` should be

[clang-tools-extra] 008af1c - [clang][NFC] Fix leftovers from `LinkageSpecDecl::LanguageIDs` refactoring

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-01T17:00:55+03:00 New Revision: 008af1c9f4cd0188a69bf42b821749154a8142c8 URL: https://github.com/llvm/llvm-project/commit/008af1c9f4cd0188a69bf42b821749154a8142c8 DIFF:

[clang] [clang][NFC] Improve locality of recently refactored enums (PR #70943)

2023-11-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70943 This patch moves definition of recently refactored enums closer to the types where they were originally defined. Since they are scoped enums at namespace scope now, they can be forward-declared. Refactorings

[clang] [clang][NFC] Improve locality of recently refactored enums (PR #70943)

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

[clang] ae7b20b - [clang][NFC] Refactor `VectorType::VectorKind`

2023-10-31 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-10-31T21:50:18+03:00 New Revision: ae7b20b583fab1325d8b51fe5f2eaf612de8b95e URL: https://github.com/llvm/llvm-project/commit/ae7b20b583fab1325d8b51fe5f2eaf612de8b95e DIFF:

[clang] 4ad2ada - [clang][NFC] Refactor ElaboratedTypeKeyword

2023-10-31 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-10-31T20:46:07+03:00 New Revision: 4ad2ada5216ee2bb3c334a3233a9ab51f2521b82 URL: https://github.com/llvm/llvm-project/commit/4ad2ada5216ee2bb3c334a3233a9ab51f2521b82 DIFF:

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/71049 This patch introduces a new enumerator `Invalid = 0`, shifting other enumerators by +1. Contrary to how it might sound, this actually affirms status quo of how this enum is stored in `clang::Decl`: ``` /// If

[clang] [clang-tools-extra] [clang] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/71049 >From 05089e60021c321b4113db7e4bdf59bdaaa19de7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 2 Nov 2023 14:40:12 +0300 Subject: [PATCH 1/4] [clang][NFC] Refactor `clang::Linkage` This patch

[clang] [clang-tools-extra] [clang] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -2214,7 +2214,7 @@ void ASTWriter::WriteDeclAbbrevs() { Abv->Add(BitCodeAbbrevOp(0)); // TSCSpec Abv->Add(BitCodeAbbrevOp(0)); // InitStyle Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong -

[llvm] [compiler-rt] [libcxx] [libc] [flang] [clang] [lldb] [clang-tools-extra] [lld] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70349 >From 7329f68092d5f8f5a5978e5a6cbad6ada87d4fe8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 16:09:25 +0300 Subject: [PATCH 1/7] [clang][NFC] Annotate `Type` bit-fields with

[libc] [clang] [lld] [clang-tools-extra] [flang] [libcxx] [llvm] [lldb] [compiler-rt] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -49,7 +49,7 @@ struct ExprDependenceScope { using ExprDependence = ExprDependenceScope::ExprDependence; struct TypeDependenceScope { - enum TypeDependence : uint8_t { + enum TypeDependence : unsigned { Endilll wrote: I reverted changes to underlying

[clang-tools-extra] [clang] [clang] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/71049 >From 05089e60021c321b4113db7e4bdf59bdaaa19de7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 2 Nov 2023 14:40:12 +0300 Subject: [PATCH 1/2] [clang][NFC] Refactor `clang::Linkage` This patch

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > I've considered this but I found the number of alternatives too large to make > it feasible. Consider that we have 11 possible SValKinds, which would require > 4 bits to encode. Requiring all Data pointers to be aligned as such seems > rough - although not impossible. Sorry,

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/71039 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1921,7 +1920,20 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD, bool IsKnownNewer) const { } bool NamedDecl::hasLinkage() const { - return getFormalLinkage() != NoLinkage; + switch (getFormalLinkage()) { + case Linkage::Invalid: +llvm_unreachable("Linkage

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -560,7 +562,7 @@ bool CXIndexDataConsumer::handleDecl(const NamedDecl *D, if (shouldSuppressRefs()) markEntityOccurrenceInFile(D, Loc); - + Endilll wrote: I guess that's clang-format at work. I'll revert this.

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -138,7 +138,7 @@ namespace dr1295 { // dr1295: 4 #if __cplusplus <= 201402L // expected-error@-2 {{does not refer to any declaration}} expected-note@-3 {{here}} #else - // expected-error@-4 {{refers to subobject}} + // expected-error@-4 {{bind to bit-field in converted

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -84,22 +88,33 @@ inline bool isUniqueGVALinkage(GVALinkage L) { } inline bool isExternallyVisible(Linkage L) { - return L >= VisibleNoLinkage; + switch (L) { + case Linkage::Invalid: +llvm_unreachable("Linkage hasn't been computed!"); Endilll wrote:

[clang] [clang-tools-extra] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -2214,7 +2214,7 @@ void ASTWriter::WriteDeclAbbrevs() { Abv->Add(BitCodeAbbrevOp(0)); // TSCSpec Abv->Add(BitCodeAbbrevOp(0)); // InitStyle Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong -

[clang] [llvm] [clang-tools-extra] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70349 >From 7329f68092d5f8f5a5978e5a6cbad6ada87d4fe8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 16:09:25 +0300 Subject: [PATCH 1/6] [clang][NFC] Annotate `Type` bit-fields with

[clang] [clang-tools-extra] [clang] Refactor `clang::Linkage` (PR #71049)

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

[clang] [clang-tools-extra] [clang] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1996,7 +1996,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { TypeBits.Dependence = static_cast(Dependence); TypeBits.CacheValid = false; TypeBits.CachedLocalOrUnnamed = false; -TypeBits.CachedLinkage = NoLinkage; +

[clang] [clang-tools-extra] [clang] Refactor `clang::Linkage` (PR #71049)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -2214,7 +2214,7 @@ void ASTWriter::WriteDeclAbbrevs() { Abv->Add(BitCodeAbbrevOp(0)); // TSCSpec Abv->Add(BitCodeAbbrevOp(0)); // InitStyle Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong -

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. LGTM from DR testing perspective. https://github.com/llvm/llvm-project/pull/71077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Remove diagnostic that came with `[[clang::preferred_type]]` (PR #70632)

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

[libc] [clang] [lld] [clang-tools-extra] [flang] [libcxx] [llvm] [lldb] [compiler-rt] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70349 >From 7329f68092d5f8f5a5978e5a6cbad6ada87d4fe8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 16:09:25 +0300 Subject: [PATCH 1/6] [clang][NFC] Annotate `Type` bit-fields with

[flang] [compiler-rt] [libc] [llvm] [lldb] [lld] [libcxx] [clang-tools-extra] [clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

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

[clang-tools-extra] [clang] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

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

[clang-tools-extra] [clang] [clang][NFC] Refactor `clang::Linkage` (PR #71049)

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

[clang] [clang] Improve bit-field in ref NTTP diagnostic (PR #71077)

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

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-03 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > What other ways are to make a const void * debugger-friendly - other than > llvm::PointerUnion? I'm not aware of any that wouldn't require writing a custom formatter. Ultimately it boils to how can I extract type information. For `llvm::PointerUnion` I'm matching

[llvm] [flang] [compiler-rt] [openmp] [clang] [mlir] [libcxx] [lldb] [clang-tools-extra] [clang][NFC] Refactor `TagTypeKind` (PR #71160)

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

[clang] 0fea0d2 - [clang][NFC] Annotate DeclBase.h with `preferred_type`

2023-11-03 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-04T08:43:59+03:00 New Revision: 0fea0d2f3b5e5be011e229cdddc7540095ff9236 URL: https://github.com/llvm/llvm-project/commit/0fea0d2f3b5e5be011e229cdddc7540095ff9236 DIFF:

[clang] c4b2d33 - [clang][NFC] Annotate 2 leftover bit-fields in `Type.h` with `preferred_type`

2023-11-04 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-04T08:58:57+03:00 New Revision: c4b2d338cc450ff4499fd062cd9261bea55808a1 URL: https://github.com/llvm/llvm-project/commit/c4b2d338cc450ff4499fd062cd9261bea55808a1 DIFF:

[clang] 5b9d793 - [clang][NFC] Annotate Expr-related headers with `preferred_type`

2023-11-04 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-04T09:23:50+03:00 New Revision: 5b9d793290c187aee4e63b61d4a12c3766f7cfe6 URL: https://github.com/llvm/llvm-project/commit/5b9d793290c187aee4e63b61d4a12c3766f7cfe6 DIFF:

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

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

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Converting packed `unsigned Kind` into non-packed `SValKind Kind` is definitely going to help debuggers to display the value correctly. But I have to point out that this patch doesn't address the fact that `const void* Data` is not friendly to debuggers,

[clang] [analyzer][NFC] Rework SVal kind representation (PR #71039)

2023-11-02 Thread Vlad Serebrennikov via cfe-commits
@@ -105,38 +86,25 @@ class SVal { return llvm::dyn_cast(*this); } - unsigned getRawKind() const { return Kind; } - BaseKind getBaseKind() const { return (BaseKind) (Kind & BaseMask); } - unsigned getSubKind() const { return Kind >> BaseBits; } + SValKind getKind()

[clang] 6e35db0 - [clang][NFC] Refactor `PredefinedExpr::IdentKind`

2023-11-05 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-05T15:39:05+03:00 New Revision: 6e35db0694b2cb80ffe0c7edfed3090f9ede4805 URL: https://github.com/llvm/llvm-project/commit/6e35db0694b2cb80ffe0c7edfed3090f9ede4805 DIFF:

[clang] c23aaa4 - [clang][NFC] Refactor `CharacterLiteral::CharacterKind`

2023-11-05 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-05T13:36:08+03:00 New Revision: c23aaa410358b9f9c364ddaaeb6b2069b185a99b URL: https://github.com/llvm/llvm-project/commit/c23aaa410358b9f9c364ddaaeb6b2069b185a99b DIFF:

[clang] [clang-tools-extra] [clang][NFC] Refacator `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/71322 This patch converts `CXXNewExpr::InitializationStyle` into a scoped enum at namespace scope. It also affirms the status quo by adding a new enumerator to represent implicit initializer. >From

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

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

[clang] 3e6ce58 - [clang][NFC] Refactor `StringLiteral::StringKind`

2023-11-05 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-05T12:30:49+03:00 New Revision: 3e6ce58701a3a8463b53fb3fd2023c02b4e90554 URL: https://github.com/llvm/llvm-project/commit/3e6ce58701a3a8463b53fb3fd2023c02b4e90554 DIFF:

[clang-tools-extra] a9070f2 - [clang][NFC] Refactor `CXXConstructExpr::ConstructionKind`

2023-11-05 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-05T16:38:45+03:00 New Revision: a9070f22a29e28f7d6f83c24a8dd88f3a94969ae URL: https://github.com/llvm/llvm-project/commit/a9070f22a29e28f7d6f83c24a8dd88f3a94969ae DIFF:

[clang] [clang-tools-extra] [clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (PR #71322)

2023-11-07 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > If you see failures locally, it's best to understand where they coming from: > even if it passes on bots it just means we have a hole in our test coverage. Sure, but it wasn't the first time I've seen local test failures that doesn't reproduce anywhere else (`Clang ::

[clang] fb8ff4c - [clang][NFC] Add a missing comment to #71322 changes

2023-11-07 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-11-07T22:24:59+03:00 New Revision: fb8ff4cdaecb7fe498d4e3a9cbcb33d40cccd29a URL: https://github.com/llvm/llvm-project/commit/fb8ff4cdaecb7fe498d4e3a9cbcb33d40cccd29a DIFF:

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70349 >From 7329f68092d5f8f5a5978e5a6cbad6ada87d4fe8 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 16:09:25 +0300 Subject: [PATCH 1/4] [clang][NFC] Annotate `Type` bit-fields with

[clang] [clang] Remove diagnostic that came with `[[clang::preferred_type]]` (PR #70632)

2023-10-30 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70632 https://github.com/llvm/llvm-project/pull/69104 introduce a diagnostic that checked underlying type of an enum against type of bit-field that is annotated with `[[clang::preferred_type]]`. When I tried to

[clang] [clang] Remove diagnostic that came with `[[clang::preferred_type]]` (PR #70632)

2023-10-30 Thread Vlad Serebrennikov via cfe-commits
@@ -5928,28 +5928,6 @@ static void handlePreferredTypeAttr(Sema , Decl *D, const ParsedAttr ) { S.RequireCompleteType(ParmTSI->getTypeLoc().getBeginLoc(), QT, diag::err_incomplete_type); - if (QT->isEnumeralType()) { -auto IsCorrespondingType =

[clang] [clang] Remove diagnostic that came with `[[clang::preferred_type]]` (PR #70632)

2023-10-30 Thread Vlad Serebrennikov via cfe-commits
@@ -5928,28 +5928,6 @@ static void handlePreferredTypeAttr(Sema , Decl *D, const ParsedAttr ) { S.RequireCompleteType(ParmTSI->getTypeLoc().getBeginLoc(), QT, diag::err_incomplete_type); - if (QT->isEnumeralType()) { -auto IsCorrespondingType =

[clang] 49fd28d - [clang][NFC] Refactor `ArrayType::ArraySizeModifier`

2023-10-31 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-10-31T18:06:34+03:00 New Revision: 49fd28d9601dde429436655ec74234e895c60b89 URL: https://github.com/llvm/llvm-project/commit/49fd28d9601dde429436655ec74234e895c60b89 DIFF:

[clang-tools-extra] f5f4c5b - [clang][NFC] Follow up to ArraySizeModifier refactoring

2023-10-31 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2023-10-31T18:21:36+03:00 New Revision: f5f4c5b313fc809b9b1b9d600d0ec3cec0d12941 URL: https://github.com/llvm/llvm-project/commit/f5f4c5b313fc809b9b1b9d600d0ec3cec0d12941 DIFF:

[llvm] [clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-31 Thread Vlad Serebrennikov via cfe-commits
@@ -49,7 +49,7 @@ struct ExprDependenceScope { using ExprDependence = ExprDependenceScope::ExprDependence; struct TypeDependenceScope { - enum TypeDependence : uint8_t { + enum TypeDependence : unsigned { Endilll wrote: Yeah, I'm putting this on hold for a

[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

[clang] [Clang] Mark declarators invalid in the presence of ill-formed explicit parameters. (PR #70018)

2023-10-24 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. DR test part of this PR looks fine to me. https://github.com/llvm/llvm-project/pull/70018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70296 This patch refactor said enums to hold total size of a bit-field, and not just non-inherited bits. This brings `Type` and `DeclContext` in line with `Comment` and `Stmt`. It also makes it unnecessary to list

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -1819,10 +1812,10 @@ class DeclContext { SourceLocation AtStart; }; - /// Number of non-inherited bits in ObjCContainerDeclBitfields. + /// Number of inherited and non-inherited bits in ObjCContainerDeclBitfields. /// Note that here we rely on the fact that

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -1739,10 +1734,8 @@ class DeclContext { uint64_t IsSimpleExplicit : 1; }; - /// Number of non-inherited bits in CXXConstructorDeclBitfields. - enum { -NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits - }; + /// Number of inherited and

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -1663,11 +1663,12 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// Actually an ArrayType::ArraySizeModifier. unsigned SizeModifier : 3; }; + enum { NumArrayTypeBits = NumTypeBits + 3 + 3 }; Endilll wrote: Applied.

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70296 >From 9a20b9609c5d4c18772907e82af4995411c42da6 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 09:04:22 +0300 Subject: [PATCH 1/2] [clang][NFC] Refactor enums that hold size of Type and

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

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

[clang] [clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (PR #70360)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70360 This patch addresses some example of bad formatting in Clang. The following commit contains only changes suggested by clang-format:

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Formatting is good. I created a PR against `clang-format` to convince the tool: https://github.com/llvm/llvm-project/pull/70360 https://github.com/llvm/llvm-project/pull/70349 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][NFC] Annotate `Type` bit-fields with `clang::preferred_type` (PR #70349)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70349 This patch adds `clang::preferred_type` annotations to Type-related bit-fields where possible. Notable exception are bit-fields that hold values of types that are incomplete at bit-field declaration. This is a

  1   2   3   4   5   6   7   8   9   10   >