[PATCH] D50147: clang-format: support external styles

2019-08-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50147/new/ https://reviews.llvm.org/D50147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D85600: [clang-format] use spaces for alignment of binary/ternary expressions with UT_AlignWithSpaces

2020-08-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Could this also be causing https://bugs.llvm.org/show_bug.cgi?id=33896 ? I'll try to see if changes something in that case... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85600/new/ https://reviews.llvm.org/D85600 _

[PATCH] D85600: [clang-format] use spaces for alignment of binary/ternary expressions with UT_AlignWithSpaces

2020-08-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D85600#2209545 , @Typz wrote: > Could this also be causing https://bugs.llvm.org/show_bug.cgi?id=33896 ? > > I'll try to see if changes something in that case... Actually, I can confirm this is unrelated. Comme

[PATCH] D85600: [clang-format] use spaces for alignment of binary/ternary expressions with UT_AlignWithSpaces

2020-08-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1360 + if (Style.AlignOperands == FormatStyle::OAS_AlignAfterOperator) +NewParenState.UnindentOperator = true; + // Mark indentation as alignment if the expression is aligned.

[PATCH] D82199: [clang-format] restore indent in conditionals when AlignOperands is DontAlign

2020-06-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:6287 + Style.BreakBeforeTernaryOperators = false; + verifyFormat("int x = aaa ? aa :\n" + "? cc :\n"

[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

2020-04-22 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Typz marked 2 inline comments as done. Closed by commit rG3d61b1120e82: clang-format: Introduce stricter AlignOperands flag (authored by Typz). Changed prior to commit: https://reviews.llvm.org/D32478?vs=226393&id=259307#

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-04-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D50078#1998398 , @dyung wrote: > Hi, this change that you submitted in commit > 5daa25fd7a184524759b6ad065a8bd7e95aa149a > seems > to be causing the test "Cla

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-04-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked an inline comment as done. Typz added a comment. Typz added inline comments. Comment at: clang/lib/Format/WhitespaceManager.h:163 +// it does not increase the indent for "chained" conditionals. +int ConditionalsLevel; + This field is not initi

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-04-23 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D50078#1998578 , @hokein wrote: > In D50078#1998520 , @Typz wrote: > > > In D50078#1998398 , @dyung wrote: > > > > > Hi, this change that you submitt

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-04-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Thanks for trying the patch, too bad it does not work... I will see how to get the required setup/env, but it will probably take some time (esp. in the current situation). Thanks again Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 264234. Typz added a comment. Fix random crash on windows Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ https://reviews.llvm.org/D50078 Files: clang/lib/Format/ContinuationIndenter.cpp clang/lib/Fo

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-15 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4db94094b469: clang-format: support aligned nested conditionals formatting (authored by Typz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ http

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D50078#2050623 , @MyDeveloperDay wrote: > I get the point about Opt In, and if we are going to add an option it needs > to go in ASAP otherwise too many people will then start complaining it was on > by default before. > > To be

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-26 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D50078#2055227 , @srj wrote: > > And I also think it should be on by default instead of modifying many > > .clang-format files. So IMHO if we add an option, it should be opt-out. > > I can live with it being opt-out. My big concer

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Indeed, I saw the emails, but I didn't have time to check or investigate the issues. As for E, this is more tricky than this. At the moment, the code does not look at what is in the first "branch" of the ternary operator : it does not care if this is a nested ternary oper

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Regarding `?:`, this is definitely not considered, and should be relatively easy to handle. Regarding case `D`, this looks like a bug... The break in the first operand is kind of unexpected (as in "not the usual case"), and I had many such corner cases while making and te

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2020-05-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Still no change with a windows or s390x machine, but i could reproduce the/a problem systematically on linux by enabling sanitizer. In this case, initializing ConditionalsLevel to 0 in constructor does index fix this issue (and initializing to 1 ensures the issue happens, t

[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

2019-06-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 203987. Typz added a comment. Herald added a project: clang. Rebase Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D32478/new/ https://reviews.llvm.org/D32478 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Forma

[PATCH] D50078: clang-format: support aligned nested conditionals formatting

2019-06-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 204015. Typz added a comment. Rebase Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ https://reviews.llvm.org/D50078 Files: lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h lib/Format/Whitesp

[PATCH] D70305: clang-format: fix regression in middle pointer alignment

2019-11-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: MyDeveloperDay, klimek, sammccall. Herald added a project: clang. a75f8d98d7ac introduced a regression with Middle pointer alignment, which this patch fixes. Repository: rG

[PATCH] D50147: clang-format: support external styles

2019-11-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D50147#1648786 , @sammccall wrote: > > First and forehand, I have a problem to solve in my organization : we have > > many projects, and maintaining the config file in some many repositories is > > not practical. > > In some cas

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147002. Typz marked 6 inline comments as done. Typz added a comment. Address review comment & rebase Repository: rC Clang https://reviews.llvm.org/D43290 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/Form

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC332434: clang-format: tweak formatting of variable initialization blocks (authored by Typz, committed by ). Changed prior to commit: https://reviews.llvm.org/D43290?vs=147002&id=147003#toc Repository:

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147005. Typz marked 3 inline comments as done. Typz added a comment. Rebase on latest master & address review comments Repository: rC Clang https://reviews.llvm.org/D42684 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Forma

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2018-03-01 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC326426: [clang-format] Add SpaceBeforeColon option (authored by Typz, committed by ). Changed prior to commit: https://reviews.llvm.org/D32525?vs=136305&id=136483#toc Repository: rC Clang https://re

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2018-03-01 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326426: [clang-format] Add SpaceBeforeColon option (authored by Typz, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D32525 Files: cfe/trunk/do

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-03-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-03-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 136557. Typz added a comment. Change options values to No/MultiLine/Yes. Repository: rC Clang https://reviews.llvm.org/D42684 Files: include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Format.cpp lib/Format/TokenAnnotator.cp

[PATCH] D42787: clang-format: do not add extra indent when wrapping last parameter

2018-03-02 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. If people don't care about this case, we might as well merge this :-) Just kidding. The tweak matches both our expectation, the auto-indent behaviour of IDE (not to be trusted, but still probably of 'default' behaviour for many people, esp. when you don't yet use a format

[PATCH] D42787: clang-format: do not add extra indent when wrapping last parameter

2018-03-02 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Also double-checked with Richard Smith and he agrees that the current > behavior is preferable. For comma and plus this doesn't seem overly > important, but making it: > > aa(b + ccc * > d); > > > seems real

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-03-05 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-03-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-03-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-03-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D42684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-03-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-03-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-03-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D42684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44765: PR36643 Make clang-format support more generic TMarcos

2018-03-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. A generic (or at least extandable) approach to specifying macro behaviors was introduced here: https://reviews.llvm.org/D33440 But this change seem to be on hold, as a configuration based on providing "macro definitions" seem to be preferable and kind-of in the pipe, thoug

[PATCH] D44765: PR36643 Make clang-format support more generic TMarcos

2018-03-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. You are right, I did not mean it would help with the handling of these macros; but it may be related on the configuration-side of things : adding an option for listing these macros may hit the same limitation, and the same mean of storing (in the code) the list of these ma

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-03-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. @djasper : ping? Repository: rC Clang https://reviews.llvm.org/D43290 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-03-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. @djasper : ping? Repository: rC Clang https://reviews.llvm.org/D43015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-03-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. @djasper : ping? Repository: rC Clang https://reviews.llvm.org/D42684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D37813: clang-format: better handle namespace macros

2017-12-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? https://reviews.llvm.org/D37813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33440: clang-format: better handle statement macros

2017-12-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? https://reviews.llvm.org/D33440 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D37813: clang-format: better handle namespace macros

2017-12-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. OK. So you mean a solution like the one discussed earlier would be the way to go? > I mean that we can configure macros in the format style, like "define A(X) > class X {". I'm not 100% sure whether we would just try to use the > Preprocessor for this, or whether we'd wan

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332436: clang-format: Allow optimizer to break template declaration. (authored by Typz, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D42684?

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147011. Typz added a comment. Rebase on latest master Repository: rC Clang https://reviews.llvm.org/D43015 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Format.cpp lib/Format/T

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33440: clang-format: better handle statement macros

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147024. Typz added a comment. Herald added a subscriber: mgrang. Rebase on latest master Repository: rC Clang https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/FormatTokenL

[PATCH] D37813: clang-format: better handle namespace macros

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D37813#958222, @klimek wrote: > Some initial design work has been done, and Krasimir said that he's > interested. No timeline though :( @klimek , @krasimir : any progress on this new preprocessor-like way to configure macros ? Repository:

[PATCH] D37813: clang-format: better handle namespace macros

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147027. Typz added a comment. Rebase Repository: rC Clang https://reviews.llvm.org/D37813 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/FormatTokenLexer.cpp lib/Format/NamespaceEndCommentsFixer.cpp

[PATCH] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147031. Typz added a comment. Rebase Repository: rC Clang https://reviews.llvm.org/D32478 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h lib/Format/Format

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-05-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147079. Typz added a comment. rebase Repository: rC Clang https://reviews.llvm.org/D43183 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/UnwrappedLineParser.cpp lib/Format/UnwrappedLineParser.h unittests/Format/FormatTest.cp

[PATCH] D33440: clang-format: better handle statement macros

2018-05-17 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 147293. Typz marked an inline comment as done. Typz added a comment. Address review comments Repository: rC Clang https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/FormatTo

[PATCH] D33440: clang-format: better handle statement macros

2018-05-17 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked an inline comment as done. Typz added inline comments. Comment at: lib/Format/Format.cpp:647-648 LLVMStyle.SortUsingDeclarations = true; + LLVMStyle.StatementMacros.push_back("Q_UNUSED"); + LLVMStyle.StatementMacros.push_back("QT_REQUIRE_VERSION");

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-02-07 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: djasper, krasimir, klimek. This option replaces the BreakBeforeInheritanceComma option with an enum, thus introducing a mode where the colon stays on the same line as constructor declaration: // When it fits on line: class A : public B, public

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-02-07 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 133204. Typz added a comment. Fix indentation of inheritance list, which is actually based on `ConstructorInitializerIndentWidth`. Maybe a new option (`InheritanceListIndentWidth`) should be used instead? Repository: rC Clang https://reviews.llvm.org/D4301

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. The blocks used to be formatted using the "default" behavior, and would thus be mistaken for function calls followed by blocks: this could lead to unexpected inlining of the block and extra line-break before the opening b

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1130 +if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BraceWrapping.AfterObjCDeclaration) +addUnwrappedLine(); Wondering if formatting with this style is ap

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D42684 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42787: clang-format: do not add extra indent when wrapping last parameter

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D42787#1000687, @krasimir wrote: > We could adapt the single-argument version instead, turning: > > foo(bb + > c); > > > into: > > foo(bb + > c); > We could inde

[PATCH] D43121: clang-format: keep ObjC colon alignment with short object name

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. When the target object expression is short and the first selector name is long, clang-format used to break the colon alignment: [I performSelectorOnMainThread:@selector(loadAccessories) withObjec

[PATCH] D43121: clang-format: keep ObjC colon alignment with short object name

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 133589. Typz added a comment. fix type in commit message Repository: rC Clang https://reviews.llvm.org/D43121 Files: lib/Format/ContinuationIndenter.cpp lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/Format

[PATCH] D43121: clang-format: keep ObjC colon alignment with short object name

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 133596. Typz marked 2 inline comments as done. Typz added a comment. Address review comments Repository: rC Clang https://reviews.llvm.org/D43121 Files: lib/Format/ContinuationIndenter.cpp lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestObjC.

[PATCH] D43121: clang-format: keep ObjC colon alignment with short object name

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:900 + std::max(NextNonComment->LongestObjCSelectorName, + unsigned(NextNonComment->TokenText.size())) - NextNonComment->ColumnWidth; djasper

[PATCH] D43121: clang-format: keep ObjC colon alignment with short object name

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 133619. Typz added a comment. rebase on latest master. Repository: rC Clang https://reviews.llvm.org/D43121 Files: lib/Format/ContinuationIndenter.cpp lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestObjC.cpp Index: unittests/Format/FormatTe

[PATCH] D43121: clang-format: keep ObjC colon alignment with short object name

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC324741: clang-format: keep ObjC colon alignment with short object name (authored by Typz, committed by ). Changed prior to commit: https://reviews.llvm.org/D43121?vs=133619&id=133620#toc Repository:

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1130 +if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BraceWrapping.AfterObjCDeclaration) +addUnwrappedLine(); benhamilton wrote: > Typz wrote: > > Wonderin

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-12 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. When a block is started after a case label, clang-format does add extra indent to the content of this block: the block content is indented one level (with respect to the switch) while the closing brace is not indented, an

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Do you have a reference to style guides recommending any of this? Unfortunately not... I think this is a really advanced topic, and often not recommended way to format code at all (e.g. "if you need a block, you may as well use a function"). I can find the current implem

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek, benhamilton. ObjC defines `@autoreleasepool` and `@synchronized` control blocks. These used to be formatted according to the `AfterObjCDeclaration` brace- wrapping flag, which is not very consistent. This patch changes t

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. This is done as discussed in https://reviews.llvm.org/D43114. But I can instead add a new `AfterObjCSpecialBlock` brace wrapping flag. Repository: rC Clang https://reviews.llvm.org/D43232 ___ cfe-commits mailing list cfe-com

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked 4 inline comments as done. Typz added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1130 +if (FormatTok->Tok.is(tok::l_brace)) { + if (Style.BraceWrapping.AfterObjCDeclaration) +addUnwrappedLine(); benham

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > We'll just format those cases in a somewhat weird way and users can either > accept that or change their code to not need it. I think we have a really diverging opinion on this. From my experience, people will mostly accept the output of the formatter without question :

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. It is explicitly documented in google style guide: https://google.github.io/styleguide/cppguide.html#Loops_and_Switch_Statements : > case blocks in switch statements can have curly braces or not, depending on > your preference. If you do include curly braces they should be

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Hum, not sure I fully got your proposal. So you actually mean that clang-format you format like this (with 4-space indent for clarity): switch (x) { case 0: break; case 1: { foo(); break; } case 2: { foo(); } break; case 3: {

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-02-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. This patch changes the behavior of PenaltyBreakBeforeFirstCallParameter so that is does not apply when the brace comes after an assignment. This way, variable initialization is wrapped more like an initializer than like

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Tweaking the penalty handling would still be needed in any case, since the problem happens also when Cpp11BracedListStyle is true (though the effect is more subtle) Generally, I think it is better to just rely on penalties, since it gives a way to compare and weight each

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 134411. Typz marked an inline comment as done. Typz added a comment. Address review comments. Repository: rC Clang https://reviews.llvm.org/D43290 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D43183#1008632, @djasper wrote: > Yes, that's what I mean. What do you mean, the style is too error prone? When `IndentCaseLabels` is false, the code gets formatted in a way that "hides" the structure of the code, by indenting the end of the ca

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. A user can create an error by reasoning like this, after the code has been formatted this way (a long time ago) : "oh, I need to make an extra function call, but in all cases ah, here is the end of the switch, let's put my function call here". I am not saying it happe

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D43232#1008004, @benhamilton wrote: > Thanks! Can you add a test for this, please? There are actually tests, though they are performed by activating Allman brace wrapping mode. I am trying to change them, but this highlights another issue: when

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. I'll try to fix this. Can you please review D43114 in the mean time? This patch depends on it, so it must be merged first. Repository: rC Clang https://reviews.llvm.org/D43232 ___ cfe-comm

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked an inline comment as done. Typz added inline comments. Comment at: unittests/Format/FormatTestObjC.cpp:193-198 + verifyFormat("@synchronized(self) {\n" + " f();\n" + "}\n" + "@synchronized(self) {\n" + " f();\

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 134641. Typz added a comment. Fix bug which was lingering: prevent inlining of ObjC special control blocks. Repository: rC Clang https://reviews.llvm.org/D43232 Files: include/clang/Format/Format.h lib/Format/UnwrappedLineFormatter.cpp lib/Format/Unwr

[PATCH] D43114: clang-format: fix formatting of ObjC @synchronized blocks

2018-02-27 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326191: clang-format: fix formatting of ObjC @synchronized blocks (authored by Typz, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D43114?vs=

[PATCH] D43232: clang-format: use AfterControlStatement to format ObjC control blocks

2018-02-27 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326192: clang-format: use AfterControlStatement to format ObjC control blocks (authored by Typz, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D4

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-02-27 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. >> Tweaking the penalty handling would still be needed in any case, since the >> problem happens also when Cpp11BracedListStyle is true (though the effect is >> more subtle) > > I don't understand this. Which style do you actually care about? With > Cpp11BracedListStyle=t

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-02-27 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 136081. Typz added a comment. Prevent breaking between = and { when Cpp11BracedListStyle=false. Repository: rC Clang https://reviews.llvm.org/D43290 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTes

[PATCH] D43290: clang-format: tweak formatting of variable initialization blocks

2018-02-27 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:2183 return 0; +if (Left.Previous && Left.Previous->is(tok::equal) && +!Style.Cpp11BracedListStyle) djasper wrote: > Why is this necessary? Otherwise the `PenaltyBreakBeforeF

[PATCH] D43183: clang-format: introduce `CaseBlockIndent` to control indent in switch

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > I don't agree that that's the same thing. The closing brace is still neatly > aligned with the line of the opening brace (which happens to be just the > opening brace). This invariant is not really applicable to switch statements, where code of each "branch" is already

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang https://reviews.llvm.org/D43015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42787: clang-format: do not add extra indent when wrapping last parameter

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D42787#994781, @djasper wrote: > What I mean is, users will find it surprising if whether or not a parameter > gets wrapped leads to a different indentation internal to that parameter. I > have not heard of a single user that would be surprised

[PATCH] D42729: clang-format: Fix formatting of function body followed by semicolon

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D42729#994841, @djasper wrote: > - Of course you find all sorts of errors while testing clang-format on a > large-enough codebase. That doesn't mean that users run into them much. > - We have had about 10k clang-format users internally for severa

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D42684#1013005, @djasper wrote: > Please given an explanation of what you are trying to achieve with this > change. Do you intend to set the penalty high so that clang-format does other > things first before falling back to wrapping template dec

[PATCH] D37813: clang-format: better handle namespace macros

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Some initial design work has been done, and Krasimir said that he's > interested. No timeline though :( any update or progress maybe? https://reviews.llvm.org/D37813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? https://reviews.llvm.org/D32525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. The problem I have is really related to the current `AlwaysBreakTemplateDeclarations` behavior, which does not apply to functions. I set it to false, and I get this: template<> void ( const bb

[PATCH] D32525: [clang-format] Add SpaceBeforeColon option

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 136299. Typz marked 2 inline comments as done. Typz added a comment. Address review comments. Repository: rC Clang https://reviews.llvm.org/D32525 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/Format.cpp lib/Format

[PATCH] D43015: clang-format: Introduce BreakInheritanceList option

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 136300. Typz marked an inline comment as done. Typz added a comment. Address review comments, and rebase on https://reviews.llvm.org/D32525 Repository: rC Clang https://reviews.llvm.org/D43015 Files: docs/ClangFormatStyleOptions.rst include/clang/Format

  1   2   3   4   >