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:
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
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
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
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
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-
hnakamura5 wrote:
Multi line string part https://github.com/llvm/llvm-project/pull/78032
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:
Thanks to the advises, I begin to split this into several parts.
Made the keywords part in https://github.com/llvm/llvm-project/pull/77477 .
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lis
HazardyKnusperkeks wrote:
> @rymiel @HazardyKnusperkeks Thank you for your review! I have fixed the
> points. But for refactoring of the test base class in
> [f8d10d5](https://github.com/llvm/llvm-project/commit/f8d10d5ac9ab4b45b388c74357fc82fb96562e66)
> . I'm not sure I should do here, and i
hnakamura5 wrote:
@rymiel @HazardyKnusperkeks
Thank you for your review!
I have fixed the points.
But for refactoring of the test base class in
https://github.com/llvm/llvm-project/commit/f8d10d5ac9ab4b45b388c74357fc82fb96562e66
.
I'm not sure I should do here, and if I should, I should do it
@@ -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 &Sty
@@ -4656,6 +4687,15 @@ struct FormatStyle {
/// \version 8
std::vector StatementMacros;
+ /// Tablegen
+ bool TableGenAllowBreakBeforeInheritColon;
+ bool TableGenAllowBreakAfterInheritColon;
hnakamura5 wrote:
Thank you for the information. I removed t
@@ -396,6 +396,36 @@ struct FormatStyle {
/// \version 17
ShortCaseStatementsAlignmentStyle AlignConsecutiveShortCaseStatements;
+ /// Style of aligning consecutive TableGen cond operator colons.
+ /// \code
+ /// !cond(!eq(size, 1) : 1,
+ /// !eq(size, 16):
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/76059
>From b0080a41c1802517e4a02976058231cf37a82adb Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Fri, 3 Nov 2023 20:58:17 +0900
Subject: [PATCH 1/2] [clang-format] Support of TableGen formatting.
Currently, Tab
hnakamura5 wrote:
Thank you for the information. I added the document.
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/76059
>From b0080a41c1802517e4a02976058231cf37a82adb Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Fri, 3 Nov 2023 20:58:17 +0900
Subject: [PATCH 1/2] [clang-format] Support of TableGen formatting.
Currently, Tab
@@ -2165,6 +2165,56 @@ TEST_F(TokenAnnotatorTest, UnderstandsVerilogOperators) {
EXPECT_TOKEN(Tokens[4], tok::string_literal, TT_Unknown);
}
+TEST_F(TokenAnnotatorTest, UnderstandTableGenTokens) {
+ auto Style = getLLVMStyle(FormatStyle::LK_TableGen);
+ Style.TableGenBreak
@@ -681,6 +700,10 @@ struct FormatToken {
return true;
if (is(TT_DictLiteral) && is(tok::greater))
return true;
+if (is(TT_TableGenParamAngleCloser))
+ return true;
+if (is(TT_TableGenListCloser))
+ return true;
return isOneOf(tok::r_paren
@@ -396,6 +396,36 @@ struct FormatStyle {
/// \version 17
ShortCaseStatementsAlignmentStyle AlignConsecutiveShortCaseStatements;
+ /// Style of aligning consecutive TableGen cond operator colons.
+ /// \code
+ /// !cond(!eq(size, 1) : 1,
+ /// !eq(size, 16):
@@ -4656,6 +4687,15 @@ struct FormatStyle {
/// \version 8
std::vector StatementMacros;
+ /// Tablegen
+ bool TableGenAllowBreakBeforeInheritColon;
+ bool TableGenAllowBreakAfterInheritColon;
HazardyKnusperkeks wrote:
Do you need both options to be ena
@@ -396,6 +396,36 @@ struct FormatStyle {
/// \version 17
ShortCaseStatementsAlignmentStyle AlignConsecutiveShortCaseStatements;
+ /// Style of aligning consecutive TableGen cond operator colons.
+ /// \code
+ /// !cond(!eq(size, 1) : 1,
+ /// !eq(size, 16):
https://github.com/HazardyKnusperkeks requested changes to this pull request.
I think we all would gain a lot, if you could split this into multiple pull
requests. The discussion can be more focused and you have a greater chance to
get something merged. Similar to the Verilog changes.
https://
@@ -4656,6 +4687,15 @@ struct FormatStyle {
/// \version 8
std::vector StatementMacros;
+ /// Tablegen
HazardyKnusperkeks wrote:
We need a bit more documentation here.
https://github.com/llvm/llvm-project/pull/76059
_
https://github.com/HazardyKnusperkeks 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
@@ -272,6 +276,38 @@ void FormatTokenLexer::tryMergePreviousTokens() {
return;
}
}
+ if (Style.isTableGen()) {
+if (tryMergeTokens({tok::l_square, tok::l_brace},
+ TT_TableGenMultiLineString)) {
+ Tokens.back()->Tok.setKind(tok::strin
@@ -1124,6 +1130,20 @@ template <> struct MappingTraits {
IO.mapOptional("StatementAttributeLikeMacros",
Style.StatementAttributeLikeMacros);
IO.mapOptional("StatementMacros", Style.StatementMacros);
+IO.mapOptional("TableGenAllowBreakAfterInherit
@@ -4753,6 +4793,13 @@ struct FormatStyle {
AlignConsecutiveMacros == R.AlignConsecutiveMacros &&
AlignConsecutiveShortCaseStatements ==
R.AlignConsecutiveShortCaseStatements &&
+ AlignConsecutiveTableGenCondOperatorColons ==
+
@@ -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 &Sty
@@ -111,6 +111,9 @@ const tooling::Replacements
&WhitespaceManager::generateReplacements() {
alignConsecutiveDeclarations();
alignConsecutiveBitFields();
alignConsecutiveAssignments();
+ alignConsecutiveTableGenCondOperatorColons();
+ AlignConsecutiveTableGenBreakingDA
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
@@ -111,6 +111,9 @@ const tooling::Replacements
&WhitespaceManager::generateReplacements() {
alignConsecutiveDeclarations();
alignConsecutiveBitFields();
alignConsecutiveAssignments();
+ alignConsecutiveTableGenCondOperatorColons();
+ AlignConsecutiveTableGenBreakingDA
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 mai
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
https://github.com/hnakamura5 updated
https://github.com/llvm/llvm-project/pull/76059
>From b0080a41c1802517e4a02976058231cf37a82adb Mon Sep 17 00:00:00 2001
From: hnakamura5
Date: Fri, 3 Nov 2023 20:58:17 +0900
Subject: [PATCH] [clang-format] Support of TableGen formatting.
Currently, TableGe
hnakamura5 wrote:
Thank you for your advice. I have checked the message "clang-format did not
modify any files" in my local.
https://github.com/llvm/llvm-project/pull/76059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
owenca wrote:
> I avoid this by using clang-format binary from main branch in my local. What
> should I do with this failure?
You can ignore it if running the in-tree clang-format is clean, e.g.:
```
$ clang/tools/clang-format/git-clang-format --binary build/bin/clang-format
HEAD~
clang-format
hnakamura5 wrote:
The failure in Check code formatting seems to be caused by the commit
(replacing to clang-format style)
https://github.com/llvm/llvm-project/commit/5c60e2ce78e79c2d15152e08d9e28fcf3a1d4e51
I avoid this by using clang-format binary from main branch in my local.
What should I do
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: H.Nakamura (hnakamura5)
Changes
Currently, TableGen has its language style but the it does not works well. This
patch adds total support of TableGen formatting including the support for the
code (multi line string), DAG args, bang
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be
notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it i
https://github.com/hnakamura5 created
https://github.com/llvm/llvm-project/pull/76059
Currently, TableGen has its language style but the it does not works well. This
patch adds total support of TableGen formatting including the support for the
code (multi line string), DAG args, bang operators
44 matches
Mail list logo