[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-05 Thread Emilia Kond via cfe-commits
https://github.com/rymiel labeled https://github.com/llvm/llvm-project/pull/65409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-05 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/65409: When encountering braces, such as those of a designated initializer, clang-format scans ahead to see what is contained within the braces. If it found a statement, like an if-statement of for-loop, it would deem

[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-05 Thread Emilia Kond via cfe-commits
https://github.com/rymiel review_requested https://github.com/llvm/llvm-project/pull/65409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel review_requested https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/65908: clang-format uses a heuristic to determine if a requires() is either a requires clause or requires expression, based on what is in the parentheses. Part of this heuristic assumed that a requires clause can

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel resolved https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel resolved https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/65908: >From 0cfeaee5ec5c431bc15fb037f2a20c944c508c2a Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Sun, 10 Sep 2023 23:01:39 +0300 Subject: [PATCH 1/2] [clang-format] Fix requires misannotation with comma

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel resolved https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Emilia Kond via cfe-commits
@@ -3369,9 +3369,13 @@ bool clang::format::UnwrappedLineParser::parseRequires() { case tok::kw_volatile: case tok::kw_const: case tok::comma: - FormatTok = Tokens->setPosition(StoredPosition); - parseRequiresExpression(RequiresToken); - return

[clang] [clang-format] Fix a bug in annotating `&&` enclosed in `<` and `>` (PR #65933)

2023-09-11 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. I'm also suspicious of if a dereference like `*j` should ever be legal in a template argument, but that would be a different case https://github.com/llvm/llvm-project/pull/65933 ___ cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/65908 >From 0cfeaee5ec5c431bc15fb037f2a20c944c508c2a Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Sun, 10 Sep 2023 23:01:39 +0300 Subject: [PATCH 1/3] [clang-format] Fix requires misannotation with comma

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel resolved https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel resolved https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel resolved https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Clean up signatures of some parser functions (PR #66569)

2023-09-16 Thread Emilia Kond via cfe-commits
@@ -370,9 +364,9 @@ bool UnwrappedLineParser::parseLevel(const FormatToken *OpeningBrace, else if (FormatTok->getType() == TT_MacroBlockEnd) kind = tok::r_brace; -auto ParseDefault = [this, OpeningBrace, NextLevelLBracesType, IfKind, +auto ParseDefault =

[clang] [clang-format][NFC] Clean up signatures of some parser functions (PR #66569)

2023-09-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/66569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-07 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/65409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-07 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/65409: >From e15868400981600b7dc68229660391a7874e67af Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Tue, 5 Sep 2023 22:44:41 +0300 Subject: [PATCH 1/2] [clang-format] Correctly annotate designated initializer with

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-08 Thread Emilia Kond via cfe-commits
https://github.com/rymiel edited https://github.com/llvm/llvm-project/pull/65808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-08 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/65808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-08 Thread Emilia Kond via cfe-commits
@@ -593,6 +593,47 @@ struct FormatStyle { /// \version 3.3 bool AllowAllParametersOfDeclarationOnNextLine; + /// Different ways to break before a noexcept specifier. + enum BreakBeforeNoexceptSpecifierStyle : int8_t { +/// No line break allowed. +/// \code +

[clang] Extension: allow recursive macros (PR #65851)

2023-09-09 Thread Emilia Kond via cfe-commits
rymiel wrote: How would you deal with the issue of infinite loops? The following program: ```cpp #define2 boom(X) boom(X) boom(0) ``` Will continue to infinitely(?) consume memory until it is killed, either by the user or due to running out of memory on the system

[clang] [clang-format] Fix broken dump_format_help.py and sync the RST file (PR #65429)

2023-09-06 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/65429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

2023-10-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/69052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-19 Thread Emilia Kond via cfe-commits
@@ -491,11 +491,19 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); do { -// Get next non-comment token. -FormatToken *NextTok; -do { - NextTok = Tokens->getNextToken(); -

[clang] [clang-format][NFC] Delete TT_LambdaArrow (PR #70519)

2023-10-27 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. Surprised this works! https://github.com/llvm/llvm-project/pull/70519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Emilia Kond via cfe-commits
@@ -4648,6 +4648,10 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Ignore formatting in preprocessor definitions. + /// \version 18 + bool IgnorePPDefinitions; rymiel wrote: (this applies to not just here, but

[clang] [clang-format] Option to ignore PP directives (PR #70338)

2023-10-27 Thread Emilia Kond via cfe-commits
rymiel wrote: https://github.com/llvm/llvm-project/pull/67911 is a pull request, not an issue, i'm not sure what you're referring to https://github.com/llvm/llvm-project/pull/70338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-11-02 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/69473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-11-02 Thread Emilia Kond via cfe-commits
rymiel wrote: Thank you for reminding me, I may have forgotten this was here! https://github.com/llvm/llvm-project/pull/69473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-23 Thread Emilia Kond via cfe-commits
rymiel wrote: I didn't expect you to not want to be credited, but I'll respect your opinion! GitHub adds co-ownership automatically if using the web ui to commit a suggestion (which is what happened in that other PR you pinged me in), but in this case I did add it manually :)

[clang] [clang-format] Don't align ctors and dtors with other functions (PR #67618)

2023-09-28 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/67618 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate keyword operator function name (PR #66904)

2023-09-27 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/66904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-27 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (PR #67955)

2023-10-03 Thread Emilia Kond via cfe-commits
rymiel wrote: https://buildkite.com/llvm-project/clang-ci/builds/4275#018af20e-3d3c-4344-b92d-88ac8b09b484 Tests do not pass? https://github.com/llvm/llvm-project/pull/67955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-18 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/69473 Pull request #65409 changed the brace kind heuristic to not treat a preprocessor if directive as a in statement, however, this caused some regressions. If the contents of a brace don't immediately determine the

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-18 Thread Emilia Kond via cfe-commits
rymiel wrote: Here's my solution to the regression I caused (https://github.com/llvm/llvm-project/issues/68404), but I don't think it's a particularly nice solution let me know what I should change (there's some code duplication that should probably be extracted out)

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/69473 >From 1e4e878d251b44aa68fb8bc6422a9ec4e3de4e12 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Wed, 18 Oct 2023 18:03:32 +0300 Subject: [PATCH 1/2] [clang-format] Skip PP directives when determining brace kind

[clang] [clang-format] Skip PP directives when determining brace kind (PR #69473)

2023-10-20 Thread Emilia Kond via cfe-commits
@@ -491,11 +491,19 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { SmallVector LBraceStack; assert(Tok->is(tok::l_brace)); do { -// Get next non-comment token. -FormatToken *NextTok; -do { - NextTok = Tokens->getNextToken(); -

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Emilia Kond via cfe-commits
rymiel wrote: > I don't want to "advertise" this new style in the documentation but am > willing to be overruled by the majority. But you added it to the help text? (I'm fine with this being undocumented) https://github.com/llvm/llvm-project/pull/69814

[clang] [clang-format] Add a new style for the clang-format source code (PR #69814)

2023-10-21 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/69814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't break between string literal operands of << (PR #69871)

2023-10-22 Thread Emilia Kond via cfe-commits
@@ -5118,10 +5118,6 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine , return true; if (Left.IsUnterminatedLiteral) return true; - if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) && rymiel wrote:

[clang] [clang-format] Don't alter SpacesRequiredBefore of finalized tokens (PR #69897)

2023-10-23 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. Thank you so much! https://github.com/llvm/llvm-project/pull/69897 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

2023-10-14 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/69052 Previously, upon encountering an equals sign while parsing a lambda in the UnwrappedLineParser, it would fall through and fail. This caused any lambda template with a default argument for a template parameter to

[clang] [clang-format] Allow default values for template parameters in lambda (PR #69052)

2023-10-16 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/69052 >From 4f532ab0ae47bce011043f41cfac3ad3e601dd41 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Sat, 14 Oct 2023 16:52:31 +0300 Subject: [PATCH 1/2] [clang-format] Allow default values for template parameters in

[clang] [clang-format] Handle variable declarations in BreakAfterAttributes (PR #71755)

2023-11-08 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. However this doesn't address the second part of the linked issue (with the `if`) does it? https://github.com/llvm/llvm-project/pull/71755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 7a38b3b - [clang-format] Respect ColumnLimit 0 line breaks in inline asm

2023-06-23 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2023-06-23T17:30:24+03:00 New Revision: 7a38b3bfeb5623fb970a03ed9f295288802f4506 URL: https://github.com/llvm/llvm-project/commit/7a38b3bfeb5623fb970a03ed9f295288802f4506 DIFF: https://github.com/llvm/llvm-project/commit/7a38b3bfeb5623fb970a03ed9f295288802f4506.diff

[clang] 6e39b0d - [clang-format][NFC] Use correct test method for new tests

2023-06-26 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2023-06-26T12:27:57+03:00 New Revision: 6e39b0ddf08ab5cd44fed2d16e9669d64aa733ef URL: https://github.com/llvm/llvm-project/commit/6e39b0ddf08ab5cd44fed2d16e9669d64aa733ef DIFF: https://github.com/llvm/llvm-project/commit/6e39b0ddf08ab5cd44fed2d16e9669d64aa733ef.diff

[clang] 15e14f1 - [clang-format] Preserve AmpAmpTokenType in nested parentheses

2023-06-26 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2023-06-26T12:39:16+03:00 New Revision: 15e14f129fe24db989ed91737e96505863e20c60 URL: https://github.com/llvm/llvm-project/commit/15e14f129fe24db989ed91737e96505863e20c60 DIFF: https://github.com/llvm/llvm-project/commit/15e14f129fe24db989ed91737e96505863e20c60.diff

[clang] 4986f3f - [clang-format] Correctly annotate operator free function call

2023-06-29 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2023-06-29T19:51:27+03:00 New Revision: 4986f3f2f220e4fd2fef4b08e550b399c9f45a9f URL: https://github.com/llvm/llvm-project/commit/4986f3f2f220e4fd2fef4b08e550b399c9f45a9f DIFF: https://github.com/llvm/llvm-project/commit/4986f3f2f220e4fd2fef4b08e550b399c9f45a9f.diff

[clang] e4d3e88 - [clang-format] Don't allow template to be preceded by closing brace

2023-05-16 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2023-05-17T01:37:19+03:00 New Revision: e4d3e88802390a51ae62ade18e48c1a65a862d12 URL: https://github.com/llvm/llvm-project/commit/e4d3e88802390a51ae62ade18e48c1a65a862d12 DIFF: https://github.com/llvm/llvm-project/commit/e4d3e88802390a51ae62ade18e48c1a65a862d12.diff

[clang] 06763ea - [clang-format] Ignore first token when finding MustBreak

2023-05-17 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2023-05-18T05:50:26+03:00 New Revision: 06763ea5d8f96625545bb2c2445363aca9922bf1 URL: https://github.com/llvm/llvm-project/commit/06763ea5d8f96625545bb2c2445363aca9922bf1 DIFF: https://github.com/llvm/llvm-project/commit/06763ea5d8f96625545bb2c2445363aca9922bf1.diff

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void

[clang] [clang-format] NEVER allow && to be an unary operator. (PR #78852)

2024-01-21 Thread Emilia Kond via cfe-commits
rymiel wrote: https://github.com/llvm/llvm-project/issues/61233 The ambiguities this syntax extension can bring are pretty much impossible or at least very hard to always handle, but I'll try to avoid breaking things which weren't already broken.

[clang] [clang-format] NEVER allow && to be an unary operator. (PR #78852)

2024-01-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel converted_to_draft https://github.com/llvm/llvm-project/pull/78852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); ASSERT_EQ(Tokens.size(), 19u) << Tokens; EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator); + + Tokens = annotate("void

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Emilia Kond via cfe-commits
https://github.com/rymiel edited https://github.com/llvm/llvm-project/pull/78847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] NEVER allow && to be an unary operator. (PR #78852)

2024-02-10 Thread Emilia Kond via cfe-commits
rymiel wrote: I'm sorry, I do not have the time for this right now, and I'd rather not leave this open for no reason https://github.com/llvm/llvm-project/pull/78852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] NEVER allow && to be an unary operator. (PR #78852)

2024-02-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/78852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix crash in TokenAnnotator (PR #82349)

2024-02-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/82349 The while loop on line 3814 can cause a segmentation fault getting the Next field on a nullptr. This is because further down, on line 3823, there is another for loop, which assigns Tok to Tok->Next in its

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
@@ -40,6 +40,13 @@ class FormatTestTableGen : public ::testing::Test { EXPECT_EQ(Code.str(), format(Code)) << "Expected code is not stable"; EXPECT_EQ(Code.str(), format(test::messUp(Code))); } + + static void verifyFormat(llvm::StringRef Code, const FormatStyle ) {

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
@@ -4753,6 +4793,13 @@ struct FormatStyle { AlignConsecutiveMacros == R.AlignConsecutiveMacros && AlignConsecutiveShortCaseStatements == R.AlignConsecutiveShortCaseStatements && + AlignConsecutiveTableGenCondOperatorColons == +

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
@@ -1124,6 +1130,20 @@ template <> struct MappingTraits { IO.mapOptional("StatementAttributeLikeMacros", Style.StatementAttributeLikeMacros); IO.mapOptional("StatementMacros", Style.StatementMacros); +

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
@@ -111,6 +111,9 @@ const tooling::Replacements ::generateReplacements() { alignConsecutiveDeclarations(); alignConsecutiveBitFields(); alignConsecutiveAssignments(); + alignConsecutiveTableGenCondOperatorColons(); + AlignConsecutiveTableGenBreakingDAGArgColons(); +

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel commented: Hi, this is quite a big patch. I had a very quick look and noticed a few nit-picky thingy, mostly about formatting or naming and whatnot, mostly minor things. However since I've never used tablegen, I'm not sure if I can actually review any of the logic in

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
@@ -111,6 +111,9 @@ const tooling::Replacements ::generateReplacements() { alignConsecutiveDeclarations(); alignConsecutiveBitFields(); alignConsecutiveAssignments(); + alignConsecutiveTableGenCondOperatorColons(); + AlignConsecutiveTableGenBreakingDAGArgColons();

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel edited https://github.com/llvm/llvm-project/pull/76059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
rymiel wrote: Your edits in Format.h won't show up in the documentation until after you've run the script in `clang/docs/tools/dump_format_style.py` https://github.com/llvm/llvm-project/pull/76059 ___ cfe-commits

[clang] [clang-format] Support of TableGen formatting. (PR #76059)

2023-12-22 Thread Emilia Kond via cfe-commits
@@ -272,6 +276,38 @@ void FormatTokenLexer::tryMergePreviousTokens() { return; } } + if (Style.isTableGen()) { +if (tryMergeTokens({tok::l_square, tok::l_brace}, + TT_TableGenMultiLineString)) { +

[clang] [clang-format] Add an fnmatch-like function for .clang-format-ignore (PR #76021)

2023-12-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. Are we going to use this specific implementation on all platforms for parity? The logic on its own looks good as far as I can tell, but, for example, POSIX Section 2.13 mentions that a leading period (hidden files) isn't matched by `*`. This

[clang] [clang-format] Add common attribute macros to Google style (PR #76239)

2023-12-22 Thread Emilia Kond via cfe-commits
rymiel wrote: Who should have the final say on the Google code style if not Google? https://github.com/llvm/llvm-project/pull/76239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't allow casts in front of ampamp (PR #77704)

2024-01-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/77704 clang-format performs a heuristic to see if a right parenthesis is the parenthesis of a cast expression. This check never looked ahead to see if the next token is an ampamp && token. This resulted in the paren

[clang] [clang-format] Don't confuse initializer equal signs in for loops (PR #77712)

2024-01-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/77712 clang-format has logic to align declarations of multiple variables of the same type, aligning them at the equals sign. This logic is applied in for loops as well. However, this alignment logic also erroneously

[llvm] [clang-tools-extra] [clang] [HLSL][Docs] Add documentation for HLSL functions (PR #75397)

2024-01-10 Thread Emilia Kond via cfe-commits
@@ -0,0 +1,321 @@ +=== +HLSL Function Calls +=== + +.. contents:: + :local: + +Introduction + + +This document describes the design and implementation of HLSL's function call +semantics in Clang. This includes details related to

[clang] [clang-format] Don't allow casts in front of ampamp (PR #77704)

2024-01-11 Thread Emilia Kond via cfe-commits
@@ -1066,6 +1066,11 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { EXPECT_EQ(Tokens.size(), 17u) << Tokens; EXPECT_TOKEN(Tokens[4], tok::amp, TT_PointerOrReference); EXPECT_TOKEN(Tokens[5], tok::kw_requires, TT_RequiresClause); + + Tokens =

[clang] [clang-format] Don't allow casts in front of ampamp (PR #77704)

2024-01-11 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/77704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [libcxx] [openmp] [llvm] [clang] [lldb] [lld] [mlir] [compiler-rt] [clang-format] SpacesInSquareBrackets not working for Java (PR #77833)

2024-01-11 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/77833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Support of TableGen identifiers beginning with a number. (PR #78571)

2024-01-18 Thread Emilia Kond via cfe-commits
@@ -804,6 +806,46 @@ void FormatTokenLexer::handleTableGenMultilineString() { FirstLineText, MultiLineString->OriginalColumn, Style.TabWidth, Encoding); } +void FormatTokenLexer::handleTableGenNumericLikeIdentifier() { + FormatToken *Tok = Tokens.back(); + //

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-08 Thread Emilia Kond via cfe-commits
@@ -3903,6 +3903,15 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) { parseParens(); } + auto IsTemplate = [&] { +FormatToken *Tok = InitialToken.Previous; +while (Tok) { + if (Tok->is(tok::kw_template)) +return true; + Tok =

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-08 Thread Emilia Kond via cfe-commits
https://github.com/rymiel edited https://github.com/llvm/llvm-project/pull/77013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

2024-01-08 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/77013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix crash involving array designators (PR #77045)

2024-01-09 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/77045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add PenaltyBreakScopeResolution option. (PR #78015)

2024-01-13 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/78015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/73886 PR #69473 introduced skipping PP directives when determining the brace kind of an lbrace. However, it did so by skipping to the end of the line when encountering a hash character. This means it also skipped to

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Emilia Kond via cfe-commits
@@ -1851,6 +1851,22 @@ TEST_F(TokenAnnotatorTest, UnderstandsTrailingReturnArrow) { EXPECT_TOKEN(Tokens[13], tok::arrow, TT_Unknown); } +TEST_F(TokenAnnotatorTest, UnderstandHashInMacro) { + auto Tokens = annotate("#define Foo(Bar) \\\n" + " {

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-29 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/73886 >From 95e2a2ee5d901d79430cb9b9468e1af8215b334f Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Thu, 30 Nov 2023 03:30:48 +0200 Subject: [PATCH 1/2] [clang-format] Don't skip stringizing when determining brace

[clang] [clang-format] Don't skip stringizing when determining brace kind (PR #73886)

2023-11-30 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/73886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-31 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/78847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a bug in ContinuationIndenter (PR #78921)

2024-01-21 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/78921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-21 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/78847 >From 79ebbdc60cfa0635c9d889823a8b37710d9a4fb5 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Sat, 20 Jan 2024 15:44:16 +0200 Subject: [PATCH 1/2] [clang-format] Allow decltype in requires clause If

[clang] [clang-format] Handles Elaborated type specifier for enum in trailing return (PR #80085)

2024-01-30 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. Thank you for the lightning fast fix! https://github.com/llvm/llvm-project/pull/80085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Don't confuse initializer equal signs in for loops (PR #77712)

2024-01-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/77712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-22 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); rymiel wrote: 88d1de5ec64210686d93a90529583505635d257d https://github.com/llvm/llvm-project/pull/78847

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/78847 >From 79ebbdc60cfa0635c9d889823a8b37710d9a4fb5 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Sat, 20 Jan 2024 15:44:16 +0200 Subject: [PATCH 1/3] [clang-format] Allow decltype in requires clause If

[clang] 88d1de5 - [clang-format][NFC] Unify token size tests to use ASSERT_EQ

2024-01-22 Thread Emilia Kond via cfe-commits
Author: Emilia Kond Date: 2024-01-22T14:53:47+02:00 New Revision: 88d1de5ec64210686d93a90529583505635d257d URL: https://github.com/llvm/llvm-project/commit/88d1de5ec64210686d93a90529583505635d257d DIFF: https://github.com/llvm/llvm-project/commit/88d1de5ec64210686d93a90529583505635d257d.diff

[clang] [clang-format] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Emilia Kond via cfe-commits
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { "concept C = (!Foo) && Bar;"); rymiel wrote: So, GitHub won't actually let me leave a comment on the line I want to actually talk about, but I

  1   2   >