[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 lib/Format/FormatTok

[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 lib/Format/TokenAnnota

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

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

[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 unittests/Format/Forma

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

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

2019-06-06 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 https://lists.llvm.org/cgi-bin/mailman/list

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

2019-06-06 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 https://lists.llvm.org/cgi-bin/mailman/lis

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

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

2019-06-06 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 203425. Typz added a comment. Rebase Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D37813/new/ https://reviews.llvm.org/D37813 Files: docs/ClangFormatStyleOptions.rst include/clang/Format/Format.h lib/Format/Format.cpp l

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

2019-06-06 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL362740: clang-format: better handle namespace macros (authored by Typz, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACT

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

[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] 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 https://lis

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

2019-05-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. The patch goal is indeed to indent the content of namespace-macro blocks like the content of any 'regular' namespace. So it should look like the content of a namespace, possibly depending on the choose style options. To sumarize, here is a detailed summary of the observabl

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

2019-05-22 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/D50078/new/ https://reviews.llvm.org/D50078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[PATCH] D57184: [clang-format] Allow configuring list of function-like macros that resolve to a type

2019-05-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Herald added a project: clang. Regarding variable/setting names, one issue I see is that these macros are not really type //names// IMO : the macro name is just part of the type (like a template), and its invocation is a type declaration. So maybe renaming to `Typedecl` or

[PATCH] D57184: [clang-format] Allow configuring list of function-like macros that resolve to a type

2019-05-22 Thread Francois Ferrand via Phabricator via cfe-commits
Typz accepted this revision. Typz added a comment. This revision is now accepted and ready to land. Actually, looking at all the other options, the same is true for all other macro kind of macros (NamespaceMacros...). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/

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

2019-05-23 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. Herald added a project: clang. In D50147#1310146 , @sammccall wrote: > In D50147#1309880 , @Typz wrote: > > > ping? > > > Sorry for losing track of this. > > I think `-style=` is a logical exte

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

2019-05-23 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. > Ah, wow, I see what confused me now: > In the fixNamespaceEndComment tests you use an indent that clang-format > would not produce. Can you please fix that, otherwise I find this super > confusing :) Can you point a specific exemple (in code) ? There are many tests rel

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

2019-05-24 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", Should I also fix these tests? They al

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

2019-05-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 201693. Typz marked 3 inline comments as done. Typz added a comment. Herald added subscribers: ormris, mgorny. - Rebased - Adapt styles search path to platform conventions - Allow customizing search path at compile time - Allow overriding search path at runtime t

[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/ https://reviews.llvm.org/D3781

[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

[PATCH] D57184: [clang-format] Allow configuring list of function-like macros that resolve to a type

2019-05-29 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC361986: [clang-format] Allow configuring list of function-like macros that resolve to a… (authored by Typz, committed by ). Changed prior to commit: https://reviews.llvm.org/D57184?vs=201395&id=201962#t

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

2019-10-17 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. This actually depends on another Diff : https://reviews.llvm.org/D32478 That other change introduces the ability to "unindent operator", which is required here; however, it also changes AlignOperands to have more than 2 modes, which does not seem to be acceptable. Before m

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

2019-10-23 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 226163. Typz added a comment. Rebased on master, integrating required code from https://reviews.llvm.org/D32478 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ https://reviews.llvm.org/D50078 Files: c

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

2019-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 226218. Typz marked 2 inline comments as done. Typz added a comment. Fix corner in previous rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ https://reviews.llvm.org/D50078 Files: clang/lib/Forma

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

2019-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 226245. Typz added a comment. Fix earlier error in patch upload. 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

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

2019-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 226246. Typz added a comment. . 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/Format/ContinuationIndenter.

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

2019-10-24 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:5739 + " ? ccc\n" + " : ddd;"); verifyFormat("bool aa = a //\n" MyDeveloperDay w

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

2019-10-25 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 226380. Typz added a comment. Implement a fallback to regularly indented alignment when the question mark is wrapped. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D50078/new/ https://reviews.llvm.org/D50078 File

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

2019-10-25 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked 3 inline comments as done. Typz added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1125 + if (Current.is(TT_ConditionalExpr) && Current.is(tok::question) && + ((Current.MustBreakBefore) || + (Current.getNextNonComment() && Curren

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

2019-10-25 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 226393. Typz added a comment. Rebase on top of D50078 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D32478/new/ https://reviews.llvm.org/D32478 Files: clang/docs/ClangFormatStyl

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

2019-10-25 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked 2 inline comments as done. Typz added inline comments. Comment at: clang/include/clang/Format/Format.h:187 /// expressions. - /// - /// Specifically, this aligns operands of a single expression that needs to be - /// split over multiple lines, e.g.: - /// \cod

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

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

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

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

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

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

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

2017-07-28 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 108651. Typz added a comment. Rebase https://reviews.llvm.org/D33589 Files: lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.

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

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

[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] 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 lib/Forma

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

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

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

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

2017-06-28 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-06-29 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: include/clang/Format/Format.h:167 +/// \endcode +OAS_StrictAlign, + }; djasper wrote: > The name is not intuitive. I don't think this is any more or less strict than > the other version. It is a bit stricter in th

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

2017-06-30 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306868: clang-format: Do not binpack initialization lists (authored by Typz). Changed prior to commit: https://reviews.llvm.org/D34238?vs=103057&id=104914#toc Repository: rL LLVM https://reviews.llv

[PATCH] D34395: clang-format: add options to merge empty record body

2017-06-30 Thread Francois Ferrand via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL306874: clang-format: add options to merge empty record body (authored by Typz). Repository: rL LLVM https://reviews.llvm.org/D34395 Files: cfe/trunk/include/clang/Format/Format.h cfe/trunk/lib/Fo

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

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

2017-07-05 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-07-12 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 106221. Typz marked 3 inline comments as done. Typz added a comment. Rename option to AlignAfterOperator https://reviews.llvm.org/D32478 Files: include/clang/Format/Format.h lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h lib/Form

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

2017-07-12 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. I renamed the option to `AlignAfterOperator`, is it acceptable now? (I also thought of `UnindentOperator`, but I think it is better to keep the notion of alignment) Note that this style is used in multiple open-source projects: Skia , parts of QtCreator

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

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

2017-07-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added inline comments. Comment at: lib/Format/UnwrappedLineFormatter.cpp:723 FormatDecision LastFormat = Node->State.NextToken->Decision; if (LastFormat == FD_Unformatted || LastFormat == FD_Continue) +addNextStateToQueue(Penalty, Node, /*NewLine=*/fals

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

2017-07-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz marked 2 inline comments as done. Typz added inline comments. Comment at: lib/Format/UnwrappedLineFormatter.cpp:723 FormatDecision LastFormat = Node->State.NextToken->Decision; if (LastFormat == FD_Unformatted || LastFormat == FD_Continue) +addNextState

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

2017-07-13 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 106442. Typz added a comment. Move code out of optimizer, directly into ContinuationIndenter::breakProtrudingToken(), to minimize impact on performance. Comment reflowing of breakable items which break the limit will be slightly slower, since we now consider th

[PATCH] D35483: clang-format: fix block OpeningLineIndex around preprocessor

2017-07-17 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Herald added a subscriber: klimek. The current code would return an incorrect value when a preprocessor directive is present immediately after the opening brace: this causes the nanespace end comment fixer to break in some places, for exemple it would not add the commen

[PATCH] D35483: clang-format: fix block OpeningLineIndex around preprocessor

2017-07-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 107030. Typz marked an inline comment as done. Typz added a comment. Add more tests https://reviews.llvm.org/D35483 Files: lib/Format/UnwrappedLineParser.cpp lib/Format/UnwrappedLineParser.h unittests/Format/NamespaceEndCommentsFixerTest.cpp Index: unit

[PATCH] D35557: clang-format: merge short case labels with trailing comments

2017-07-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz created this revision. Herald added a subscriber: klimek. Allow merging short case labels when they actually end with a comment (like a comment after the ``break``) and when followed by switch-level comments (e.g. aligned with next case): switch(a) { case 0: break; // comment at end of c

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

2017-07-18 Thread Francois Ferrand via Phabricator via cfe-commits
Typz added a comment. t>>! In https://reviews.llvm.org/D33440#812645, @djasper wrote: > So, there are two things in this patch: Statement macros and namespace > macros. Lets break this out and handle them individually. They really aren't > related that much. Indeed, the only "relation" is the

[PATCH] D35557: clang-format: merge short case labels with trailing comments

2017-07-23 Thread Francois Ferrand via Phabricator via cfe-commits
Typz updated this revision to Diff 107841. Typz marked 4 inline comments as done. Typz added a comment. Address review comments https://reviews.llvm.org/D35557 Files: lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp ==

<    1   2   3   4   >