[PATCH] D79325: [clang-format] [PR42164] Add Option to Break before While

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 12:28:28 PDT 2020


MyDeveloperDay marked 2 inline comments as done.
MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2170
     parseBlock(/*MustBeDeclaration=*/false);
-    if (Style.BraceWrapping.IndentBraces)
+    if (Style.BraceWrapping.IndentBraces || Style.BraceWrapping.BeforeWhile)
       addUnwrappedLine();
----------------
krasimir wrote:
> Why not remove `Style.BraceWrapping.IndentBraces`? 
> - should be a no-op for GNU style, 
> - other styles don't IndentBraces, 
> - we can add a sentence in the release notes that previously IndentBraces implied the new "BeforeWhile" option, and now you just have to set it if you're using a custom GNU-like style.
`IndentBraces` is used elsewhere inside parseLabel() and CompoundStatementIndenter, I think I'd be uncomfortable about removing it.

There are 1000's of references to it in GitHub.

https://github.com/search?l=YAML&q=%22IndentBraces%3A+true%22&type=Code

https://github.com/search?q=%22IndentBraces%3A+false%22&type=Code


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79325/new/

https://reviews.llvm.org/D79325





More information about the cfe-commits mailing list