[PATCH] D24322: clang-format: [JavaScript] Do requoting in a separate pass

2016-09-07 Thread Daniel Jasper via cfe-commits
djasper created this revision. djasper added a reviewer: mprobst. djasper added a subscriber: cfe-commits. Herald added a subscriber: klimek. The attempt to fix requoting behavior in r280487 after changes to tooling::Replacements are incomplete. We essentially need to add to replacements at the

Re: [PATCH] D24322: clang-format: [JavaScript] Do requoting in a separate pass

2016-09-07 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1707 @@ +1706,3 @@ + if (NewCode) { +auto NewEnv = Environment::CreateVirtualEnvironment( +*NewCode, FileName, mprobst wrote: > I guess we don't worry about the performance c

r280874 - clang-format: [JavaScript] Do requoting in a separate pass

2016-09-07 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Sep 7 17:48:53 2016 New Revision: 280874 URL: http://llvm.org/viewvc/llvm-project?rev=280874&view=rev Log: clang-format: [JavaScript] Do requoting in a separate pass The attempt to fix requoting behavior in r280487 after changes to tooling::Replacements are incomplete.

Re: [PATCH] D24322: clang-format: [JavaScript] Do requoting in a separate pass

2016-09-07 Thread Daniel Jasper via cfe-commits
djasper closed this revision. djasper added a comment. Submitted as r280874. https://reviews.llvm.org/D24322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r280878 - clang-format: [JavaScript] Change default AllowShortFunctionsOnASingleLine

2016-09-07 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Sep 7 18:01:13 2016 New Revision: 280878 URL: http://llvm.org/viewvc/llvm-project?rev=280878&view=rev Log: clang-format: [JavaScript] Change default AllowShortFunctionsOnASingleLine for Google style to "empty". Modified: cfe/trunk/lib/Format/Format.cpp cfe/trunk

Re: [PATCH] D24400: Also cleanup comments around redundant colons/commas in format::cleanup.

2016-09-09 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1141 @@ -1134,1 +1140,3 @@ deleteToken(DeleteLeft ? Left : Right); +// Delete all comments between `Left` and `Right`. +for (auto *Comment : Comments) Couldn't you just do:

Re: [PATCH] D24400: Also cleanup comments around redundant colons/commas in format::cleanup.

2016-09-09 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. One remark, otherwise looks good. Comment at: lib/Format/Format.cpp:1136 @@ +1135,3 @@ +for (auto *Tok = Left->Next; Tok && Tok != Right; Tok = Tok->Next) +

Re: [PATCH] D24383: Add addOrMerge interface to tooling::Replacements.

2016-09-10 Thread Daniel Jasper via cfe-commits
djasper added a comment. This seems like a pretty weird function to have in the interface. Could you explain what use case(s) you are envisioning? https://reviews.llvm.org/D24383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

Re: [PATCH] D18313: clang-format: Make include sorting's main include detection configurable.

2016-09-10 Thread Daniel Jasper via cfe-commits
djasper closed this revision. djasper marked 6 inline comments as done. djasper added a comment. Submitted as r263943. Comment at: include/clang/Format/Format.h:415 @@ +414,3 @@ + /// as the "main" include in both a.cc and a_test.cc. + std::string IncludeMainRegex; + -

Re: [PATCH] D24401: clang-format: Add Java detection to git-clang-format.

2016-09-10 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Looks good. Repository: rL LLVM https://reviews.llvm.org/D24401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.or

Re: [PATCH] D21026: [clang-format] append newline after code when inserting new headers at the end of the code which does not end with newline.

2016-09-10 Thread Daniel Jasper via cfe-commits
djasper added a comment. Does this still work with the new Replacements? Comment at: lib/Format/Format.cpp:1572 @@ +1571,3 @@ +// When inserting headers at end of the code, also insert a '\n' at the end +// of the code if it does not ends with '\n'. +// The way of in

Re: [PATCH] D21279: Fix some issues in clang-format's AlignConsecutive modes

2016-09-10 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/WhitespaceManager.cpp:47 @@ +46,3 @@ + +int WhitespaceManager::Change::ScopeLevel() const { + // NestingLevel is raised on the opening paren/square, and remains raised What I don't understand is why you have t

Re: [PATCH] D24395: Align declarations that are preceded by different number of commas.

2016-09-10 Thread Daniel Jasper via cfe-commits
djasper added a comment. I think this will also be solved by https://reviews.llvm.org/D21279. https://reviews.llvm.org/D24395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D24383: Add addOrMerge interface to tooling::Replacements.

2016-09-10 Thread Daniel Jasper via cfe-commits
There are several things I find particularly confusing about this. Fundamentally, Replacements refer to a specific version of the code. Say you have a Replacements object R and a Replacement r that you want to integrate into it. Further assume, that C0 is the initial version of the code whereas C1

r281203 - clang-format: Make emacs integration work with narrowed buffers.

2016-09-12 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Sep 12 05:02:46 2016 New Revision: 281203 URL: http://llvm.org/viewvc/llvm-project?rev=281203&view=rev Log: clang-format: Make emacs integration work with narrowed buffers. Use (call-process region nil ...) instead of (point-min) so that the call works in narrowed buffer

Re: [PATCH] D24383: Add addOrMerge interface to tooling::Replacements.

2016-09-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. Ok.. Thought some more and discussed with Manuel. I think we should do a partial solution for now. I still think addOrMerge is harmful and it is always never the right thing to use. The codepaths that currently implement some version of it, should likely reconsider. Wh

Re: [PATCH] D24383: Add addOrMerge interface to tooling::Replacements.

2016-09-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. The problem is that it is implicit behavior, that's not easy to understand. What's worse is that the behavior of add and merge would fundamentally be reverse. If you add two inserts at the same location, the first one would come first. If you merge them, the second one

Re: [PATCH] D24501: Remove redundant comma around parenthesis in parameter list.

2016-09-13 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: unittests/Format/CleanupTest.cpp:147 @@ +146,3 @@ + // Trailing comma in braces is not removed. + std::string Code = "void f() { std::vector v = {1,2,,,3,{4,5,}}; }"; + std::string Expected = "void f() { std::vector v = {1,2,3,{4,5,}};

Re: [PATCH] D24501: Remove redundant comma around parenthesis in parameter list.

2016-09-13 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Some remarks, but looks good. Comment at: unittests/Format/CleanupTest.cpp:38 @@ +37,3 @@ + // Returns code after cleanup around \p Offsets. + std::string cleanupAroundOff

Re: [PATCH] D24477: clang-format: [JS] Do not wrap taze: IWYU comments

2016-09-13 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Generally looks good. Comment at: unittests/Format/FormatTestJS.cpp:1433 @@ +1432,3 @@ +TEST_F(FormatTestJS, ImportComments) { + verifyFormat("import {x} from 'x'; // from

Re: [PATCH] D24515: Supports adding insertion around non-insertion replacements.

2016-09-14 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Core/Replacement.h:172 @@ +171,3 @@ + /// - They do not overlap. + /// - One replacement is insertion, and the other is a replacement with + /// length > 0, and the insertion is adjecent to but not contain

Re: [PATCH] D24515: Supports adding insertion around non-insertion replacements.

2016-09-14 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Looks good. Comment at: include/clang/Tooling/Core/Replacement.h:172 @@ -169,1 +171,3 @@ + /// - aren't both inserts at the same code location. + /// Note: two insertion

Re: [PATCH] D24574: clang-format: [JS] ASI insertion after boolean literals.

2016-09-14 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Interesting.. Would have expected true/false to be literals as well, but ok :). https://reviews.llvm.org/D24574 ___ cfe-commits mailing list cf

r281816 - clang-format: [JS] Fix a crash in handledTemplateStrings.

2016-09-17 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sat Sep 17 02:20:36 2016 New Revision: 281816 URL: http://llvm.org/viewvc/llvm-project?rev=281816&view=rev Log: clang-format: [JS] Fix a crash in handledTemplateStrings. Modified: cfe/trunk/lib/Format/FormatTokenLexer.cpp cfe/trunk/unittests/Format/FormatTestJS.cpp

r297931 - clang-format: Fix bug in wrapping behavior of operators.

2017-03-16 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Mar 16 02:54:11 2017 New Revision: 297931 URL: http://llvm.org/viewvc/llvm-project?rev=297931&view=rev Log: clang-format: Fix bug in wrapping behavior of operators. Before (even violating the column limit): auto Diag = diag() << (aaa

Re: r298676 - Fix handling of initialization from parenthesized initializer list.

2017-03-27 Thread Daniel Jasper via cfe-commits
Hi Richard, this seems to have an unwanted side-effect on -Wunused-value (test case attached). Could you take a look? Cheers, Daniel On Fri, Mar 24, 2017 at 2:14 AM, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Thu Mar 23 20:14:25 2017 > New Revisi

Re: r298676 - Fix handling of initialization from parenthesized initializer list.

2017-03-27 Thread Daniel Jasper via cfe-commits
-Wunused-value is always triggered if a constructor of an object with a non-trivial destructor has an initializer list as first parameter. So in the test, even "Used({});" triggers -Wunused-value. That seems inconsistent (replacing the init list with something else silences the warning) and also th

r298853 - Look through CXXBindTemporaryExprs when checking CXXFunctionCastExprs

2017-03-27 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Mar 27 11:29:41 2017 New Revision: 298853 URL: http://llvm.org/viewvc/llvm-project?rev=298853&view=rev Log: Look through CXXBindTemporaryExprs when checking CXXFunctionCastExprs for unused values. This fixes a regression caused by r298676, where constructor calls to clas

r299204 - clang-format: [JavaScript] Ignore QT keywords.

2017-03-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Mar 31 07:04:37 2017 New Revision: 299204 URL: http://llvm.org/viewvc/llvm-project?rev=299204&view=rev Log: clang-format: [JavaScript] Ignore QT keywords. Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp cfe/trunk/unittests/Format/FormatTestJS.cpp Modified

r299214 - clang-format: Fix post-commit review comment of r299204, use Style.isCpp().

2017-03-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Mar 31 08:30:24 2017 New Revision: 299214 URL: http://llvm.org/viewvc/llvm-project?rev=299214&view=rev Log: clang-format: Fix post-commit review comment of r299204, use Style.isCpp(). Also, while at it, s/IsCpp/isCpp/ so that it follows LLVM style. Modified: cfe/tru

r300661 - clang-format: Properly match parens of macro parameter lists.

2017-04-18 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Apr 19 01:06:38 2017 New Revision: 300661 URL: http://llvm.org/viewvc/llvm-project?rev=300661&view=rev Log: clang-format: Properly match parens of macro parameter lists. No tests yet, but this will be tested by the upcoming: https://reviews.llvm.org/D28462 Modified:

r291801 - clang-format: Treat braced lists like other complex parameters.

2017-01-12 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Jan 12 13:35:26 2017 New Revision: 291801 URL: http://llvm.org/viewvc/llvm-project?rev=291801&view=rev Log: clang-format: Treat braced lists like other complex parameters. Specifically, wrap before them if they are multi-line so that we don't create long hanging indents.

r291807 - clang-format: Fix regression introduced by r291801.

2017-01-12 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Jan 12 14:06:28 2017 New Revision: 291807 URL: http://llvm.org/viewvc/llvm-project?rev=291807&view=rev Log: clang-format: Fix regression introduced by r291801. Uncovered by polly tests. Before: aa(aaa,

r291974 - clang-format: Fix bug in making line break decisions.

2017-01-13 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Jan 13 17:18:16 2017 New Revision: 291974 URL: http://llvm.org/viewvc/llvm-project?rev=291974&view=rev Log: clang-format: Fix bug in making line break decisions. Here, the optimization to not line wrap when it would not lead to a reduction in columns was overwriting and

Re: r291905 - [Sema] Add warning for unused lambda captures

2017-01-15 Thread Daniel Jasper via cfe-commits
This patch seems to break on some of our code. Reproducer: $ cat /tmp/ctor.cc template struct A { A() {} }; template class B : T { using T::T; }; struct C { B> d; C(A b) : d(b) {} }; djasper@dj:~/llvm/release$ bin/clang -cc1 -std=c++11 /tmp/ctor.cc /tmp/ctor.cc:13:17: error: no matchi

Re: r291905 - [Sema] Add warning for unused lambda captures

2017-01-15 Thread Daniel Jasper via cfe-commits
Sorry, for the noise. This is probably not the revision that caused this. On Mon, Jan 16, 2017 at 1:08 AM, Daniel Jasper wrote: > This patch seems to break on some of our code. Reproducer: > > $ cat /tmp/ctor.cc > template > struct A { > A() {} > }; > > template > class B : T { > using T::

r292110 - clang-format: Always wrap before multi-line parameters/operands.

2017-01-16 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Jan 16 07:13:15 2017 New Revision: 292110 URL: http://llvm.org/viewvc/llvm-project?rev=292110&view=rev Log: clang-format: Always wrap before multi-line parameters/operands. Before: aa(, aaa::

r292116 - Fix test failures after recent clang-format format change.

2017-01-16 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Jan 16 07:43:46 2017 New Revision: 292116 URL: http://llvm.org/viewvc/llvm-project?rev=292116&view=rev Log: Fix test failures after recent clang-format format change. Modified: cfe/trunk/test/Index/overriding-ftemplate-comments.cpp Modified: cfe/trunk/test/Index/ove

r293465 - clang-format: [JavaScript] Undo r291974 for JavaScript.

2017-01-29 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Jan 30 01:08:40 2017 New Revision: 293465 URL: http://llvm.org/viewvc/llvm-project?rev=293465&view=rev Log: clang-format: [JavaScript] Undo r291974 for JavaScript. This had significant negative consequences and I don't have a good solution for it yet. Before: var stri

r293616 - [clang-format] Refactor WhitespaceManager and friends

2017-01-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Jan 31 05:25:01 2017 New Revision: 293616 URL: http://llvm.org/viewvc/llvm-project?rev=293616&view=rev Log: [clang-format] Refactor WhitespaceManager and friends The main motivation behind this is to cleanup the WhitespaceManager and make it more extensible for future al

r293618 - clang-format: [JS] Fix incorrect line break in template strings.

2017-01-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Jan 31 06:07:35 2017 New Revision: 293618 URL: http://llvm.org/viewvc/llvm-project?rev=293618&view=rev Log: clang-format: [JS] Fix incorrect line break in template strings. Before: var f = ` ${a ? 'a' : 'b' }`; After: var f = ` ${

r293622 - clang-format: [JS] Properly set scopes inside template strings.

2017-01-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Jan 31 07:03:07 2017 New Revision: 293622 URL: http://llvm.org/viewvc/llvm-project?rev=293622&view=rev Log: clang-format: [JS] Properly set scopes inside template strings. Before: var f = `a:${aaa .a} a:

r293636 - clang-format: [JS] Indent expressions in ${} relative to their surrounding

2017-01-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Jan 31 08:39:33 2017 New Revision: 293636 URL: http://llvm.org/viewvc/llvm-project?rev=293636&view=rev Log: clang-format: [JS] Indent expressions in ${} relative to their surrounding This only affects expressions inside ${} scopes of template strings. Here, we want to in

r293752 - clang-format: Don't force-wrap multiline RHSs for 2-operand experssions.

2017-02-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 1 03:23:39 2017 New Revision: 293752 URL: http://llvm.org/viewvc/llvm-project?rev=293752&view=rev Log: clang-format: Don't force-wrap multiline RHSs for 2-operand experssions. This rows back on r288120, r291801 and r292110. I apologize in advance for the churn. All

r293754 - Fix Index test after recent clang-format change.

2017-02-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 1 04:00:10 2017 New Revision: 293754 URL: http://llvm.org/viewvc/llvm-project?rev=293754&view=rev Log: Fix Index test after recent clang-format change. Modified: cfe/trunk/test/Index/overriding-ftemplate-comments.cpp Modified: cfe/trunk/test/Index/overriding-ft

r293839 - clang-format: Fix incorrect line breaks after forced operator wraps.

2017-02-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 1 17:27:37 2017 New Revision: 293839 URL: http://llvm.org/viewvc/llvm-project?rev=293839&view=rev Log: clang-format: Fix incorrect line breaks after forced operator wraps. Before: bool x = a // || b // || ;

r293875 - clang-format: Do not use two-argument/operand special case with no alignment

2017-02-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Feb 2 02:30:21 2017 New Revision: 293875 URL: http://llvm.org/viewvc/llvm-project?rev=293875&view=rev Log: clang-format: Do not use two-argument/operand special case with no alignment Without alignment, there is no clean separation between the arguments, even if there a

r293995 - clang-format: [Proto] Also supports implicit string literal concatenation

2017-02-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Feb 3 02:29:02 2017 New Revision: 293995 URL: http://llvm.org/viewvc/llvm-project?rev=293995&view=rev Log: clang-format: [Proto] Also supports implicit string literal concatenation Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unittests/Format/Form

r294009 - clang-format: [JS] Fix bugs in parsing and aligning template strings.

2017-02-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Feb 3 08:32:38 2017 New Revision: 294009 URL: http://llvm.org/viewvc/llvm-project?rev=294009&view=rev Log: clang-format: [JS] Fix bugs in parsing and aligning template strings. Modified: cfe/trunk/lib/Format/ContinuationIndenter.cpp cfe/trunk/lib/Format/TokenAnn

r294179 - clang-format: Fix bug with conflicting BreakBeforeBinaryOperations and AlignAfterOpenBracket

2017-02-06 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 6 04:55:49 2017 New Revision: 294179 URL: http://llvm.org/viewvc/llvm-project?rev=294179&view=rev Log: clang-format: Fix bug with conflicting BreakBeforeBinaryOperations and AlignAfterOpenBracket Fix for the formatting options combination of BreakBeforeBinaryOperat

r294358 - clang-format: Fix bad variable declaration detection.

2017-02-07 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Feb 7 15:38:16 2017 New Revision: 294358 URL: http://llvm.org/viewvc/llvm-project?rev=294358&view=rev Log: clang-format: Fix bad variable declaration detection. Before: LongType variable(nullptr, [](A *a) {}); After: LongType

r306804 - Fix heap use after free introduced by r306769.

2017-06-30 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Jun 30 01:02:37 2017 New Revision: 306804 URL: http://llvm.org/viewvc/llvm-project?rev=306804&view=rev Log: Fix heap use after free introduced by r306769. Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp URL: h

r295437 - clang-format: Don't remove existing spaces between identifier and ::.

2017-02-17 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Feb 17 04:44:07 2017 New Revision: 295437 URL: http://llvm.org/viewvc/llvm-project?rev=295437&view=rev Log: clang-format: Don't remove existing spaces between identifier and ::. This can lead to bad behavior with macros that are used to annotate functions (e.g. ALWAYS_IN

r295658 - clang-format: [JS/TS] Improve detection for array subscripts in types.

2017-02-20 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 20 06:43:41 2017 New Revision: 295658 URL: http://llvm.org/viewvc/llvm-project?rev=295658&view=rev Log: clang-format: [JS/TS] Improve detection for array subscripts in types. Before: var someValue = (v as [ ]).someFunction(

r295659 - clang-format: Prevent weird line-wraps in complex lambda introducers

2017-02-20 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 20 06:43:48 2017 New Revision: 295659 URL: http://llvm.org/viewvc/llvm-project?rev=295659&view=rev Log: clang-format: Prevent weird line-wraps in complex lambda introducers Before: a.( [a

r295663 - clang-format: [JS] Improve line-wrapping behavior of template strings.

2017-02-20 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 20 08:51:16 2017 New Revision: 295663 URL: http://llvm.org/viewvc/llvm-project?rev=295663&view=rev Log: clang-format: [JS] Improve line-wrapping behavior of template strings. Specifically, similar to other blocks, clang-format now wraps both after "${" and before the

r296499 - clang-format: [Java] Fix bug in enum formatting.

2017-02-28 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Feb 28 12:28:15 2017 New Revision: 296499 URL: http://llvm.org/viewvc/llvm-project?rev=296499&view=rev Log: clang-format: [Java] Fix bug in enum formatting. Before: public enum VeryLongEnum { ENUM_WITH_MANY_PARAMETERS("aa",

r296605 - clang-format: Ignore contents of #ifdef SWIG .. #endif blocks.

2017-03-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 1 04:47:52 2017 New Revision: 296605 URL: http://llvm.org/viewvc/llvm-project?rev=296605&view=rev Log: clang-format: Ignore contents of #ifdef SWIG .. #endif blocks. Those blocks are used if C++ code is SWIG-wrapped (see swig.org) and usually do not contain C++ code

r296608 - Fix r296605 so that stuff in #ifndef SWIG blocks is still formatted.

2017-03-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 1 05:10:11 2017 New Revision: 296608 URL: http://llvm.org/viewvc/llvm-project?rev=296608&view=rev Log: Fix r296605 so that stuff in #ifndef SWIG blocks is still formatted. Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp cfe/trunk/unittests/Format/Form

r296659 - clang-format: [JS/TS] Properly understand cast expressions.

2017-03-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 1 13:26:12 2017 New Revision: 296659 URL: http://llvm.org/viewvc/llvm-project?rev=296659&view=rev Log: clang-format: [JS/TS] Properly understand cast expressions. Many things were wrong: - We didn't always allow wrapping after "as", which can be necessary. - We used

r296664 - clang-format: [JS] Properly format object literals with shorthands.

2017-03-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 1 13:47:28 2017 New Revision: 296664 URL: http://llvm.org/viewvc/llvm-project?rev=296664&view=rev Log: clang-format: [JS] Properly format object literals with shorthands. Before: return { a, b: 'b', c, }; After: return { a, b: 'b', c, };

Re: r297034 - [clang-format] Add tests for ambiguous namespaces to the comment fixer

2017-03-06 Thread Daniel Jasper via cfe-commits
On Mon, Mar 6, 2017 at 6:29 PM, Krasimir Georgiev via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: krasimir > Date: Mon Mar 6 11:29:25 2017 > New Revision: 297034 > > URL: http://llvm.org/viewvc/llvm-project?rev=297034&view=rev > Log: > [clang-format] Add tests for ambiguous namespa

cfe-commits@lists.llvm.org

2017-03-08 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 8 03:49:12 2017 New Revision: 297268 URL: http://llvm.org/viewvc/llvm-project?rev=297268&view=rev Log: clang-format: Get slightly better at understanding */&. Before: void f() { MACRO(A * const a); } After: void f() { MACRO(A *const a); } Modified: cfe/tru

r297696 - clang-format: Make it very slighly more expensive to wrap between "= {".

2017-03-13 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Mar 13 19:40:32 2017 New Revision: 297696 URL: http://llvm.org/viewvc/llvm-project?rev=297696&view=rev Log: clang-format: Make it very slighly more expensive to wrap between "= {". This prevents unwanted fallout from r296664. Specifically in proto formatting, this change

r288119 - clang-format: Fix unnnecessary line break.

2016-11-29 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 29 03:40:01 2016 New Revision: 288119 URL: http://llvm.org/viewvc/llvm-project?rev=288119&view=rev Log: clang-format: Fix unnnecessary line break. Before: aa((, ), // , a); After: aa

r288121 - clang-format: [JS] Properly format dict literals that skip labels.

2016-11-29 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 29 03:40:36 2016 New Revision: 288121 URL: http://llvm.org/viewvc/llvm-project?rev=288121&view=rev Log: clang-format: [JS] Properly format dict literals that skip labels. Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unittests/Format/FormatTestJ

r288120 - clang-format: Wrap complex binary expressions on the RHS of a comma.

2016-11-29 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 29 03:40:32 2016 New Revision: 288120 URL: http://llvm.org/viewvc/llvm-project?rev=288120&view=rev Log: clang-format: Wrap complex binary expressions on the RHS of a comma. Specifically, if the RHS of a comma is a complex binary expression and spans multiple lines, i

r288626 - Revert "Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semant

2016-12-04 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sun Dec 4 16:34:37 2016 New Revision: 288626 URL: http://llvm.org/viewvc/llvm-project?rev=288626&view=rev Log: Revert "Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still

Re: r288449 - Recover better from an incompatible .pcm file being provided by -fmodule-file=.

2016-12-04 Thread Daniel Jasper via cfe-commits
This is unfortunately causing problems as is, as it can change the diagnostic that's created when the include of a module with config-mismatch is inside a namespace. I have tried to fix this for a bit, but I am not sure what the right solution is. For now, I have reverted this in r288626 and left t

r289428 - clang-format: Separate out a language kind for ObjC.

2016-12-12 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Dec 12 06:42:29 2016 New Revision: 289428 URL: http://llvm.org/viewvc/llvm-project?rev=289428&view=rev Log: clang-format: Separate out a language kind for ObjC. While C(++) and ObjC are generally formatted the same way and can be mixed, people might want to choose differ

r289525 - clang-format: Improve braced-list detection.

2016-12-13 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Dec 13 04:05:03 2016 New Revision: 289525 URL: http://llvm.org/viewvc/llvm-project?rev=289525&view=rev Log: clang-format: Improve braced-list detection. Before: vector v { 12 } GUARDED_BY(mutex); After: vector v{12} GUARDED_BY(mutex); Modified: cfe/trunk/

r289531 - clang-format: Keep string-literal-label + value pairs on a line.

2016-12-13 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Dec 13 05:16:42 2016 New Revision: 289531 URL: http://llvm.org/viewvc/llvm-project?rev=289531&view=rev Log: clang-format: Keep string-literal-label + value pairs on a line. We have previously done that for <<-operators. This patch also adds this logic for "," and "+". B

r301182 - clang-format: Fix bad corner case in formatting of function types.

2017-04-24 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Apr 24 09:28:49 2017 New Revision: 301182 URL: http://llvm.org/viewvc/llvm-project?rev=301182&view=rev Log: clang-format: Fix bad corner case in formatting of function types. Before: std::function< LngTemplatedType*( Long

Re: r301735 - Fix PR32831: 'this capture while instantiating generic lambda call operator specialization

2017-05-02 Thread Daniel Jasper via cfe-commits
I'll revert this as it makes the following snippet makes clang crash: class SomeClass { public: void foo() { auto l = [this] { auto l = [] EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; }; } Mutex mu_; }; (e.g. this can be added to test/SemaCXX/warn-thread-safety-parsing.cpp) >From a brief look at

r301916 - Revert r301735 (and subsequent r301786).

2017-05-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue May 2 07:38:27 2017 New Revision: 301916 URL: http://llvm.org/viewvc/llvm-project?rev=301916&view=rev Log: Revert r301735 (and subsequent r301786). It leads to clang crashing, e.g. on this short code fragment (added to test/SemaCXX/warn-thread-safety-parsing.cpp): cl

Re: r301916 - Revert r301735 (and subsequent r301786).

2017-05-02 Thread Daniel Jasper via cfe-commits
I forgot the () in the lambda definition, this should be: .. auto l = [this] { auto l = []() EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; }; .. Doesn't change the fact that clang segfaults without this revert, though. On Tue, May 2, 2017 at 2:38 PM, Daniel Jasper via cfe-commits < cfe

r301963 - Revert r301822 (and dependent r301825), which tried to improve the

2017-05-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue May 2 14:21:42 2017 New Revision: 301963 URL: http://llvm.org/viewvc/llvm-project?rev=301963&view=rev Log: Revert r301822 (and dependent r301825), which tried to improve the handling of constexprs with unknown bounds. This triggers a corner case of the language where it

r302003 - Silences gcc's -Wnarrowing.

2017-05-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed May 3 02:48:27 2017 New Revision: 302003 URL: http://llvm.org/viewvc/llvm-project?rev=302003&view=rev Log: Silences gcc's -Wnarrowing. I think this is a false positive in GCC's warning, but nonetheless, we should try to be warning-free. Smaller reproducer (reproduces wi

r302012 - Undo turning ExtBehavior into a bitfield.

2017-05-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed May 3 06:27:34 2017 New Revision: 302012 URL: http://llvm.org/viewvc/llvm-project?rev=302012&view=rev Log: Undo turning ExtBehavior into a bitfield. This produces warnings that I can't explain in a GCC build: In file included from ../tools/clang/include/clang/Lex/LexDi

r302428 - [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding

2017-05-08 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon May 8 10:08:00 2017 New Revision: 302428 URL: http://llvm.org/viewvc/llvm-project?rev=302428&view=rev Log: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign This converts the clang-format option AlignEscapedNewlinesLeft from a boolean to an en

r303037 - Revert r302965 - [modules] When creating a declaration, cache its owning

2017-05-15 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon May 15 02:51:10 2017 New Revision: 303037 URL: http://llvm.org/viewvc/llvm-project?rev=303037&view=rev Log: Revert r302965 - [modules] When creating a declaration, cache its owning module immediately Also revert dependent r302969. This is leading to crashes. Will provide

Re: r302965 - [modules] When creating a declaration, cache its owning module immediately

2017-05-15 Thread Daniel Jasper via cfe-commits
This was leading to many crashers. Reverted in r303037. On Sat, May 13, 2017 at 1:27 AM, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: rsmith > Date: Fri May 12 18:27:00 2017 > New Revision: 302965 > > URL: http://llvm.org/viewvc/llvm-project?rev=302965&view=rev > L

[PATCH] D25768: [Format] Cleanup after replacing constructor body with = default

2016-10-19 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Looks good. https://reviews.llvm.org/D25768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D25769: [clang-tidy] Simplify modernize-use-default

2016-10-20 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a reviewer: djasper. djasper added a comment. I don't know whether it is an intentional choice to remove this comment. I'd be fine either way (I think there are arguments for and against it). So, this looks good to me. But maybe Eric has something to

[PATCH] D25675: clang-format: [JS] Fix template string ASI.

2016-10-20 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added inline comments. This revision is now accepted and ready to land. Comment at: unittests/Format/FormatTestJS.cpp:1280 +TEST_F(FormatTestJS, TemplateStringASI) { + verifyFormat("var x = `hello${world}`;", "var x = `hello${\n" +

[PATCH] D25439: Fixed column shift when formatting line containing bit shift operators

2016-10-23 Thread Daniel Jasper via cfe-commits
djasper added a comment. Generally, always upload diffs with the full file as context to phabricator. That way, it is easier to see how the diff fits into the rest of the file. Thanks for fixing this!! Comment at: lib/Format/FormatTokenLexer.cpp:528 FormatTok->TokenText

[PATCH] D25439: Fixed column shift when formatting line containing bit shift operators

2016-10-24 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Looks good. Thank you! https://reviews.llvm.org/D25439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

[PATCH] D26125: [clang-tidy] Fixed else-after-return warning in cascade if statement

2016-10-30 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/readability/ElseAfterReturnCheck.cpp:28 stmt(forEach( - ifStmt(hasThen(stmt( + ifStmt(unless(hasParent(ifStmt())), + hasThen(stmt( I think this now effectively does:

[PATCH] D26125: [clang-tidy] Fixed else-after-return warning in cascade if statement

2016-10-30 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/readability/ElseAfterReturnCheck.cpp:28 stmt(forEach( - ifStmt(hasThen(stmt( + ifStmt(unless(hasParent(ifStmt())), + hasThen(stmt( idlecode wrote: > djasper wrote: > >

[PATCH] D26125: [clang-tidy] Fixed else-after-return warning in cascade if statement

2016-10-30 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/readability/ElseAfterReturnCheck.cpp:28 stmt(forEach( - ifStmt(hasThen(stmt( + ifStmt(unless(hasParent(ifStmt())), + hasThen(stmt( idlecode wrote: > djasper wrote: > >

[PATCH] D26125: [clang-tidy] Fixed else-after-return warning in cascade if statement

2016-10-30 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/readability/ElseAfterReturnCheck.cpp:28 stmt(forEach( - ifStmt(hasThen(stmt( + ifStmt(unless(hasParent(ifStmt())), + hasThen(stmt( idlecode wrote: > djasper wrote: > >

[PATCH] D26132: [clang-format] Skip over AnnotatedLines with >50 levels of nesting.

2016-10-31 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Looks good. https://reviews.llvm.org/D26132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

r285569 - clang-format: [JS] Fix missing space after 'yield'.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Oct 31 08:18:25 2016 New Revision: 285569 URL: http://llvm.org/viewvc/llvm-project?rev=285569&view=rev Log: clang-format: [JS] Fix missing space after 'yield'. Before: class X { delete(val) { return null; } * gen() { yield[1, 2]; } * gen

r285570 - Skip over AnnotatedLines with >50 levels of nesting; don't format them.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Oct 31 08:23:00 2016 New Revision: 285570 URL: http://llvm.org/viewvc/llvm-project?rev=285570&view=rev Log: Skip over AnnotatedLines with >50 levels of nesting; don't format them. Reasoning: - ExpressionParser uses a lot of stack for these, bad in some environments. - Ou

[PATCH] D26132: [clang-format] Skip over AnnotatedLines with >50 levels of nesting.

2016-10-31 Thread Daniel Jasper via cfe-commits
djasper closed this revision. djasper added a comment. Committed as r285570. https://reviews.llvm.org/D26132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r285674 - clang-format: Fix bug in function reference qualifier detection.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 1 01:23:19 2016 New Revision: 285674 URL: http://llvm.org/viewvc/llvm-project?rev=285674&view=rev Log: clang-format: Fix bug in function reference qualifier detection. Before: template void F(T) && = delete; After: template void F(T) && = delete

r285670 - clang-format: [JS] Fix formatting of generator functions.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 1 01:22:59 2016 New Revision: 285670 URL: http://llvm.org/viewvc/llvm-project?rev=285670&view=rev Log: clang-format: [JS] Fix formatting of generator functions. Before: var x = { a: function* () { // } } After: var x = { a: f

r285671 - clang-format: Fix incorrect binary operator detection.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 1 01:23:05 2016 New Revision: 285671 URL: http://llvm.org/viewvc/llvm-project?rev=285671&view=rev Log: clang-format: Fix incorrect binary operator detection. Before: int x = f(* + [] {}); After: int x = f(*+[] {}); Modified: cfe/trunk/lib/Format/TokenAnnot

r285672 - clang-format: [JS] Fix incorrect space when "as" is used as identifier.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 1 01:23:10 2016 New Revision: 285672 URL: http://llvm.org/viewvc/llvm-project?rev=285672&view=rev Log: clang-format: [JS] Fix incorrect space when "as" is used as identifier. Before: a.as (); After: a.as(); Modified: cfe/trunk/lib/Format/TokenAnnot

r285669 - clang-format: [JS] Fix space when for is used as regular identifier.

2016-10-31 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Nov 1 01:22:54 2016 New Revision: 285669 URL: http://llvm.org/viewvc/llvm-project?rev=285669&view=rev Log: clang-format: [JS] Fix space when for is used as regular identifier. Before: x.for () = 1; After: x.for() = 1; Modified: cfe/trunk/lib/Format/TokenAnnota

<    1   2   3   4   5   6   7   8   >