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/3] [clang][NFC] Annotate `Type` bit-fields with
@@ -809,43 +927,42 @@ class Selector {
enum IdentifierInfoFlag {
// Empty selector = 0. Note that these enumeration values must
// correspond to the enumeration values of DeclarationName::StoredNameKind
-ZeroArg = 0x01,
-OneArg = 0x02,
+ZeroArg = 0x01,
@@ -809,43 +927,42 @@ class Selector {
enum IdentifierInfoFlag {
// Empty selector = 0. Note that these enumeration values must
// correspond to the enumeration values of DeclarationName::StoredNameKind
-ZeroArg = 0x01,
-OneArg = 0x02,
+ZeroArg = 0x01,
Author: Vlad Serebrennikov
Date: 2023-11-06T10:00:42+03:00
New Revision: 421d6ccc4c663b90aa03be7b7598fff50478e997
URL:
https://github.com/llvm/llvm-project/commit/421d6ccc4c663b90aa03be7b7598fff50478e997
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:04:21+03:00
New Revision: a5d25708616d692592e705a0913afd78237698af
URL:
https://github.com/llvm/llvm-project/commit/a5d25708616d692592e705a0913afd78237698af
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:14:49+03:00
New Revision: 61d17b116880b34b6639e2780b9d46865d811be2
URL:
https://github.com/llvm/llvm-project/commit/61d17b116880b34b6639e2780b9d46865d811be2
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:43:53+03:00
New Revision: c032225bfcac9322661fac8c943a63ba70eb0e19
URL:
https://github.com/llvm/llvm-project/commit/c032225bfcac9322661fac8c943a63ba70eb0e19
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:58:27+03:00
New Revision: a07dbf1fb0f4ba36911233c82914a9ddf3eb4a09
URL:
https://github.com/llvm/llvm-project/commit/a07dbf1fb0f4ba36911233c82914a9ddf3eb4a09
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T09:20:04+03:00
New Revision: fb9d1243f535a8b678824d2b63d33eb183a7f2bc
URL:
https://github.com/llvm/llvm-project/commit/fb9d1243f535a8b678824d2b63d33eb183a7f2bc
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:28:58+03:00
New Revision: f1fdbcba5fc0f88a481f105c2a16f56db0dd2940
URL:
https://github.com/llvm/llvm-project/commit/f1fdbcba5fc0f88a481f105c2a16f56db0dd2940
DIFF:
@@ -2388,15 +2389,20 @@ class CXXNewExpr final
/// Whether this new-expression has any initializer at all.
bool hasInitializer() const {
-return CXXNewExprBits.StoredInitializationStyle > 0;
+switch (getInitializationStyle()) {
+case
Author: Vlad Serebrennikov
Date: 2023-11-06T12:34:10+03:00
New Revision: 58679ea576f9e48e20e43dcd99fd75c98fb7e6ba
URL:
https://github.com/llvm/llvm-project/commit/58679ea576f9e48e20e43dcd99fd75c98fb7e6ba
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:35:53+03:00
New Revision: acb714c10126192a2ead8b7fd3d5e16e4653d656
URL:
https://github.com/llvm/llvm-project/commit/acb714c10126192a2ead8b7fd3d5e16e4653d656
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T12:17:53+03:00
New Revision: ad278482095242cc20f5988c25381f4586fed589
URL:
https://github.com/llvm/llvm-project/commit/ad278482095242cc20f5988c25381f4586fed589
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T09:35:57+03:00
New Revision: b89aadf084feb025c2625f7bf7e206d666035ab1
URL:
https://github.com/llvm/llvm-project/commit/b89aadf084feb025c2625f7bf7e206d666035ab1
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T09:46:41+03:00
New Revision: 17db462810436e6cb5c422208d0d7718a8adb168
URL:
https://github.com/llvm/llvm-project/commit/17db462810436e6cb5c422208d0d7718a8adb168
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T09:58:02+03:00
New Revision: 24faf3b0b8e9b68304d9dd87c63afd5a0e813daa
URL:
https://github.com/llvm/llvm-project/commit/24faf3b0b8e9b68304d9dd87c63afd5a0e813daa
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T10:18:30+03:00
New Revision: 13023ed1d606a6e4a7c2590e1b698593bc317a61
URL:
https://github.com/llvm/llvm-project/commit/13023ed1d606a6e4a7c2590e1b698593bc317a61
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T11:03:23+03:00
New Revision: a0029a8a765f2bfe938de2c34ffb0264724ca04a
URL:
https://github.com/llvm/llvm-project/commit/a0029a8a765f2bfe938de2c34ffb0264724ca04a
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T12:01:09+03:00
New Revision: dda8e3de35ead65498094e75adf6f6efd2641323
URL:
https://github.com/llvm/llvm-project/commit/dda8e3de35ead65498094e75adf6f6efd2641323
DIFF:
https://github.com/Endilll updated
https://github.com/llvm/llvm-project/pull/71322
>From 40d25b8009f1c8734a99fd1350adaced6884cc7f Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Sun, 5 Nov 2023 18:53:48 +0300
Subject: [PATCH 1/3] [clang][NFC] Refacator `CXXNewExpr::InitializationStyle`
https://github.com/Endilll updated
https://github.com/llvm/llvm-project/pull/71322
>From 40d25b8009f1c8734a99fd1350adaced6884cc7f Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Sun, 5 Nov 2023 18:53:48 +0300
Subject: [PATCH 1/5] [clang][NFC] Refacator `CXXNewExpr::InitializationStyle`
@@ -2008,22 +2008,23 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool
UseGlobal,
SourceRange TypeRange = AllocTypeInfo->getTypeLoc().getSourceRange();
SourceLocation StartLoc = Range.getBegin();
- CXXNewExpr::InitializationStyle initStyle;
+
Author: Vlad Serebrennikov
Date: 2023-11-06T14:18:26+03:00
New Revision: b178cec84f95210db615cfa0a84e78585445f16b
URL:
https://github.com/llvm/llvm-project/commit/b178cec84f95210db615cfa0a84e78585445f16b
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T13:38:12+03:00
New Revision: 1a0e743ab01716ecafeb33858d9975cf90017c59
URL:
https://github.com/llvm/llvm-project/commit/1a0e743ab01716ecafeb33858d9975cf90017c59
DIFF:
@@ -2034,18 +2035,19 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool
UseGlobal,
// - If the new-initializer is omitted, the object is default-
// initialized (8.5); if no initialization is performed,
// the object has indeterminate
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/71395
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/71395
Reverts llvm/llvm-project#71322
>From 40921a217a4bda5ce739561606a4e16677ee48f5 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Mon, 6 Nov 2023 17:53:21 +0400
Subject: [PATCH] Revert "[clang][NFC]
https://github.com/Endilll ready_for_review
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
https://github.com/Endilll closed
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
Endilll wrote:
I've seen those exact test failures locally, but since precommit CI was fine, I
landed this PR and kept a close eye on the bots.
Me and Aaron are also wondering now how did it pass CI, and what's wrong with
changes here.
I'm sorry @zmodem that we got you involved.
> It catches
Author: Vlad Serebrennikov
Date: 2023-11-06T22:39:26+03:00
New Revision: 565e21b3e079e53c4fcf47d2ec898dbc248fbd3a
URL:
https://github.com/llvm/llvm-project/commit/565e21b3e079e53c4fcf47d2ec898dbc248fbd3a
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T22:55:51+03:00
New Revision: f2d8a0ac1dd1fe55b2c3b358c525fbc01b0121ed
URL:
https://github.com/llvm/llvm-project/commit/f2d8a0ac1dd1fe55b2c3b358c525fbc01b0121ed
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T23:08:39+03:00
New Revision: 088932d8ef1f80ba9e1349ce7cda95accd2f745e
URL:
https://github.com/llvm/llvm-project/commit/088932d8ef1f80ba9e1349ce7cda95accd2f745e
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T23:27:13+03:00
New Revision: b6f2597a45f426f3a276c1c59f7ff5521b6dcc89
URL:
https://github.com/llvm/llvm-project/commit/b6f2597a45f426f3a276c1c59f7ff5521b6dcc89
DIFF:
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/71417
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.
This is a re-land of
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/71417
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Vlad Serebrennikov
Date: 2023-11-04T13:28:29+03:00
New Revision: cd6022916bff1d6fab007b554810b631549ba43c
URL:
https://github.com/llvm/llvm-project/commit/cd6022916bff1d6fab007b554810b631549ba43c
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-04T12:43:26+03:00
New Revision: 99e7e7a597fa4ebaa8ebacdc42eae9f0b976f54c
URL:
https://github.com/llvm/llvm-project/commit/99e7e7a597fa4ebaa8ebacdc42eae9f0b976f54c
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T21:02:14+03:00
New Revision: 7ec8a6fd31d8ddb161b06067fb6b7f9026a460df
URL:
https://github.com/llvm/llvm-project/commit/7ec8a6fd31d8ddb161b06067fb6b7f9026a460df
DIFF:
Author: Vlad Serebrennikov
Date: 2023-11-06T22:17:03+03:00
New Revision: 60f7fa123d77ecf8e138be35ad8880622586fa03
URL:
https://github.com/llvm/llvm-project/commit/60f7fa123d77ecf8e138be35ad8880622586fa03
DIFF:
Endilll wrote:
> Why doesn't this result in any changes to tests? I would expect having to
> remove them, right?
There was a single test that was relying on sign mismatch, and then during code
review we made the diagnostic to ignore signness. So it ended up merged without
test case where
@@ -809,43 +927,42 @@ class Selector {
enum IdentifierInfoFlag {
// Empty selector = 0. Note that these enumeration values must
// correspond to the enumeration values of DeclarationName::StoredNameKind
-ZeroArg = 0x01,
-OneArg = 0x02,
+ZeroArg = 0x01,
@@ -809,43 +927,42 @@ class Selector {
enum IdentifierInfoFlag {
// Empty selector = 0. Note that these enumeration values must
// correspond to the enumeration values of DeclarationName::StoredNameKind
-ZeroArg = 0x01,
-OneArg = 0x02,
+ZeroArg = 0x01,
https://github.com/Endilll closed
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
Endilll wrote:
@erichkeane I guess you'd be pretty happy if our enums were declared the
following way:
```cpp
enum E : unsigned _BitInt(4) {
e0 = 16,
};
```
Then you'd be warned on the spot if you have more values than bits can hold,
and bit-fields side check would be trivial to implement:
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/67996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
> None of the implementations seem to agree with the resolution of the DR:
> https://godbolt.org/z/a7nEvW5Gr
It's definitely not the first time CWG goes against every major implementation
with their DR resolution.
https://github.com/llvm/llvm-project/pull/67948
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/67931
Related: #63416
>From 4720a0f6bce7b1531dec2005d642938db1370335 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Sun, 1 Oct 2023 21:28:21 +0300
Subject: [PATCH] [clang] Add test for CWG2267
---
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/67948
https://cplusplus.github.io/CWG/issues/472.html
It has drafting status, but I think CWG has reached consesus on the behavior.
>From ad0df2131e12c59e57b603b955626e27e3067505 Mon Sep 17 00:00:00 2001
From: Vlad
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/67931
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/67948
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll unassigned
https://github.com/llvm/llvm-project/pull/67931
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7145,7 +7145,7 @@ C++ defect report implementation
status
https://cplusplus.github.io/CWG/issues/1223.html;>1223
drafting
Syntactic disambiguation and trailing-return-types
-Not resolved
+Clang 17
Endilll wrote:
`make_cxx_dr_status`
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/67965
https://cplusplus.github.io/CWG/issues/1341.html
https://wg21.link/p0683r1
>From 92fec6fe49de0392596e7f7d4a1c5524dd436747 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Mon, 2 Oct 2023 13:17:40 +0300
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/67969
While working on #67965, I stumbled upon the fact that `make_cxx_dr_status`
script doesn't check for duplicated comment (last comment wins), so I added
this check.
It even found another instance of duplicated
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/67965
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
You have failed tests on Linux CI:
```
Failed Tests (4):
Clang :: Driver/mingw-sysroot.cpp
Clang :: Driver/no-canonical-prefixes.c
Clang :: Driver/program-path-priority.c
Clang :: Driver/rocm-detect.hip
```
Windows CI has another test in Clang interpreter failing, but that
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/67996
`make_cxx_dr_status` has a hardcoded number of the latest release, for the
puproses of determining whether a particular DR is available to users or not
yet. I'm bumping it to 17.
>From
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/67969
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/67996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/67996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/67931
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/68377
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/66636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll updated
https://github.com/llvm/llvm-project/pull/68377
>From 8503ff3e70e585a4a3597e3ee8111269f48105cc Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Thu, 5 Oct 2023 13:18:14 +0300
Subject: [PATCH 1/3] [clang] Align Type and ExtQuals on 16-byte boundary
---
@@ -1982,9 +1986,9 @@ class alignas(8) Type : public ExtQualsTypeCommonBase {
Type(TypeClass tc, QualType canon, TypeDependence Dependence)
: ExtQualsTypeCommonBase(this,
canon.isNull() ? QualType(this_(), 0) : canon) {
-
@@ -1507,6 +1508,9 @@ class ExtQuals : public ExtQualsTypeCommonBase, public
llvm::FoldingSetNode {
: ExtQualsTypeCommonBase(baseType,
canon.isNull() ? QualType(this_(), 0) : canon),
Quals(quals) {
+
Endilll wrote:
My plan is to phase-out `TypeAlignment` in subsequent patches, because we have
proper language support for `alignas` and `alignof` now. It's the only one of
its kind passed to `Allocate()` (I inspected all references to this function).
CC @zygolod as the author of
https://github.com/Endilll updated
https://github.com/llvm/llvm-project/pull/68382
>From d987a8523086ab8b6d49f395429afda75769a731 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Fri, 6 Oct 2023 07:20:07 +0300
Subject: [PATCH 1/2] [clang][NFC] Add missing placement-new after Allocate()
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/68382
While working on #68377 inspecting `Allocate()` calls, I found out that there
are couple of places where we forget to use placement-new to create objects in
the allocated memory.
>From
@@ -1982,9 +1986,9 @@ class alignas(8) Type : public ExtQualsTypeCommonBase {
Type(TypeClass tc, QualType canon, TypeDependence Dependence)
: ExtQualsTypeCommonBase(this,
canon.isNull() ? QualType(this_(), 0) : canon) {
-
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/68377
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Endilll wrote:
Relevant code snippets:
https://github.com/llvm/llvm-project/blob/777a6e6f10b2b90496d248b7fa904fce834484be/clang/lib/AST/ASTContext.cpp#L5813C1-L5816C33
Endilll wrote:
CC @zygoloid as the author of ee0ce302c5eb4f26738f334f2fd8b165fa65dfca
https://github.com/llvm/llvm-project/pull/68377
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll updated
https://github.com/llvm/llvm-project/pull/68377
>From 8503ff3e70e585a4a3597e3ee8111269f48105cc Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov
Date: Thu, 5 Oct 2023 13:18:14 +0300
Subject: [PATCH 1/2] [clang] Align Type and ExtQuals on 16-byte boundary
---
https://github.com/Endilll created
https://github.com/llvm/llvm-project/pull/68377
While working on LLDB visualizer for `QualType`, I stumbled upon `Type` and
`ExtQuals` defined with `alignas(8)`. Such alignment leaves only 3 lower bits
available for pointer tagging, whereas `QualType`
@@ -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(),
@@ -0,0 +1,14 @@
+// RUN: %clang -target x86_64-linux -g -S -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -verify -DMISMATCH %s
Endilll wrote:
Tests are split now. `const` case is now checked and working as expected
(qualifiers are ignored).
@@ -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(),
@@ -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(),
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/5] [clang] Add clang::debug_info_type attribute
---
@@ -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(),
@@ -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
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/4] [clang] Add clang::debug_info_type attribute
---
@@ -7219,6 +7219,18 @@ its underlying representation to be a WebAssembly
``funcref``.
}];
}
+def DebugInfoTypeDocumentation : Documentation {
+ let Category = DocCatField;
+ let Content = [{
+This attribute allows to alter type of a bitfield in debug information.
+Such a
@@ -107,6 +107,10 @@ def NonBitField : SubsetSubjectisBitField()}],
"non-bit-field non-static data members">;
+def BitField : SubsetSubjectisBitField()}],
+ "bit-field non-static data members">;
@@ -3153,6 +3153,8 @@ 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
@@ -7219,6 +7219,18 @@ its underlying representation to be a WebAssembly
``funcref``.
}];
}
+def DebugInfoTypeDocumentation : Documentation {
+ let Category = DocCatField;
+ let Content = [{
+This attribute allows to alter type of a bitfield in debug information.
+Such a
@@ -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(),
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
@@ -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(),
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,
@@ -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(),
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
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
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
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
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
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 {
101 - 200 of 1428 matches
Mail list logo