[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305384: clang-format: Add CompactNamespaces option (authored by Typz). Changed prior to commit: https://reviews.llvm.org/D32480?vs=102528=102531#toc Repository: rL LLVM

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. @krasimir : ping https://reviews.llvm.org/D33589 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33823: [clang-format] Support sorting using declarations

2017-06-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/UsingDeclarationsSorter.cpp:66 + } + return HasIdentifier && Tok && Tok->isOneOf(tok::semi, tok::comma); +} could also be followed by an assignment, in case of type alias: using foo = bar::foo;

[PATCH] D34238: clang-format: Do not binpack initialization lists

2017-06-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102809. Typz added a comment. fix indent https://reviews.llvm.org/D34238 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

[PATCH] D33491: clang-format: Fix C99 designated initializers corner cases

2017-06-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102803. Typz added a comment. Fix incorrect labelling as ObjCMethodExpr https://reviews.llvm.org/D33491 Files: lib/Format/ContinuationIndenter.cpp lib/Format/FormatToken.h lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index:

[PATCH] D34238: clang-format: Do not binpack initialization lists

2017-06-16 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102808. Typz marked an inline comment as done. Typz added a comment. remove special case after assignment https://reviews.llvm.org/D34238 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

[PATCH] D34238: clang-format: Do not binpack initialization lists

2017-06-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D34238#781224, @malcolm.parsons wrote: > Some people write > > auto x = std::map{ >{ 0, "foo fjakfjaklf kljj" }, >{ 1, "bar fjakfjaklf kljj" }, >{ 2, "stuff fjakfjaklf kljj" }, >}; This case (and

[PATCH] D34238: clang-format: Do not binpack initialization lists

2017-06-15 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102672. Typz added a comment. fix unit tests https://reviews.llvm.org/D34238 Files: lib/Format/ContinuationIndenter.cpp unittests/Format/FormatTest.cpp unittests/Format/FormatTestComments.cpp Index: unittests/Format/FormatTestComments.cpp

[PATCH] D33491: clang-format: Fix C99 designated initializers corner cases

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

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-06-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. @krasimir, @alexfh : can I get some feedback? This patch solves a practical problem, i.e. allowing the comment to overflow a bit without triggering a reflow [according to the priorities which are in config, obviously]. It may not always provide the "best" wrapping, but as

[PATCH] D33491: clang-format: Fix C99 designated initializers corner cases

2017-06-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 103018. Typz marked 2 inline comments as done. Typz edited the summary of this revision. Typz added a comment. Fix review comments https://reviews.llvm.org/D33491 Files: lib/Format/ContinuationIndenter.cpp lib/Format/FormatToken.h

[PATCH] D33491: clang-format: Fix C99 designated initializers corner cases

