[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-30 Thread Owen Pan via cfe-commits
owenca wrote: > > @dyung I don't see anything in this patch could cause a failure in CodGen > > tests. Have you verified it e.g. by running the tests on > > [f175030](https://github.com/llvm/llvm-project/commit/f1750300aad0e49383cd4b206e2354f1300a40a8)? > > It seems several of the listed faili

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-29 Thread via cfe-commits
dyung wrote: > @dyung I don't see anything in this patch could cause a failure in CodGen > tests. Have you verified it e.g. by running the tests on > [f175030](https://github.com/llvm/llvm-project/commit/f1750300aad0e49383cd4b206e2354f1300a40a8)? One of the bots did. - f1750300aad0e49383cd4b20

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-29 Thread Owen Pan via cfe-commits
owenca wrote: @dyung I don't see anything in this patch could cause a failure in CodGen tests. Have you verified it e.g. by running the tests on f1750300aad0e49383cd4b206e2354f1300a40a8? https://github.com/llvm/llvm-project/pull/137577 ___ cfe-commit

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-29 Thread via cfe-commits
dyung wrote: @owenca your change seems to be causing a unit test failure in CodeGenTest.TestNonAlterTest which is impacting quite a few bots. Can you take a look and revert if you need time to investigate? https://github.com/llvm/llvm-project/pull/137577 ___

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-29 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve2-vla-2stage` running on `linaro-g4-01` while building `clang` at step 12 "ninja check 2". Full details are available at: https://lab.llvm.org/buildbot/#/builders/199/builds/3079 Here is the relevant piece

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-29 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/137577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-28 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/137577 >From ce33e11aedf297e9cfb5e20efb4ce316886e6cb1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 27 Apr 2025 21:18:03 -0700 Subject: [PATCH 1/2] [clang-format] Add OneLineFormatOffRegex option Close #54334 ---

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -24954,6 +24954,82 @@ TEST_F(FormatTest, DisableRegions) { "// clang-format on"); } +TEST_F(FormatTest, OneLineFormatOffRegex) { + auto Style = getLLVMStyle(); + Style.OneLineFormatOffRegex = "// format off$"; + + verifyFormat("// format off\n" +

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -83,8 +83,42 @@ FormatTokenLexer::FormatTokenLexer( ArrayRef FormatTokenLexer::lex() { assert(Tokens.empty()); assert(FirstInLineIndex == 0); + const llvm::Regex FormatOffRegex(Style.OneLineFormatOffRegex); + enum { FO_None, FO_CurrentLine, FO_NextLine } FormatOff = FO

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-27 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/137577 >From ce33e11aedf297e9cfb5e20efb4ce316886e6cb1 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 27 Apr 2025 21:18:03 -0700 Subject: [PATCH] [clang-format] Add OneLineFormatOffRegex option Close #54334 --- cla

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes Close #54334 --- Full diff: https://github.com/llvm/llvm-project/pull/137577.diff 7 Files Affected: - (modified) clang/docs/ClangFormatStyleOptions.rst (+22) - (modified) clang/docs/ReleaseNotes.rst (+1

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-27 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/137577 Close #54334 >From e505e4e1ca2457db2aba34e50b1eeaf9e8458020 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 27 Apr 2025 21:18:03 -0700 Subject: [PATCH] [clang-format] Add OneLineFormatOffRegex option Close #