[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-remote-linux-ubuntu` running on `as-builder-9` while building `clang` at step 16 "test-check-lldb-api". Full details are available at: https://lab.llvm.org/buildbot/#/builders/195/builds/2160 Here is the relevant piece

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `openmp-offload-libc-amdgpu-runtime` running on `omp-vega20-1` while building `clang` at step 7 "Add check check-offload". Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/9948 Here is the re

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Owen Pan via cfe-commits
@@ -6105,6 +6105,35 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, return false; } + // We can break before an r_brace if there was a corresponding break after + // the l_brace, which is tracked by BreakBeforeClosingBrace, or if we are + // in a

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/119044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/119044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/119044 >From c5bf1fc70df08ef94cc32a47d1bdce69c92c2abf Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 6 Dec 2024 16:52:35 -0700 Subject: [PATCH 1/2] [clang-format] Reorder TokenAnnotator::canBreakBefore Move the

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/119044 >From c5bf1fc70df08ef94cc32a47d1bdce69c92c2abf Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 6 Dec 2024 16:52:35 -0700 Subject: [PATCH] [clang-format] Reorder TokenAnnotator::canBreakBefore Move the che

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Gedare Bloom via cfe-commits
@@ -6105,6 +6105,33 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, return false; } + // We only break before r_brace if there was a corresponding break before + // the l_brace, which is tracked by BreakBeforeClosingBrace. gedare w

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-09 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/119044 >From c6b628536daf5640c383fd7abe629e84d1505ae2 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 6 Dec 2024 16:52:35 -0700 Subject: [PATCH 1/2] [clang-format] Reorder TokenAnnotator::canBreakBefore Move the

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-07 Thread Owen Pan via cfe-commits
@@ -6105,6 +6105,33 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, return false; } + // We only break before r_brace if there was a corresponding break before + // the l_brace, which is tracked by BreakBeforeClosingBrace. + if (Right.is(tok::r_br

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-07 Thread Owen Pan via cfe-commits
@@ -9383,6 +9383,13 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) { "(a, )) &&\n" ");", Style); + verifyFormat("void foo(\n" + "void (*foobarpntr)(\n" +

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-07 Thread Owen Pan via cfe-commits
@@ -6105,6 +6105,33 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line, return false; } + // We only break before r_brace if there was a corresponding break before + // the l_brace, which is tracked by BreakBeforeClosingBrace. owenca w

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread Gedare Bloom via cfe-commits
gedare wrote: Without this patch, the test case on `main`: ``` [ RUN ] FormatTest.AlignsAfterOpenBracket /home/gedare/rtems/llvm-project/clang/unittests/Format/FormatTestBase.h:90: Failure Expected equality of these values: ExpectedCode Which is: "void foo(\nvoid (*foobarpntr)(\n

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/119044 >From c6b628536daf5640c383fd7abe629e84d1505ae2 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 6 Dec 2024 16:52:35 -0700 Subject: [PATCH] [clang-format] Reorder TokenAnnotator::canBreakBefore Move the che

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/119044 >From bd86e432e8ef5bc960e2ccaeca77f3b7cf51333f Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 6 Dec 2024 16:52:35 -0700 Subject: [PATCH] [clang-format] Reorder TokenAnnotator::canBreakBefore Move the che

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 516d6ede122086027baa2288623605a423375e87 6233d3dc731ae15368231b9e956379d71e905311 --e

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/119044 >From 6233d3dc731ae15368231b9e956379d71e905311 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Fri, 6 Dec 2024 16:52:35 -0700 Subject: [PATCH] [clang-format] Reorder TokenAnnotator::canBreakBefore Move the che

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Gedare Bloom (gedare) Changes Move the checks related to breaking before right braces and right parens earlier to avoid conflicting checks that prevent breaking based on the left-hand token. This allows properly formatting declara

[clang] [clang-format] Reorder TokenAnnotator::canBreakBefore (PR #119044)

2024-12-06 Thread Gedare Bloom via cfe-commits
https://github.com/gedare created https://github.com/llvm/llvm-project/pull/119044 Move the checks related to breaking before right braces and right parens earlier to avoid conflicting checks that prevent breaking based on the left-hand token. This allows properly formatting declarations with