2017-06-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: unittests/Format/FormatTest.cpp:1526 + verifyFormat("const struct A a = {[0] = 1, [1] = 2};"); + verifyFormat("const struct A a = {[1] = a,\n" + "[2] = b,\n" djasper

[PATCH] D33447: clang-format: add option to merge empty function body

2017-06-13 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305272: clang-format: add option to merge empty function body (authored by Typz). Changed prior to commit: https://reviews.llvm.org/D33447?vs=100420=102294#toc Repository: rL LLVM

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102525. Typz added a comment. Make tests more readable https://reviews.llvm.org/D32480 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/NamespaceEndCommentsFixer.cpp lib/Format/UnwrappedLineFormatter.cpp

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102528. Typz marked an inline comment as done. Typz added a comment. Move tests that add or fix namespace end comments to NamespaceEndCommentsFixerTest.cpp https://reviews.llvm.org/D32480 Files: include/clang/Format/Format.h lib/Format/Format.cpp

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-06-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 102346. Typz added a comment. - make "compacted" namespaces always add at most one level of indentation - compact only namespaces which both start and end on consecutive lines https://reviews.llvm.org/D32480 Files: include/clang/Format/Format.h

[PATCH] D33314: clang-format: Add option to remove semicolon at end of namespace

2017-05-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Is this not the same reasoning as the whole NamespaceEndCommentsFixer? https://reviews.llvm.org/D33314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33314: clang-format: Add option to remove semicolon at end of namespace

2017-05-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. I stumbled on the issue when working on the CompactNamespaces option, where the extra semicolon prevents merging the closing braces. There was an easy fix, which guaranteed that the closing braces would be properly merged, so I went for

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-06-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D33589#769893, @krasimir wrote: > I think that what you're trying to solve is not practically that important, > is unlikely to improve the handling of comments, and will add a lot of > complexity. Not sure the 'approach' I have in this patch

[PATCH] D32480: clang-format: Add CompactNamespaces option

2017-06-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. So how do I proceed? 1. Keep the CompactNamespace option, and make "compacted" namespaces always add at most one level of indentation 2. Or assume that this can only ever usefully work with the behavior of NI_None and add an additional enum value NI_Compact. And should

[PATCH] D33447: clang-format: add option to merge empty function body

2017-06-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping https://reviews.llvm.org/D33447 ___ 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-09-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Other macros are used to declare namespaces, and should thus be handled similarly. This is the case for crpcut's TESTSUITE macro, or for unittest-cpp's SUITE macro: TESTSUITE(Foo) { TEST(MyFirstTest) { assert(0); } } // TESTSUITE(Foo) This patch deals

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

2017-09-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked 8 inline comments as done. Typz added inline comments. Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:155 const FormatToken *NamespaceTok = AnnotatedLines[StartLineIndex]->First; - // Detect "(inline)? namespace" in the beginning of a line. - if

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

2017-09-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 115054. Typz marked 2 inline comments as done. Typz added a comment. Fix review comments, before splitting the commit. https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h

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

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 115802. 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] D33440: clang-format: better handle statement macros

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 115801. Typz marked 5 inline comments as done. Typz added a comment. Add tests. Replace sorted list with hashtable. https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. For one thing, we need to update the state to store the "decision" of the reflowing mode, which is performed only in DryRun=true mode, to avoid doing the computation multiple times. Apart from this, the decision is conceptually internal to breakProtrudingToken(). But the

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D33589#875039, @djasper wrote: > I think doing the computation twice is fine. Or at least, I'd need a test > case where it actually shows substantial overhead before doing what you are > doing here. Understand that creating more States and

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > I am still trying to get to the bottom of this assertion, any hint where to > look for? OK, got it. The issue is that we will actually need to run the wrapping 3 times when DryRun = false : call reflowProtrudingToken() twice with DryRun=true to find out the better

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 115830. Typz added a comment. Remove `Reflow` from LineState, and perform the decision again during reconstruction phase. https://reviews.llvm.org/D33589 Files: lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h

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

2017-09-19 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/FormatTokenLexer.cpp:642 tok::pp_define) && -std::find(ForEachMacros.begin(), ForEachMacros.end(), - FormatTok->Tok.getIdentifierInfo()) != ForEachMacros.end()) { - FormatTok->Type =

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-20 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. This cannot be implemented where we currently call breakProtrudingToken(), since this function starts by 'creating' the BreakableToken and dealing with meany corner cases: so this should be done before in any case. But the code at the end of breakProtrudingToken() is

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 115051. Typz added a comment. Reorder the functions to minimize diff. https://reviews.llvm.org/D33589 Files: lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp

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

2017-09-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 115057. Typz added a comment. Split diff: handle only statements in here, namespace macros will be moved to another one. https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h

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

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

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? https://reviews.llvm.org/D33589 ___ 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 and namespace macros

2017-09-11 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] D33440: clang-format: better handle statement and namespace macros

2017-09-12 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 114783. Typz added a comment. Rebase to master to fix merge issue https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/FormatTokenLexer.cpp lib/Format/FormatTokenLexer.h

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-09-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:1339 +unsigned ContinuationIndenter::breakProtrudingToken(const FormatToken , +LineState , djasper wrote: > Can you create a patch

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-11-23 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > @klimek wrote: > In the above example, we add 3 line breaks, and we'd add 1 (or more) > additional line breaks when reflowing below the column limit. > I agree that that can lead to different overall outcomes, but I don't see > how the approach of this patch really

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

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

2017-11-20 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-11-20 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] D33589: clang-format: consider not splitting tokens in optimization

