HazardyKnusperkeks wrote:
I still think Google should have to say what their style in clang-format is,
extending to the default values of `AttributeMacros`.
I also wouldn't have such a big issue with adding it to the base style, because
of the prefix and I think it's nice that Boost or Qt most
jvoung wrote:
Thank you Owen for the review and helping merge, and thank you all for helping
arrive at a solution!
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `arc-builder` running on
`arc-worker` while building `clang` at step 6
"test-build-unified-tree-check-all".
Full details are available at:
https://lab.llvm.org/buildbot/#/builders/3/builds/13089
Here is the relevant piece of
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/130346
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH 1/9] [clang-format] Add support for absl nullability macros
---
clang
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
https://github.com/jvoung updated
https://github.com/llvm/llvm-project/pull/130346
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH 1/7] [clang-format] Add support for absl nullability macros
---
clang
https://github.com/jvoung updated
https://github.com/llvm/llvm-project/pull/130346
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH 1/8] [clang-format] Add support for absl nullability macros
---
clang
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
@@ -3185,6 +3185,53 @@ TEST_F(TokenAnnotatorTest, UnderstandsAttributes) {
EXPECT_TOKEN(Tokens[5], tok::r_paren, TT_AttributeRParen);
}
+TEST_F(TokenAnnotatorTest, UnderstandsNullabilityAttributes) {
+ auto Tokens = annotate("x = (foo *_Nullable)*v;");
+ ASSERT_EQ(Tokens.s
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
Loods good otherwise.
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12720,6 +12735,21 @@ TEST_F(FormatTest, UnderstandsPointerQualifiersInCast)
{
verifyFormat(("x = (foo *" + AllQualifiers + " __my_qualifier)&v;").str(),
CustomQualifier);
+ // Check additional attribute macros in Google style:
+ FormatStyle LongPointerR
@@ -12518,6 +12521,10 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyIndependentOfContext("MACRO(A *_Nonnull a);");
verifyIndependentOfContext("MACRO(A *_Nullable a);");
verifyIndependentOfContext("MACRO(A *_Null_unspecified a);");
+ verifyIndependentOfContex
@@ -909,6 +909,12 @@ TEST(ConfigParseTest, ParsesConfiguration) {
Style.AttributeMacros.clear();
CHECK_PARSE("BasedOnStyle: LLVM", AttributeMacros,
std::vector{"__capability"});
+ Style.AttributeMacros.clear();
jvoung wrote:
Ok, done!
https
https://github.com/jvoung edited
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jvoung commented:
Thanks for the review!
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jvoung updated
https://github.com/llvm/llvm-project/pull/130346
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH 1/6] [clang-format] Add support for absl nullability macros
---
clang
owenca wrote:
I wish they had not been added to the default but can't take them off the lists
for backward compatibility. I don't think we should add more. The reason is
that people wouldn't be able to turn off the special meaning if they wanted to
use e.g. `absl_nonnull` as a regular identifi
https://github.com/jvoung updated
https://github.com/llvm/llvm-project/pull/130346
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH 1/4] [clang-format] Add support for absl nullability macros
---
clang
ilya-biryukov wrote:
Google C++ Style Guide and Abseil go hand-in-hand from Google's perspective. We
are the stewards of both and we would prefer to keep the two in sync. We have
opted to have the Google Style available as builtin in `clang-format` and have
been sticking to that decision until
mydeveloperday wrote:
> The only problem I see is how clang-format parses those lists from yaml. I
> think there is no possibility to choose between adding or overwriting, if you
> put `AttributeMacros` in your `.clang-format`, but it just overwrites the
> values.
if they can be overridden!,
ilya-biryukov wrote:
>From the Google's perspective, we are happy with any change that makes those
>macros available in `-style=google`.
It seems that either of the options gives us that, so up to the rest of the
folks in the thread.
https://github.com/llvm/llvm-project/pull/130346
__
owenca wrote:
> > I wish they had not been added to the default but can't take them off the
> > lists for backward compatibility. I don't think we should add more. The
> > reason is that people wouldn't be able to turn off the special meaning if
> > they wanted to use e.g. `absl_nonnull` as a
jvoung wrote:
> I wish they had not been added to the default but can't take them off the
> lists for backward compatibility. I don't think we should add more. The
> reason is that people wouldn't be able to turn off the special meaning if
> they wanted to use e.g. `absl_nonnull` as a regular
ilya-biryukov wrote:
(please note the update comment above, I did not read the change history and
didn't realize the original patch was touching the common default style, not
Google's style)
https://github.com/llvm/llvm-project/pull/130346
___
cfe-co
mydeveloperday wrote:
Imagine if we did this for every "toolkit"... we'd be inundated with add
this/that etc... why can't people who use Abseil not add them to their
.clang-format? Outside of google are that many people even using Abseil?
Abseil itself doesn't even define them in their .clang
jvoung wrote:
It would be nice to to avoid having each project configure via
`AttributeMacros`.
The Abseil macro is meant to be a portable way to use the Clang-specific
nullability attributes like `_Nonnull` (portable in that it will be empty for
non-Clang compilers). So one would expect it t
https://github.com/owenca requested changes to this pull request.
Why should we add those macros to the default list? Can't you use the
[`AttributeMacros`](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#attributemacros)
option instead?
https://github.com/llvm/llvm-project/pull/13034
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: Jan Voung (jvoung)
Changes
Add support for formatting w/ absl nullability macros
(https://github.com/abseil/abseil-cpp/blob/c52afac4f87ef76e6293b84874e5126a62be1f15/absl/base/nullability.h#L237).
Example at https://godbolt.org/z/PYv
https://github.com/jvoung ready_for_review
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jvoung edited
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jvoung edited
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jvoung edited
https://github.com/llvm/llvm-project/pull/130346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jvoung created
https://github.com/llvm/llvm-project/pull/130346
None
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH] [clang-format] Add support for absl nullability macros
---
cla
https://github.com/jvoung updated
https://github.com/llvm/llvm-project/pull/130346
>From 10df1857532a6a27b0e5286e10c9f0724d6d7e1d Mon Sep 17 00:00:00 2001
From: Jan Voung
Date: Fri, 7 Mar 2025 21:02:16 +
Subject: [PATCH 1/2] [clang-format] Add support for absl nullability macros
---
clang
44 matches
Mail list logo