hnakamura5 wrote:
> this is the default behavior of clang-format. And someone did intend it that
> way.
> If the change is desired, the BreakBeforeTernaryOperators option should be
> expanded to an enum or AlignOperands extended.
I agree. The current style has been default in this many years.
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/100860
Trying to fix https://github.com/llvm/llvm-project/issues/98559 .
This PR modifies the ad-hoc tweaks introduced by
https://reviews.llvm.org/D50078 .
The change is limited to the case `AlignOperands ` and
`B
https://github.com/hnakamura5 approved this pull request.
https://github.com/llvm/llvm-project/pull/99433
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnakamura5 wrote:
This change certainly fixes the issue, but also seems specific for the reported
code.
For example it does not work well for the case the line contains something else
as,
```
#define FN(N) void fn(void *addr) { a + f(addr, 0, N * two); }
```
This results the annotations where
@@ -26827,6 +26827,31 @@ TEST_F(FormatTest, BreakAdjacentStringLiterals) {
Style.BreakAdjacentStringLiterals = false;
verifyFormat(Code, Style);
}
+
+TEST_F(FormatTest, BreakAfterGNUAttributes) {
+ FormatStyle Style = getLLVMStyle();
+ Style.BreakAfterAttributes = FormatS
@@ -26827,6 +26827,31 @@ TEST_F(FormatTest, BreakAdjacentStringLiterals) {
Style.BreakAdjacentStringLiterals = false;
verifyFormat(Code, Style);
}
+
+TEST_F(FormatTest, BreakAfterGNUAttributes) {
+ FormatStyle Style = getLLVMStyle();
+ Style.BreakAfterAttributes = FormatS
https://github.com/hnakamura5 commented:
There are small suggestions on the format of test.
https://github.com/llvm/llvm-project/pull/78102
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
@@ -26827,6 +26827,31 @@ TEST_F(FormatTest, BreakAdjacentStringLiterals) {
Style.BreakAdjacentStringLiterals = false;
verifyFormat(Code, Style);
}
+
+TEST_F(FormatTest, BreakAfterGNUAttributes) {
+ FormatStyle Style = getLLVMStyle();
+ Style.BreakAfterAttributes = FormatS
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/78102
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 approved this pull request.
https://github.com/llvm/llvm-project/pull/92617
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1426,12 +1428,9 @@ class AnnotatingParser {
// the colon are passed as macro arguments.
Tok->setType(TT_ObjCMethodExpr);
} else if (Contexts.back().ContextKind == tok::l_paren &&
- !Line.InPragmaDirective) {
-if (Style.isTableGe
hnakamura5 wrote:
Thank you!
https://github.com/llvm/llvm-project/pull/87983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/87983
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/87983
Refactoring suggested here https://github.com/llvm/llvm-project/pull/87924 .
>From d55a0986ed175dbc18c073507691321a30952979 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Mon, 8 Apr 2024 21:20:04 +0900
Subje
hnakamura5 wrote:
Thank you!
https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -290,6 +290,16 @@ TEST_F(FormatTestTableGen, MultiClass) {
"}\n");
}
+TEST_F(FormatTestTableGen, MultiClassesWithPasteOperator) {
+ // This is a sensitive example for the handling of the paste operators in
+ // brace type calculation.
+ verifyFormat("multi
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/87924
The test I mentioned here https://github.com/llvm/llvm-project/pull/87450 .
This is a regression test to detect the case block type is not calculated due
to the paste `#` operator misunderstood as preprocessor
https://github.com/hnakamura5 closed
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
hnakamura5 wrote:
All the split parts of this PR is merged. Thank you!
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
hnakamura5 wrote:
@HazardyKnusperkeks
Thank you very much!
It took about 4 month with ten or more PRs for the parts of the first concept
of TableGen formatting.
You reviewed every time and gave me many valuable suggestions. I appreciate you
again and again!
https://github.com/llvm/llvm-proje
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/86150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnakamura5 wrote:
Alignment option for DAGArg: https://github.com/llvm/llvm-project/pull/86150
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-c
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/86150
This is the option to specify the style of alignment of the colons inside
TableGen's DAGArg.
>From 4a0d3cd3d20220b7f363922b49eae8cd0c740426 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Fri, 22 Mar 2024 01
hnakamura5 wrote:
@HazardyKnusperkeks
Thank you for reviewing and merging the fix.
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hnakamura5 wrote:
@wangpc-pp
Thank you for telling, and sorry for overlooking the detailed check for CI.
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
hnakamura5 wrote:
Thank you so much for quick response!
https://github.com/llvm/llvm-project/pull/85760
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/85760
Intend to fix the `Test documentation build `, degraded here
https://github.com/llvm/llvm-project/pull/83149 .
>From 612bc89ef805a3324520f4b7ef1ebb13e334ec0b Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: T
hnakamura5 wrote:
Thank you very much!
I really appreciate you for reviewing up to such a complicated option.
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1842,6 +1846,19 @@ void
ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
Style.ContinuationIndentWidth +
std::max(CurrentState.LastSpace, CurrentState.StartOfFunctionCall);
+if (Style.isTableGen()) {
+ if (Current.is(TT_TableGenDAG
@@ -332,6 +332,84 @@ TEST_F(FormatTestTableGen, Assert) {
verifyFormat("assert !le(DefVar1, 0), \"Assert1\";\n");
}
+TEST_F(FormatTestTableGen, DAGArgBreakElements) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_TableGen);
+ Style.ColumnLimit = 60;
+ // By default
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/83149
>From becb28f6daa1fed9cabe40375a7ed863207b6bd2 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Wed, 28 Feb 2024 01:10:12 +0900
Subject: [PATCH 1/4] [clang-format] Add Options to break inside the TableGen
DAGA
@@ -2332,6 +2332,77 @@ TEST_F(TokenAnnotatorTest, UnderstandTableGenTokens) {
EXPECT_TOKEN(Tokens[4], tok::less, TT_TemplateOpener);
EXPECT_TOKEN(Tokens[6], tok::greater, TT_TemplateCloser);
EXPECT_TOKEN(Tokens[7], tok::l_brace, TT_FunctionLBrace);
+
+ // DAGArg breaking
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/83149
>From becb28f6daa1fed9cabe40375a7ed863207b6bd2 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Wed, 28 Feb 2024 01:10:12 +0900
Subject: [PATCH 1/3] [clang-format] Add Options to break inside the TableGen
DAGA
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/83149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/83149
>From becb28f6daa1fed9cabe40375a7ed863207b6bd2 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Wed, 28 Feb 2024 01:10:12 +0900
Subject: [PATCH 1/2] [clang-format] Add Options to break inside the TableGen
DAGA
hnakamura5 wrote:
These options have a dependency that TableGenBreakInsideDAGArgList is effective
only when TableGenBreakingDAGArgOperators is specified as true.
I'm not sure this is a smart way.
https://github.com/llvm/llvm-project/pull/83149
___
cfe
hnakamura5 wrote:
Break options for DAGArg: https://github.com/llvm/llvm-project/pull/83149.
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-com
hnakamura5 wrote:
Alignment option for definitions:
https://github.com/llvm/llvm-project/pull/83008.
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinf
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/83149
This adds two options to control the line break inside TableGen DAGArg.
- TableGenBreakInsideDAGArgList
- TableGenBreakingDAGArgOperators
>From becb28f6daa1fed9cabe40375a7ed863207b6bd2 Mon Sep 17 00:00:00 20
hnakamura5 wrote:
Thank you!
https://github.com/llvm/llvm-project/pull/83008
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/83008
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/83008
To align TableGen consecutive definitions.
>From 4d22f709eff00b38cce6e9f4087bea14d04424fd Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Mon, 26 Feb 2024 23:17:55 +0900
Subject: [PATCH 1/2] [clang-format] Ad
hnakamura5 wrote:
Thank you!
https://github.com/llvm/llvm-project/pull/82878
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/82878
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -849,7 +851,12 @@ void WhitespaceManager::alignConsecutiveAssignments() {
}
void WhitespaceManager::alignConsecutiveBitFields() {
- if (!Style.AlignConsecutiveBitFields.Enabled)
+ alignConsecutiveColons(Style.AlignConsecutiveBitFields, TT_BitFieldColon);
+}
+
+void Whites
hnakamura5 wrote:
Alignment option for cond operator:
https://github.com/llvm/llvm-project/pull/82878.
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listi
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/82878
To align colons inside TableGen !cond operators.
>From d0ceab536cc9aa06ce5de1324eee1e3a05dac804 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Sat, 24 Feb 2024 22:21:04 +0900
Subject: [PATCH] [clang-format]
hnakamura5 wrote:
Thank you very much!
https://github.com/llvm/llvm-project/pull/81611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/81611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/81611
>From 7ee4b35f0aed434053b6fd6329ef39de97bc22db Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Tue, 13 Feb 2024 23:50:15 +0900
Subject: [PATCH 1/6] [clang-format] Support of TableGen basic format
restrictions
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/81611
>From 7ee4b35f0aed434053b6fd6329ef39de97bc22db Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Tue, 13 Feb 2024 23:50:15 +0900
Subject: [PATCH 1/5] [clang-format] Support of TableGen basic format
restrictions
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/81611
>From 7ee4b35f0aed434053b6fd6329ef39de97bc22db Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Tue, 13 Feb 2024 23:50:15 +0900
Subject: [PATCH 1/4] [clang-format] Support of TableGen basic format
restrictions
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/81611
>From 7ee4b35f0aed434053b6fd6329ef39de97bc22db Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Tue, 13 Feb 2024 23:50:15 +0900
Subject: [PATCH 1/4] [clang-format] Support of TableGen basic format
restrictions
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/81611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/81611
>From 7ee4b35f0aed434053b6fd6329ef39de97bc22db Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Tue, 13 Feb 2024 23:50:15 +0900
Subject: [PATCH 1/3] [clang-format] Support of TableGen basic format
restrictions
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/81611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5072,7 +5072,38 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine &Line,
Left.endsSequence(tok::greatergreater, tok::l_brace))) {
return false;
}
+ } else if (Style.isTableGen()) {
+// Avoid to connect [ and {. [{ is start token of mul
@@ -5822,6 +5860,24 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
return false;
if (Left.is(TT_TemplateString) && Left.opensScope())
return true;
+ } else if (Style.isTableGen()) {
+// Avoid to break after "def", "class", "let" and so o
@@ -55,5 +55,268 @@ TEST_F(FormatTestTableGen, NoSpacesInSquareBracketLists) {
verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;");
}
+TEST_F(FormatTestTableGen, LiteralsAndIdentifiers) {
+ verifyFormat("def LiteralAndIdentifiers {\n"
+ " let someInteg
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/81611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/81611
>From 7ee4b35f0aed434053b6fd6329ef39de97bc22db Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Tue, 13 Feb 2024 23:50:15 +0900
Subject: [PATCH 1/2] [clang-format] Support of TableGen basic format
restrictions
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/81611
- Allow/force to break the line or not.
- Allow to insert space or not.
This is separated part from https://github.com/llvm/llvm-project/pull/76059.
Now we come to format in basic style !
>From 7ee4b35f0aed43
hnakamura5 wrote:
Thank you very much!
Currently I think this will be the largest part. I try to make so. Thank you
again for this, and of course for the other parts.
https://github.com/llvm/llvm-project/pull/80299
___
cfe-commits mailing list
cfe-com
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/80299
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -833,13 +885,207 @@ class AnnotatingParser {
Left->setType(TT_ArrayInitializerLSquare);
}
FormatToken *Tok = CurrentToken;
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::minus, tok::ellipsis)) {
+ // '-' and
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/80299
>From 36f83a124ea8ad27cfefa1d12ae5aa781f8e6e3e Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Thu, 1 Feb 2024 23:07:42 +0900
Subject: [PATCH 1/3] [clang-format] Support of TableGen value annotations.
---
cl
@@ -833,13 +885,207 @@ class AnnotatingParser {
Left->setType(TT_ArrayInitializerLSquare);
}
FormatToken *Tok = CurrentToken;
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::minus, tok::ellipsis)) {
+ // '-' and
@@ -1423,11 +1692,30 @@ class AnnotatingParser {
if (!Tok->getPreviousNonComment())
Line.IsContinuation = true;
}
+ if (Style.isTableGen()) {
+if (Tok->is(Keywords.kw_assert)) {
+ if (!parseTableGenValue())
+return false
@@ -833,13 +885,207 @@ class AnnotatingParser {
Left->setType(TT_ArrayInitializerLSquare);
}
FormatToken *Tok = CurrentToken;
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::minus, tok::ellipsis)) {
+ // '-' and
@@ -833,13 +885,207 @@ class AnnotatingParser {
Left->setType(TT_ArrayInitializerLSquare);
}
FormatToken *Tok = CurrentToken;
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::minus, tok::ellipsis)) {
+ // '-' and
@@ -833,13 +885,207 @@ class AnnotatingParser {
Left->setType(TT_ArrayInitializerLSquare);
}
FormatToken *Tok = CurrentToken;
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::minus, tok::ellipsis)) {
+ // '-' and
@@ -256,6 +256,18 @@ class AnnotatingParser {
}
}
}
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::equal)) {
+ // They appears as a separator. Unless it is not in class definition.
hnakamura
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/80299
>From 36f83a124ea8ad27cfefa1d12ae5aa781f8e6e3e Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Thu, 1 Feb 2024 23:07:42 +0900
Subject: [PATCH 1/2] [clang-format] Support of TableGen value annotations.
---
cl
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/80299
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -915,10 +1163,12 @@ class AnnotatingParser {
Previous->setType(TT_SelectorName);
}
}
-if (CurrentToken->is(tok::colon) && OpeningBrace.is(TT_Unknown))
+if (CurrentToken->is(tok::colon) && OpeningBrace.is(TT_Unknown) &&
+
@@ -1423,11 +1692,30 @@ class AnnotatingParser {
if (!Tok->getPreviousNonComment())
Line.IsContinuation = true;
}
+ if (Style.isTableGen()) {
+if (Tok->is(Keywords.kw_assert)) {
+ if (!parseTableGenValue())
+return false
@@ -1423,11 +1692,30 @@ class AnnotatingParser {
if (!Tok->getPreviousNonComment())
Line.IsContinuation = true;
}
+ if (Style.isTableGen()) {
+if (Tok->is(Keywords.kw_assert)) {
+ if (!parseTableGenValue())
+return false
@@ -833,13 +885,207 @@ class AnnotatingParser {
Left->setType(TT_ArrayInitializerLSquare);
}
FormatToken *Tok = CurrentToken;
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::minus, tok::ellipsis)) {
+ // '-' and
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/80299
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -549,6 +583,22 @@ class AnnotatingParser {
if (CurrentToken->is(tok::comma))
Contexts.back().CanBeExpression = true;
+ if (Style.isTableGen()) {
+if (CurrentToken->is(tok::comma)) {
+ if (Contexts.back().IsTableGenCondOpe)
+Cu
@@ -388,6 +400,28 @@ class AnnotatingParser {
Contexts.back().IsExpression = !IsForOrCatch;
}
+if (Style.isTableGen()) {
+ if (FormatToken *Prev = OpeningParen.Previous) {
+if (Prev->is(TT_TableGenCondOperator)) {
+ Contexts.back().IsTableGe
@@ -256,6 +256,18 @@ class AnnotatingParser {
}
}
}
+ if (Style.isTableGen()) {
+if (CurrentToken->isOneOf(tok::comma, tok::equal)) {
+ // They appears as a separator. Unless it is not in class definition.
+ next();
+
@@ -816,7 +816,7 @@ void FormatTokenLexer::handleTableGenMultilineString() {
auto CloseOffset = Lex->getBuffer().find("}]", OpenOffset);
if (CloseOffset == StringRef::npos)
return;
- auto Text = Lex->getBuffer().substr(OpenOffset, CloseOffset + 2);
+ auto Text = Lex->
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/80299
This implements the annotation of the values in TableGen.
The main changes are,
- parseTableGenValue(), the simplified parser method for the syntax of values.
- modified consumeToken() to parseTableGenValue in
hnakamura5 wrote:
@HazardyKnusperkeks
Thank you for checking and accepting!
@mydeveloperday
You will be able to see the points in the consequent PRs.
https://github.com/llvm/llvm-project/pull/78996
___
cfe-commits mailing list
cfe-commits@lists.llvm
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/78996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -276,13 +276,44 @@ void FormatTokenLexer::tryMergePreviousTokens() {
return;
}
}
- // TableGen's Multi line string starts with [{
- if (Style.isTableGen() && tryMergeTokens({tok::l_square, tok::l_brace},
- TT_TableGenMu
@@ -276,13 +276,44 @@ void FormatTokenLexer::tryMergePreviousTokens() {
return;
}
}
- // TableGen's Multi line string starts with [{
- if (Style.isTableGen() && tryMergeTokens({tok::l_square, tok::l_brace},
- TT_TableGenMu
hnakamura5 wrote:
bang operators and numeric literals part
https://github.com/llvm/llvm-project/pull/78996 .
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
hnakamura5 wrote:
Numeric like identifiers part https://github.com/llvm/llvm-project/pull/78571
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
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/78996
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/78996
Adds the support for tokens that have forms like unary operators.
- bang operators: `!name`
- cond operator: `!cond`
- numeric literals: `+1`, `-1`
cond operator are one of bang operators but is distinguished
hnakamura5 wrote:
Thank you very much!
> how small the diff is
Maybe it is by TableGen's simple syntax, and that here we are parsing only the
structure of the statements. (e.g. ignoring the `` part of `if` now).
https://github.com/llvm/llvm-project/pull/78846
_
https://github.com/hnakamura5 closed
https://github.com/llvm/llvm-project/pull/78846
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/78846
>From fbf7e0f624fb7a4ef05970ee1241cf68f3f5f783 Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Sat, 20 Jan 2024 22:37:25 +0900
Subject: [PATCH 1/2] [clang-format] Support of TableGen statements in
unwrapped l
hnakamura5 wrote:
unwrapped line parser for statements part
https://github.com/llvm/llvm-project/pull/78846 .
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
hnakamura5 wrote:
Numeric like identifiers part https://github.com/llvm/llvm-project/pull/78571
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-
https://github.com/hnakamura5 edited
https://github.com/llvm/llvm-project/pull/78846
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 143 matches
Mail list logo