https://github.com/fauxprogrammer updated https://github.com/llvm/llvm-project/pull/181213
>From 2c8a26919b9b27e43d229aafd832a6ece85982a9 Mon Sep 17 00:00:00 2001 From: John Mitchell <[email protected]> Date: Thu, 12 Feb 2026 12:47:16 -0600 Subject: [PATCH 1/2] Update IntegerLiteralSeparatorFixer.cpp Add C language support for digit separator for integer literals. Compiler support added in C23+ --- clang/lib/Format/IntegerLiteralSeparatorFixer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp b/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp index a283884b6c341..83c11d695d0e4 100644 --- a/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp +++ b/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp @@ -50,6 +50,9 @@ IntegerLiteralSeparatorFixer::process(const Environment &Env, case FormatStyle::LK_JavaScript: Separator = '_'; break; + case FormatStyle::LK_C: + Separator = '\''; + break; case FormatStyle::LK_Cpp: case FormatStyle::LK_ObjC: if (Style.Standard >= FormatStyle::LS_Cpp14) { >From a7728ee28d6e6e324eb262f12316c47547d7cc02 Mon Sep 17 00:00:00 2001 From: John Mitchell <[email protected]> Date: Mon, 16 Feb 2026 08:13:49 -0600 Subject: [PATCH 2/2] Allow break before/after control statement even without leftward movement Method ContinuationIndenter::addTokenOnCurrentLine contains a check "State.Column > getNewLineColumn(State).Total" (file line 954) whose purpose seems to validate that a control flow line break will result in leftward movement of the conditional check. If breaking control flow into multiple lines does not result in leftward movement then no break is performed. E.g even with BreakAfterOpenBracketIf / BreakBeforeCloseBracketIf set to true the result will be as follows: ```c int function1(int parameter1, int parameter2, int parameter3) { if (parameter1 < parameter2 || (parameter1 > parameter3 && parameter1 != null) || parameter1 == 500) { return 1; } return 0; } ``` Expected result would be: ```c int function1(int parameter1, int parameter2, int parameter3) { if ( parameter1 < parameter2 || (parameter1 > parameter3 && parameter1 != null) || parameter1 == 500 ) { return 1; } return 0; } ``` Fixes #181293, #181591 --- clang/lib/Format/ContinuationIndenter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 1272bb72d423f..0361fdda13728 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -951,7 +951,6 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun, Next->is(TT_FunctionDeclarationLParen) || IsFunctionCallParen(*Next); }; if (IsOpeningBracket(Previous) && - State.Column > getNewLineColumn(State).Total && // Don't do this for simple (no expressions) one-argument function calls // as that feels like needlessly wasting whitespace, e.g.: // _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