2017-11-21 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D33589#925903, @klimek wrote: > I think this patch doesn't handle a couple of cases that I'd like to see > handled. A counter-proposal with different trade-offs is in > https://reviews.llvm.org/D40068. It may be simpler (though not to my

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-11-21 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Btw, another issue I am having is that reflowing does not respect the alignment. For exemple: enum { Foo,///< This is a very long comment Bar,///< This is shorter BarBar, ///< This is shorter } Stuff; will be reflown to : enum { Foo,

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-11-21 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D33589#924716, @klimek wrote: > One interesting trade-off I'm running into: > My gut feeling is that we really want to make local decisions about whether > we want to break/reflow - this makes the code significantly simpler (IMO), > and

[PATCH] D40068: Implement more accurate penalty & trade-offs while breaking protruding tokens.

2017-11-21 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Generally, this indeed improves the situation (though I cannot say much about the code itself, it is still too subtle for my shallow knowledge of clang-format). But it seems to give some strange looking result with long comments: it seems like the decision is made at

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

2017-11-09 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] D32478: [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set

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

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

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

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

2017-11-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Sorry for the long response time. I don't see this style rule expressed > explicitly in the Skia or QtCreator style guides - is this something that > just happens to be done sometimes in the code bases? This is present in code base. Those project's style guides are not

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

2017-11-09 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-11-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D33440#920205, @djasper wrote: > Out of curiosity, will this be able to fix the two situations that you get > for python extension? > There, you usually have a PyObject_HEAD with out semicolon in a struct and > than a PyObject_HEAD_INIT(..) in

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

2017-11-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Unless I'm missing something, I'd agree with Daniel; this is not a rule > that's widely used, and I'd say reformatting a code base to the > clang-formatted variant will not regress readability. Unfortunately coding rules are not just about readability, but also about

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

2017-11-09 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 18. Typz marked 5 inline comments as done. Typz added a comment. Address review comments https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/FormatTokenLexer.cpp

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

2017-12-05 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. I don't think this is really relevant for this tool: if someone changes the implementation of the macro, then *they* must indeed if it should not be formatted like a namespace (and keep the clang-format configuration unchanged), or if it should now be formatted like a

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

2017-12-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Definitely that would be much more expressive. But this approach is also incomplete: in case of namespace (and possibly others?), we also need to perform the reverse operation, e.g. to "generate" a macro call for rewriting the closing comment. On top of this, I think

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-12-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. I think the difference between code and comments is that code "words" are easily 10 characters or more, whereas actual words (in comments) are very often less than 10 characters: so code overflowing by 10 characters is not very frequent. whereas small words in comment

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-12-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Indeed, looks good, thanks! Though that exacerbates the alignment issue, I now get things like this: enum { SomeLongerEnum, // comment SomeThing, // comment Foo, // something } ^ (column limit) The comment on 'Foo' would

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

2017-12-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. As far as "parsing" and formatting inside the block is concerned, this is indeed unrelated (and would totally work if all macros where specified with some preprocessor definitions). But identifying the 'opening' token and generating the matching 'closing' comment are

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

2017-12-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Ok, that's probably where our different opinions come from - I would want a > macro to be formatted to reflect how it's implemented, because otherwise I'm > going to be surprised when I look at the implementation, and I consider > surprises to be something to avoid in

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

2017-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D37813#876227, @klimek wrote: > I think instead of introducing more and more special cases of macros we might > want to handle, we should instead allow specifying macro productions globally. what do you mean? Do you mean to group all the macro

[PATCH] D33589: clang-format: consider not splitting tokens in optimization

2017-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > My question is: if CanBreak is false, we currently don't call > breakProtrudingToken. So either we do something very wrong in that case > (which might be true, but I'd like to understand why) or we should be able > to just calculate the penalty by not breaking anything

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

2017-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 120085. 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] D33440: clang-format: better handle statement macros

