[clang] [clang-format] Allow ternary in all templates (PR #96801)

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

[clang] [clang-format] Allow ternary in all templates (PR #96801)

2024-06-26 Thread Emilia Kond via cfe-commits
rymiel wrote: I'm not even sure if this change is a good idea! I think it's very likely it will lead to regressions, for we don't have tests for such cases yet, it seems https://github.com/llvm/llvm-project/pull/96801 ___ cfe-commits mailing list

[clang] [clang-format] Allow ternary in all templates (PR #96801)

2024-06-26 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/96801 Currently, question mark and colon tokens are not allowed between angle brackets, as a template argument, if we are in an expression context. However, expressions can still allowed in non-expression contexts,

[clang] [clang-format] Don't count template template parameter as declaration (PR #96396)

2024-06-24 Thread Emilia Kond via cfe-commits
rymiel wrote: Isn't fixing bugs meant to change defaults? See #61732, #48746 and #93793. The old version is confusing since it looks like a separate template parameter when it isn't. https://github.com/llvm/llvm-project/pull/96396 ___ cfe-commits

[clang] [clang-format] Don't count template template parameter as declaration (PR #96396)

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

[clang] [clang-format] Don't count template template parameter as declaration (PR #96396)

2024-06-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/96396 Reapply 4a7bf42a9b83144db8a11ac06cce4da21166e6a2 which was reverted in 34d44eb41dfbbbf01712719558b02763334fbeb3 Not sure why there are tests elsewhere in clang that rely on the output of clang-format, but they

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

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

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-22 Thread Emilia Kond via cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser { if (CurrentToken && CurrentToken->is(tok::less)) { CurrentToken->setType(TT_TemplateOpener); next(); - if (!parseAngle()) + TemplateDeclarationDepth++; + if (!parseAngle()) { +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/95025 >From 6fc09d022a0e4e395a1b8e17166641dffc7c12eb Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Mon, 10 Jun 2024 22:17:29 +0300 Subject: [PATCH 1/5] [clang-format] Don't count template template parameter as

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-12 Thread Emilia Kond via cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser { if (CurrentToken && CurrentToken->is(tok::less)) { CurrentToken->setType(TT_TemplateOpener); next(); - if (!parseAngle()) + TemplateDeclarationDepth++; + if (!parseAngle()) { +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-12 Thread Emilia Kond via cfe-commits
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest, UnderstandsNonTemplateAngleBrackets) { EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator); } +TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) { + auto Tokens = annotate("template typename X,\n" +

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-12 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/95025 >From 6fc09d022a0e4e395a1b8e17166641dffc7c12eb Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Mon, 10 Jun 2024 22:17:29 +0300 Subject: [PATCH 1/4] [clang-format] Don't count template template parameter as

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/95025 >From 6fc09d022a0e4e395a1b8e17166641dffc7c12eb Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Mon, 10 Jun 2024 22:17:29 +0300 Subject: [PATCH 1/3] [clang-format] Don't count template template parameter as

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/95025 >From 6fc09d022a0e4e395a1b8e17166641dffc7c12eb Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Mon, 10 Jun 2024 22:17:29 +0300 Subject: [PATCH 1/2] [clang-format] Don't count template template parameter as

[clang] [clang-format] Fix a bug in annotating lambda l_square (PR #95084)

2024-06-11 Thread Emilia Kond via cfe-commits
@@ -1591,6 +1591,12 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) { EXPECT_TOKEN(Tokens[15], tok::arrow, TT_TrailingReturnArrow); EXPECT_TOKEN(Tokens[17], tok::l_brace, TT_LambdaLBrace); + Tokens = annotate("auto l = [] -> struct S { return {}; };");

[clang] [clang-format] Fix a bug in annotating lambda l_square (PR #95084)

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

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

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

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-10 Thread Emilia Kond via cfe-commits
rymiel wrote: Note: I understand my solution of adding a member variable is inelegant, I am of course open to ways on making it better https://github.com/llvm/llvm-project/pull/95025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-10 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/95025 In ContinuationIndenter::mustBreak, a break is required between a template declaration and the function/class declaration it applies to, if the template declaration spans multiple lines. However, this also

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

2024-06-09 Thread Emilia Kond via cfe-commits
rymiel wrote: Technically also applies to attributes applied to the return type of the lambda, i.e. ``` int main() { very_long_function_name_yes_it_is_really_long( // also happens with constexpr specifier [](auto n) [[attribute]] -> std::enable_if_t<

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

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

[clang] [clang-format] Correctly annotate C++ alternative operators in C (PR #92880)

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

[clang] [clang-format] Handle Java switch expressions (PR #91112)

2024-05-06 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. Also works well for pattern matching ```java switch (obj) { case String s when !s.isEmpty() -> 0; default -> 1; } ``` and upcoming destructuring ```java switch (n) { case IntExpr(int i) -> i; case

[clang] [clang-format] Don't allow comma in front of structural enum (PR #91056)

2024-05-05 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/91056 ___ 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 comma in front of structural enum (PR #91056)

2024-05-04 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/91056 Assume that a comma in front of `enum` means it is actually a part of an elaborated type in a template parameter list. Fixes https://github.com/llvm/llvm-project/issues/47782 >From

[clang] [clang-format] Don't remove parentheses of fold expressions (PR #91045)

2024-05-04 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. I can definitely think of cases where an expression might contain `...` and still have redundant parentheses, i.e. if the ellipsis isn't part of a fold expression For example: ```c++ template std::tuple foo() { return (std::tuple{});

[clang] [Clang Format] Fixing erroneous statements in tests; nsc (PR #88628)

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

[clang] [clang-format][NFC] Enable RemoveSemicolon for clang-format style (PR #82735)

2024-02-23 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. https://github.com/llvm/llvm-project/pull/82735 ___ 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-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel closed https://github.com/llvm/llvm-project/pull/82349 ___ 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-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/82349 >From 25ca98534f0d5dbd96ff74c802528171787ced45 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Tue, 20 Feb 2024 14:11:33 +0200 Subject: [PATCH 1/4] [clang-format] Fix crash in TokenAnnotator The while loop on

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

2024-02-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/82349 >From 25ca98534f0d5dbd96ff74c802528171787ced45 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Tue, 20 Feb 2024 14:11:33 +0200 Subject: [PATCH 1/3] [clang-format] Fix crash in TokenAnnotator The while loop on

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

2024-02-22 Thread Emilia Kond via cfe-commits
https://github.com/rymiel updated https://github.com/llvm/llvm-project/pull/82349 >From 25ca98534f0d5dbd96ff74c802528171787ced45 Mon Sep 17 00:00:00 2001 From: Emilia Kond Date: Tue, 20 Feb 2024 14:11:33 +0200 Subject: [PATCH 1/2] [clang-format] Fix crash in TokenAnnotator The while loop on

[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] 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] 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] 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] 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-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] [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] 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] 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] 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-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] 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
https://github.com/rymiel ready_for_review 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] Allow decltype in requires clause (PR #78847)

2024-01-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel converted_to_draft 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-01-20 Thread Emilia Kond via cfe-commits
rymiel wrote: clang-format does not support that extension in the first place, there's an open issue for it. But I will try a few edge cases to see if it changes anything or if it was already broken https://github.com/llvm/llvm-project/pull/78852

[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 created https://github.com/llvm/llvm-project/pull/78852 Simply always return false if tok::ampamp is passed into determineUnaryOperatorByUsage. I've done a fix earlier regarding ampamp becoming an unary operator, this would technically supersede that. I'm not sure

[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

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

2024-01-20 Thread Emilia Kond via cfe-commits
https://github.com/rymiel created https://github.com/llvm/llvm-project/pull/78847 If clang-format is not sure whether a `requires` keyword starts a requires clause or a requires expression, it looks ahead to see if any token disqualifies it from being a requires clause. Among these tokens was

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

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

[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] 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] 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] 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
@@ -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] 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] 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] 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
@@ -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
@@ -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
@@ -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
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
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] 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] 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] 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-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 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] Correctly annotate braces of empty functions (PR #72733)

2023-11-19 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. wow! https://github.com/llvm/llvm-project/pull/72733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix crashes in AlignArrayOfStructures (PR #72520)

2023-11-17 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. Thanks for doing this! There were probably dozens of duplicates of this same crash across multiple years, so this is great https://github.com/llvm/llvm-project/pull/72520 ___ cfe-commits mailing

[clang] [clang-format] Handle constrained auto in QualifierAlignment (PR #72251)

2023-11-14 Thread Emilia Kond via cfe-commits
https://github.com/rymiel approved this pull request. A hooray for getting rid of invalid-code-generation https://github.com/llvm/llvm-project/pull/72251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

  1   2   >