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

2018-01-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 132198. Typz added a comment. Force wrap after multi-line template declaration Repository: rC Clang https://reviews.llvm.org/D42684 Files: include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/Format.cpp

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

2018-02-05 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 132837. Typz added a comment. Use StatementMacro detection to improve brace type detection heuristics (in UnwrappedLineParser::calculateBraceTypes). https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp

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

2018-02-05 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 132838. Typz added a comment. rebase 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] D42729: clang-format: Fix formatting of function blocks followed by semicolon

2018-01-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. In some case, the heuristic used to identify the type of blocks (in UnwrappedLineParser) mistakens a Block for a BracedInit, when the TokenAnnotator eventually finds (correclty) that this is a function declaration. This

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

2018-01-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 132130. Typz added a comment. update commit message Repository: rC Clang https://reviews.llvm.org/D42729 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

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

2018-02-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 132341. Typz added a comment. If the template declaration spans multiple lines, force wrap before the function/class declaration Repository: rC Clang https://reviews.llvm.org/D42684 Files: include/clang/Format/Format.h

[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

[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] D32525: [clang-format] Add SpaceBeforeColon option

2018-02-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Indeed, I have yet find more precisely documented coding rules which require this format, but I thought I could at least address the non-precise aspect of the patch itself in the mean-time. https://reviews.llvm.org/D32525

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

2018-02-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 132963. Typz added a comment. Split the option into 3 separate options: SpaceBeforeCtorInitializerColon, SpaceBeforeInheritanceColon and SpaceBeforeRangeBasedForLoopColon. This makes each option clearer and more consistent, with no ambiguities due to

[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=133620#toc Repository: rC

[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,

[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:

[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: > >

[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

[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();

[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

[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

[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

[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] 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)

[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:

[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

[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

[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

[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;

[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,

[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

[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:

[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

[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

[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:

[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" + "

[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 ___

[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

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

2018-08-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D50078#1184015, @djasper wrote: > - I'd be ok with the suggestion for BreakBeforeTernaryOperators=true Just to be clear, which suggestion would you be ok with? int fooo = ? 0 : ? 1 : ; or:

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

2018-08-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D50078#1184159, @krasimir wrote: > Could you clarify how each piece is supposed to be aligned in these examples? > This is what makes me happy: > > // column limit V > int a = condition1 ? result1 > : conditio2 ? result2

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

2018-08-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. Herald added a subscriber: acoomans. This patch allows defining external styles, which can be used exactly like the embedded styles (llvm, google, mozilla...). These styles are clang-format files installed either

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

2018-07-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Notes: - I choose not to add an option to enable this behavior, as I think of it as just another way clang-format can (better) format the code; but I can one if needed - Currently, it relies on another patch (https://reviews.llvm.org/D32478), which supports aligning the

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

2018-07-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 158302. Typz added a comment. Herald added a subscriber: acoomans. rebase Repository: rC Clang https://reviews.llvm.org/D32478 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp

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

2018-07-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 158313. Typz added a comment. Herald added a subscriber: acoomans. Regenerate documentation Repository: rC Clang https://reviews.llvm.org/D43183 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/Format.cpp

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

2018-07-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. Herald added a subscriber: acoomans. When multiple ternary operators are chained, e.g. like an if/else-if/ else-if/.../else sequence, clang-format will keep aligning the colon with the question mark, which increases the

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

2018-07-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 158308. Typz marked an inline comment as done. Typz added a comment. Herald added a subscriber: acoomans. Regenerate documentation Repository: rC Clang https://reviews.llvm.org/D33440 Files: docs/ClangFormatStyleOptions.rst

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

2018-07-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 158309. Typz added a comment. Herald added a subscriber: acoomans. Regeneration documentation Repository: rC Clang https://reviews.llvm.org/D37813 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/Format.cpp

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

2018-08-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Ping! This has been stale for a while now. Last comment indicate this is not the right approach, but some prototyping has been done a more generic approach, with no timeline. I understand this, but in the meantime the problem is still there, with no solution at the

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

2018-09-04 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. clang-format does indeed support .clang-format, which is great for *isolated* projects, and which is not affected by this patch. This patch addresses the issue of *centralizing* the definition of styles, e.g. allowing individual projects to reference externally defined

[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

[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:

[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=136483#toc Repository: rC Clang

[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:

[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] 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] 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-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] 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,

[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

[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] 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] 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] 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] 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

[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:

[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

[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 >

[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

[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

[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] 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] 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

[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

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

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

[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. Indeed, seems to apply to classes as well. Maybe I was mislead by my testing, where I did not get the case (possibly because we use `ConstructorInitializerAllOnOneLineOrOnePerLine=true`, so the continuation indenter only sees "short" class declarations unless breaking the

[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

[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

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

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 136305. 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

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

2018-02-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: unittests/Format/FormatTest.cpp:8969 + "barr(1) {}", CtorInitializerStyle); + CtorInitializerStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma; +

[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#1022081, @djasper wrote: > But you *do* want extra indentation in the case of: > > function(a, >b + >cc); > > > I understand you argument, but I don't agree at the moment. As is (without > getting

[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

[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] 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

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

2018-10-29 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D50147#1272742, @sammccall wrote: > The idea here does seem to be a natural extension of -style, at least for the > case when the arg is a filename directly. I'm not opposed, happy to review > this. > > I do want to probe the use case a bit

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

2018-10-29 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D50147#1272742, @sammccall wrote: > Being able to discover the right style from the filesystem is powerful, and > if I was going to use this flag, I'd consider symlinking the style-file to > `subproject/.clang_format` instead. That way the

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

2018-10-03 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D37813#1184051, @klimek wrote: > The problem here is that we have different opinions on how the formatting on > namespace macros should behave in the first place- I think they should behave > like namespaces, you want them to be formatted

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

2018-10-02 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343602: clang-format: better handle statement macros (authored by Typz, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

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

2018-10-04 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D37813#1254865, @klimek wrote: > In https://reviews.llvm.org/D37813#1253813, @Typz wrote: > > > In https://reviews.llvm.org/D37813#1184051, @klimek wrote: > > > > > The problem here is that we have different opinions on how the formatting > > >

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

2018-09-25 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D50147#1244237, @krasimir wrote: > I don't understand the use-case this patch is realizing. Suppose I have a > bunch of projects that have to share a format style. Then I can checkout them > under a common root directory and put an appropriate

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

2018-11-27 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D37813/new/ https://reviews.llvm.org/D37813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2018-11-27 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

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

2018-11-27 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping ? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ https://reviews.llvm.org/D50078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2019-05-17 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Herald added a project: clang. ping ? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D37813/new/ https://reviews.llvm.org/D37813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2019-06-07 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In D50147#157 , @sammccall wrote: > One thing that's unclear to me is whether your aim is to > > 1. solve a concrete problem for your organization > 2. solve a family of problems for similar organizations > 3. add a new way of

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

2019-05-29 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 201936. Typz marked an inline comment as done. Typz added a comment. - Rebase - Fix NamespaceEndCommentsFixerTest to match LLVM indent style Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D37813/new/

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

2019-05-29 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked 2 inline comments as done. Typz added inline comments. Comment at: unittests/Format/NamespaceEndCommentsFixerTest.cpp:526 EXPECT_EQ("namespace A {\n" " int i;\n" "} // namespace A", klimek wrote: > Typz wrote: > > Should

<    1   2   3   4   >