https://github.com/owenca closed 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
https://github.com/HazardyKnusperkeks 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
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
https://github.com/owenca 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
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/92617
>From b4a8c06b79ec10ed2f53a7410bd847ecfa9e8450 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Fri, 17 May 2024 17:18:59 -0600
Subject: [PATCH 1/6] [clang-format]: Annotate colons found in inline assembly
Short
@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
https://github.com/owenca edited 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
https://github.com/owenca edited 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
@@ -1488,12 +1488,81 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
https://github.com/owenca 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
https://github.com/owenca edited 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
gedare wrote:
> It seems that you used 5 different assembly snippets and repeated each 3-6
> times. Instead, we can have something like the following:
>
> ```
> asm{Snippet 1};
>
> __asm(Snippet 2);
>
> __asm__(Snippet 3);
>
> asm volatile (Snippet 4);
>
> __asm volatile (Snippet 5);
> ```
@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << T
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/92617
>From b4a8c06b79ec10ed2f53a7410bd847ecfa9e8450 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Fri, 17 May 2024 17:18:59 -0600
Subject: [PATCH 1/5] [clang-format]: Annotate colons found in inline assembly
Short
@@ -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
@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << T
@@ -1488,12 +1488,247 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << T
https://github.com/owenca edited 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
https://github.com/owenca commented:
It seems that you used 5 different assembly snippets and repeated each 3-6
times. Instead, we can have something like the following:
```
asm{Snippet 1};
__asm(Snippet 2);
__asm__(Snippet 3);
asm volatile (Snippet 4);
__asm volatile (Snippet 5);
```
Also,
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/92617
>From b4a8c06b79ec10ed2f53a7410bd847ecfa9e8450 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Fri, 17 May 2024 17:18:59 -0600
Subject: [PATCH 1/4] [clang-format]: Annotate colons found in inline assembly
Short
@@ -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
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/92617
>From b4a8c06b79ec10ed2f53a7410bd847ecfa9e8450 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Fri, 17 May 2024 17:18:59 -0600
Subject: [PATCH 1/3] [clang-format]: Annotate colons found in inline assembly
Short
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
@@ -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
@@ -1488,12 +1488,91 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
- "a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << To
@@ -1489,11 +1489,25 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
"a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << Toke
@@ -1358,6 +1358,8 @@ class AnnotatingParser {
Line.First->startsSequence(tok::kw_export, Keywords.kw_module) ||
Line.First->startsSequence(tok::kw_export, Keywords.kw_import)) {
Tok->setType(TT_ModulePartitionColon);
+ } else if (Line.First->is
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/92617
>From b4a8c06b79ec10ed2f53a7410bd847ecfa9e8450 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Fri, 17 May 2024 17:18:59 -0600
Subject: [PATCH 1/2] [clang-format]: Annotate colons found in inline assembly
Short
https://github.com/gedare edited 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
https://github.com/gedare edited 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
@@ -1489,11 +1489,25 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
"a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << Toke
@@ -1489,11 +1489,25 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
"a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << Toke
@@ -1489,11 +1489,25 @@ TEST_F(TokenAnnotatorTest,
RequiresDoesNotChangeParsingOfTheRest) {
TEST_F(TokenAnnotatorTest, UnderstandsAsm) {
auto Tokens = annotate("__asm{\n"
"a:\n"
- "};");
- ASSERT_EQ(Tokens.size(), 7u) << Toke
@@ -1358,6 +1358,8 @@ class AnnotatingParser {
Line.First->startsSequence(tok::kw_export, Keywords.kw_module) ||
Line.First->startsSequence(tok::kw_export, Keywords.kw_import)) {
Tok->setType(TT_ModulePartitionColon);
+ } else if (Line.First->is
https://github.com/HazardyKnusperkeks 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
gedare wrote:
With the patch:
```
$ echo " asm ( a : );" | clang-format -debug
...
M=0 C=1 T=InlineASMColon S=1 F=0 B=0 BK=0 P=43 Name=colon L=7 PPK=2
FakeLParens= FakeRParens=1 II=0x0 Text=':'
...
$ echo " asm { a : };" | clang-format -debug
...
M=0 C=1 T=InlineASMColon S=0 F=1 B=0 BK=0 P=43
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: Gedare Bloom (gedare)
Changes
Short-circuit the parsing of tok::colon to label colons found within lines
starting with asm as InlineASMColon.
Fixes #92616.
---
Full diff: https://github.com/llvm/llvm-project/pull/92617.diff
2 Fi
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/92617
Short-circuit the parsing of tok::colon to label colons found within lines
starting with asm as InlineASMColon.
Fixes #92616.
>From b4a8c06b79ec10ed2f53a7410bd847ecfa9e8450 Mon Sep 17 00:00:00 2001
From: Gedare
42 matches
Mail list logo