[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-06-06 Thread Owen Pan via cfe-commits
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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-27 Thread Björn Schäpers via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Hirofumi Nakamura via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-25 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via 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); > ```

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via 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/5] [clang-format]: Annotate colons found in inline assembly Short

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Hirofumi Nakamura via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Owen Pan via 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,

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via 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/4] [clang-format]: Annotate colons found in inline assembly Short

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-24 Thread Gedare Bloom via 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/3] [clang-format]: Annotate colons found in inline assembly Short

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Gedare Bloom via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Gedare Bloom via 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/2] [clang-format]: Annotate colons found in inline assembly Short

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-23 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-22 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-22 Thread Owen Pan via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-22 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-21 Thread Björn Schäpers via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-17 Thread Gedare Bloom via 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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-17 Thread via cfe-commits
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

[clang] [clang-format]: Annotate colons found in inline assembly (PR #92617)

2024-05-17 Thread Gedare Bloom via cfe-commits
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