2017-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 120084. Typz added a comment. rebase https://reviews.llvm.org/D33440 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/FormatToken.h lib/Format/FormatTokenLexer.cpp lib/Format/FormatTokenLexer.h

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

2017-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? https://reviews.llvm.org/D32478 ___ 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

[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

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

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

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

[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

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

[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

[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

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

2018-06-11 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 150755. Typz added a comment. rebase 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

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

2018-06-11 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC334408: clang-format: Introduce BreakInheritanceList option (authored by Typz, committed by ). Changed prior to commit: https://reviews.llvm.org/D43015?vs=150755=150756#toc Repository: rC Clang

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

2018-06-08 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] D37813: clang-format: better handle namespace macros

2018-06-08 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. ping? Repository: rC Clang 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] D42787: clang-format: do not add extra indent when wrapping last parameter

2018-06-08 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Would it be acceptable to introduce an option to allow enabling this behavior? I mean would it have a chance of being integrated, or must I keep maintaining a fork of clang-format... Repository: rC Clang https://reviews.llvm.org/D42787

[PATCH] D48161: clang-format: Fix documentation generation

2018-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 151313. Typz added a comment. Add missing block, for consistency Repository: rC Clang https://reviews.llvm.org/D48161 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h Index: include/clang/Format/Format.h

[PATCH] D48161: Fix documentation generation

2018-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. It seems that the changes done to `ClangFormatStyleOptions.rst` @334408 are causing the generation of the documentation to fail, with the following error: Warning, treated as error:

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

2018-06-12 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D42787#1127790, @djasper wrote: > The normal rule for formatting options apply. If you can dig up a public > style guide and a project of reasonable size where it is used, we can add an > option. I don't want to be rude, but it seems to me

[PATCH] D48161: clang-format: Fix documentation generation

2018-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 151342. Typz added a comment. rebase Repository: rC Clang https://reviews.llvm.org/D48161 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h Index: include/clang/Format/Format.h

[PATCH] D48161: clang-format: Fix documentation generation

2018-06-14 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL334709: clang-format: Fix documentation generation (authored by Typz, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D48161 Files:

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

2018-01-30 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. Introduce ``PenaltyBreakTemplateDeclaration`` to control the penalty, and change ``AlwaysBreakTemplateDeclarations`` to an enum with 3 modes: - ``None`` for automatic (e.g. penalty based) wrapping of template

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

2018-01-30 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 131946. Typz added a comment. fix commit message 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.cpp

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

2018-01-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:1911 + if (Next && Next->is(tok::l_brace) && Next->BlockKind == BK_BracedInit) + Next->BlockKind = BK_Block; +} this may actually not be enough in all cases: to completely

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

2018-01-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. There are actually other cases, e.g. with macros "containing" the semicolon: void abort() { FOO() BAR() }; gets reformatted to this (still wrong with this patch, but the space after the parenthesis is added): void abort(){ FOO() BAR() }; And also this one

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

2018-01-31 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. In https://reviews.llvm.org/D42729#993159, @djasper wrote: > I think this case is not important enough to fix. Please tell users to just > delete the useless semicolon. I would agree if were simple to spot: but often this may manifest itself only with a missing space

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

2018-02-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > You might doubt it, but having written the code I can tell you that it's the > case. Ok, you win :-) > I see the argument why this indentation is not necessary in exactly the case > where the last parameter is multi-line and not wrapped to a new line itself: > You

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

2018-02-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. I doubt this particular was intentional, esp. since this case never happens in the tests. I think it is more a side-effect of the (general) indent in "fake" parenthesis. Here is an exemple: Before this change: foo(a, bb +

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

2018-02-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > I don't think cases where there is only a semicolon-less macro are > particularly frequent/important either. You probably could even add a > semicolon in those cases, right? How frequent are such cases in your > codebase? Either way, they aren't fixed by this patch, so

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

2018-02-01 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Typz added reviewers: krasimir, djasper, klimek. There should be no extra indent when wrapping only the expression used as last argument. This is consistent with the behavior when the first (and only) argument's expression is wrapped. foo(a, bb +

<    1   2   3   4   >