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

2016-08-11 Thread Daniel Jasper via cfe-commits
djasper added a comment. Sorry :(... Review is easy enough.. Feel free to ping me more often in the future. Comment at: lib/Format/WhitespaceManager.cpp:95 @@ -97,2 +94,3 @@ std::sort(Changes.begin(), Changes.end(), Change::IsBeforeInFile(SourceMgr)); + calculateScopeLevel(

Re: [PATCH] D23434: Don't allow llvm-include-order to intermingle includes from different files.

2016-08-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. I think we should entirely drop this implementation of the check and let it just check #includes with clang-format. clang-format's implementation isn't a strict superset, e.g. won't sort between multiple blocks, but that's intentional for now. https://reviews.llvm.org

Re: [PATCH] D23434: Don't allow llvm-include-order to intermingle includes from different files.

2016-08-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. I think we got confused. We once had tried to write an experimental separate check to comply with Google's style guide. If you want to fiddle around with that, contact me, I can send you pointers. But as I mentioned we moved away from that. And I think it makes more sen

Re: [PATCH] D23434: Don't allow llvm-include-order to intermingle includes from different files.

2016-08-12 Thread Daniel Jasper via cfe-commits
The check's implementation will be replaced by a simple call to clang tidy. It will remain a check in clang tidy to continue to cater to both use cases. On Aug 12, 2016 6:19 PM, "Zachary Turner" wrote: > That's actually the reason I think it makes more sense in clang tidy. It > can be a configur

Re: [PATCH] D23434: Don't allow llvm-include-order to intermingle includes from different files.

2016-08-12 Thread Daniel Jasper via cfe-commits
I haven't read the patch, but if Alex is ok, so am I.. just wanted to make sure that we don't spend much more time on this, as we are likely going to remove most of the code.. On Aug 12, 2016 6:42 PM, "Zachary Turner" wrote: > Ahh, I see. Just to be clear, is there an LGTM to get this path in?

Re: [PATCH] D23434: Don't allow llvm-include-order to intermingle includes from different files.

2016-08-13 Thread Daniel Jasper via cfe-commits
On Fri, Aug 12, 2016 at 8:22 PM, Zachary Turner wrote: > Sounds good. Just to be clear, you plan to delete the code from > clang-tidy, then take the code from clang-format and move it to clang-tidy, > and have clang-format call clang-tidy (or otherwise share the code somehow > so they both use t

r259351 - clang-format: Fix alignment of trailing multiline columns.

2016-02-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 1 05:20:55 2016 New Revision: 259351 URL: http://llvm.org/viewvc/llvm-project?rev=259351&view=rev Log: clang-format: Fix alignment of trailing multiline columns. Modified: cfe/trunk/lib/Format/WhitespaceManager.cpp cfe/trunk/unittests/Format/FormatTest.cpp

r259353 - clang-format: Fix incorrect pointer detection in lambdas in constructor

2016-02-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 1 05:21:07 2016 New Revision: 259353 URL: http://llvm.org/viewvc/llvm-project?rev=259353&view=rev Log: clang-format: Fix incorrect pointer detection in lambdas in constructor initializers. Before: Constructor() : member([](A *a, B * b) {}) {} After: Constructor

r259350 - clang-format: [JS] Treat "in" as a proper operator.

2016-02-01 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 1 05:20:47 2016 New Revision: 259350 URL: http://llvm.org/viewvc/llvm-project?rev=259350&view=rev Log: clang-format: [JS] Treat "in" as a proper operator. Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp cfe/trunk/unittests/Format/FormatTestJS.cpp Modified

r259487 - clang-format: Make AlignAfterOpenBracket also affect angle brackets.

2016-02-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Feb 2 04:28:11 2016 New Revision: 259487 URL: http://llvm.org/viewvc/llvm-project?rev=259487&view=rev Log: clang-format: Make AlignAfterOpenBracket also affect angle brackets. Patch by Matthew Whitehead, thank you. Modified: cfe/trunk/lib/Format/ContinuationIndente

r259628 - clang-format: [JS/TypeScript] Support "enum" as an optional property name, too.

2016-02-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Feb 2 23:33:44 2016 New Revision: 259628 URL: http://llvm.org/viewvc/llvm-project?rev=259628&view=rev Log: clang-format: [JS/TypeScript] Support "enum" as an optional property name, too. Before: enum?: string []; After: enum?: string[]; Modified: cfe/trunk/l

[clang-tools-extra] r259640 - clang-tidy: [misc-unused-parameters] Ignore template instantiations.

2016-02-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 3 05:33:18 2016 New Revision: 259640 URL: http://llvm.org/viewvc/llvm-project?rev=259640&view=rev Log: clang-tidy: [misc-unused-parameters] Ignore template instantiations. No functional changes intended as we should already do the corresponding fixes when visiting t

r259648 - Provide match function to look over an entire TU again.

2016-02-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 3 08:29:55 2016 New Revision: 259648 URL: http://llvm.org/viewvc/llvm-project?rev=259648&view=rev Log: Provide match function to look over an entire TU again. Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchFinder.h cfe/trunk/unittests/ASTMatchers/ASTM

r259670 - clang-format: Fix formatting of ternary expressions with comments.

2016-02-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 3 11:27:10 2016 New Revision: 259670 URL: http://llvm.org/viewvc/llvm-project?rev=259670&view=rev Log: clang-format: Fix formatting of ternary expressions with comments. Before: int i = aa ? /*=*/bb

r259884 - clang-format: Fix corner case in template detection.

2016-02-05 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri Feb 5 08:17:16 2016 New Revision: 259884 URL: http://llvm.org/viewvc/llvm-project?rev=259884&view=rev Log: clang-format: Fix corner case in template detection. Before: f(a.operator() < A > ()); After: f(a.operator()()); Modified: cfe/trunk/lib/Format/Continuat

r260057 - clang-format: [JS] Support @see annotations in JSDoc comments in Google

2016-02-07 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sun Feb 7 15:22:16 2016 New Revision: 260057 URL: http://llvm.org/viewvc/llvm-project?rev=260057&view=rev Log: clang-format: [JS] Support @see annotations in JSDoc comments in Google style. Modified: cfe/trunk/lib/Format/Format.cpp Modified: cfe/trunk/lib/Format/Format

r260060 - clang-format: [JS] Don't count shortened object literals as blocks.

2016-02-07 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sun Feb 7 16:17:13 2016 New Revision: 260060 URL: http://llvm.org/viewvc/llvm-project?rev=260060&view=rev Log: clang-format: [JS] Don't count shortened object literals as blocks. Before: f({a}, () => { g(); // }); After: f({a}, () => { g(); // });

r260080 - clang-format: Fix weird alignment when not aligning after brackets.

2016-02-08 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 8 03:52:54 2016 New Revision: 260080 URL: http://llvm.org/viewvc/llvm-project?rev=260080&view=rev Log: clang-format: Fix weird alignment when not aligning after brackets. Before: (, // ccc(a, //

Re: [PATCH] D16524: [clang-format-vs] Fix sort include main include: Use current path for the '-assume-filename'

2016-02-10 Thread Daniel Jasper via cfe-commits
djasper added a subscriber: djasper. djasper closed this revision. djasper added a comment. Submitted as r260378. http://reviews.llvm.org/D16524 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/c

r260378 - clang-format sort include use the source file name to determine the

2016-02-10 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Feb 10 06:42:58 2016 New Revision: 260378 URL: http://llvm.org/viewvc/llvm-project?rev=260378&view=rev Log: clang-format sort include use the source file name to determine the "main include" that will be the 1st include (category 0). Because the clang-format visual studi

r260497 - clang-format: Make it more expensive to break template parameters.

2016-02-10 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Feb 11 00:43:01 2016 New Revision: 260497 URL: http://llvm.org/viewvc/llvm-project?rev=260497&view=rev Log: clang-format: Make it more expensive to break template parameters. In particular, make it more expensive than breaking after the return type of a function definiti

r260517 - clang-format: Make indentation after "<<" more consistent.

2016-02-11 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Feb 11 07:15:14 2016 New Revision: 260517 URL: http://llvm.org/viewvc/llvm-project?rev=260517&view=rev Log: clang-format: Make indentation after "<<" more consistent. Before: Diag(, ) << (

r260518 - clang-format: [JS] Support for (.. of ..) loops.

2016-02-11 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Feb 11 07:24:15 2016 New Revision: 260518 URL: http://llvm.org/viewvc/llvm-project?rev=260518&view=rev Log: clang-format: [JS] Support for (.. of ..) loops. Before: for (var i of[2, 3]) {} After: for (var i of [2, 3]) {} Modified: cfe/trunk/lib/Format/FormatTok

r261528 - clang-format: [JS] treat forwardDeclare as an import/export statement.

2016-02-22 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 22 09:06:53 2016 New Revision: 261528 URL: http://llvm.org/viewvc/llvm-project?rev=261528&view=rev Log: clang-format: [JS] treat forwardDeclare as an import/export statement. Patch by Martin Probst. Thank you. Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp

Re: [PATCH] D17439: clang-format: [JS] treat forwardDeclare as an import/export statement.

2016-02-22 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. LG. Submitted as r261528. http://reviews.llvm.org/D17439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

Re: [PATCH] D17440: clang-format: [JS] do not wrap ES6 imports/exports.

2016-02-22 Thread Daniel Jasper via cfe-commits
djasper added a comment. I am missing a decent explanation here. In contrast to C++ #includes as well as goog.require, etc. The import/export statements actually provide syntactic structure and can name multiple entities. Why would it be a good idea to always write them into a single line? ==

r261563 - clang-format: [JS] Add @return to the supported JSDoc pragmas in Google

2016-02-22 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Feb 22 14:24:11 2016 New Revision: 261563 URL: http://llvm.org/viewvc/llvm-project?rev=261563&view=rev Log: clang-format: [JS] Add @return to the supported JSDoc pragmas in Google style. Modified: cfe/trunk/lib/Format/Format.cpp Modified: cfe/trunk/lib/Format/Format

Re: [PATCH] D17385: clang-format: [JS] single quote double quoted strings.

2016-02-24 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1579 @@ +1578,3 @@ + // The width of the extra \ escapes is taken into account in getNextToken. + void requoteJSStringLiterals(tooling::Replacements &Replaces, + FormatToken *Current)

Re: [PATCH] D17621: [clang-format] Detect constructor initializers preceded by `noexcept`.

2016-02-25 Thread Daniel Jasper via cfe-commits
djasper added a comment. Thanks for looking at this. Please also add a test in unittests/Format/FormatTest.cpp. Comment at: lib/Format/TokenAnnotator.cpp:507 @@ -506,3 +506,3 @@ !Line.First->isOneOf(tok::kw_enum, tok::kw_case)) { -if (Tok->Previous->is

Re: [PATCH] D17621: [clang-format] Detect constructor initializers preceded by `noexcept`.

2016-02-26 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. Do you have commit access? http://reviews.llvm.org/D17621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

Re: [PATCH] D17385: clang-format: [JS] single quote double quoted strings.

2016-02-26 Thread Daniel Jasper via cfe-commits
djasper added a comment. Nice, the behavior now seems nicely isolated. Is this a purely stylistic kind of change or do you think every JS developer working on any kind of codebase will want it? Generally this feels like something we should carefully enable with a dedicated style option. Where c

Re: [PATCH] D17385: clang-format: [JS] single quote double quoted strings.

2016-02-26 Thread Daniel Jasper via cfe-commits
djasper added a comment. Sounds like a good plan. Should also mention the corresponding style guide reference in the commit message: https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings http://reviews.llvm.org/D17385 ___

Re: [PATCH] D19482: [include-fixer] Add a find-all-symbols tool for include-fixer.

2016-04-27 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:22-24 @@ +21,5 @@ + +using SymbolInfo = clang::find_all_symbols::SymbolInfo; +using SymbolType = clang::find_all_symbols::SymbolInfo::SymbolType; +using ContextType = clang::find_all_symbo

Re: [PATCH] D19482: [include-fixer] Add a find-all-symbols tool for include-fixer.

2016-04-27 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. Looks good. Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:39 @@ +38,3 @@ +} else { + const auto *RD = llvm::cast(Context); + Symbol->Contexts.emplace_back(SymbolInfo::Record, RD->getName().str

Re: [PATCH] D19587: Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

2016-04-27 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/AffectedRangeManager.h:68 @@ +67,2 @@ +#endif // LLVM_CLANG_LIB_FORMAT_AFFECTEDRANGEMANAGER_H +# ?? http://reviews.llvm.org/D19587 ___ cfe-commits mailing list c

Re: [PATCH] D19587: Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

2016-04-27 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Otherwise looks good. http://reviews.llvm.org/D19587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mail

Re: [PATCH] D19385: [scan-build] fix logic error warnings emitted on clang code base

2016-04-28 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/AffectedRangeManager.cpp:103 @@ -102,1 +102,3 @@ AnnotatedLine *Line, const AnnotatedLine *PreviousLine) { + assert(Line && "does not contain any line"); + klimek wrote: > Perhaps we should change this to

Re: [PATCH] D20054: Fix spurious warnings about unused private field

2016-05-08 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. http://reviews.llvm.org/D20054 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

r268878 - clang-format: Support enum type template arguments.

2016-05-08 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sun May 8 13:12:22 2016 New Revision: 268878 URL: http://llvm.org/viewvc/llvm-project?rev=268878&view=rev Log: clang-format: Support enum type template arguments. Before: template class A { public : E *f(); }; After: template class A { public: E *f(); }; Mod

r268879 - clang-format: Fix space after argument comments.

2016-05-08 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sun May 8 13:14:01 2016 New Revision: 268879 URL: http://llvm.org/viewvc/llvm-project?rev=268879&view=rev Log: clang-format: Fix space after argument comments. Before: f(/*a=*/a, /*b=*/ ::b); After: f(/*a=*/a, /*b=*/::b); Modified: cfe/trunk/lib/Format/TokenAnnota

Re: [PATCH] D20018: Support variables and functions types in misc-unused-using-decls.

2016-05-08 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:63 @@ +62,3 @@ +removeFromFoundDecls(Used->getCanonicalDecl()); + } else if (const auto *DRE = Result.Nodes.getNodeAs("used")) { +if (const auto *FD = dyn_cast(DRE->getDecl())) {

Re: [PATCH] D19804: Make clang-format cleaner remove redundant commas/colons in constructor initializer list.

2016-05-08 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1821 @@ +1820,3 @@ + if (Line->Affected) +checkConstructorInitList(*Line); +} Why are we restricting this to constructor initializers? I think we should directly be more generic and

Re: [PATCH] D20018: Support variables and functions types in misc-unused-using-decls.

2016-05-09 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:39 @@ +38,3 @@ +// Ignores using-declrations defined in class definition. +if (isa(TargetDecl->getDeclContext())) + return; We should also ignore using declarations i

Re: [PATCH] D20018: Support variables and functions types in misc-unused-using-decls.

2016-05-09 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: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:39 @@ +38,3 @@ +// Ignores using-declarations defined in class definition. +if (isa(TargetDecl->get

Re: [PATCH] D20197: [clang-tidy] Ignore using-declarations defined in marcro in misc-unused-using-decls checks.

2016-05-12 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: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:38 @@ -37,1 +37,3 @@ +// Ignores using-declarations defined in macro. +if (Result.SourceManager->

Re: [PATCH] D20197: [clang-tidy] Ignore using-declarations defined in marcro in misc-unused-using-decls checks.

2016-05-12 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: clang-tidy/misc/UnusedUsingDeclsCheck.cpp:39 @@ +38,3 @@ +// Ignores using-declarations defined in macro. +if (Result.SourceManager->isMacroBodyExpansion(TargetDecl->getLocStart()), +Result.SourceManager->isMacroBodyExpans

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. Just two high-level comments. Will review in more depth later. Comment at: include/clang/Format/Format.h:770 @@ +769,3 @@ +/// ``export`` blocks are affected by ``Ranges``. +tooling::Replacements sortJavaScriptIncludes(const FormatStyle &Style, +

Re: [PATCH] D20200: clang-format: [JS] respect clang-format off when requoting strings.

2016-05-12 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. http://reviews.llvm.org/D20200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D19804: Make clang-format cleaner remove redundant commas in list and redundant colon in constructor initializer.

2016-05-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. I experimented a bit. What do you think of this? Comment at: lib/Format/Format.cpp:1822 @@ +1821,3 @@ +cleanupRight(Line->First, Line->Last, tok::comma, tok::comma); +checkConstructorInitList(*Line); + } You could tu

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-12 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:21 @@ -19,1 +20,3 @@ #include "TokenAnnotator.h" +#include "FormatTokenLexer.h" +#include "TokenAnalyzer.h" Use clang-format to fix the order :-) Comment at: lib/Format/FormatToken

Re: [PATCH] D20198: clang-format: [JS] sort ES6 imports.

2016-05-16 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. I think, this looks good. Manuel: Are you fine with this, design-wise? Comment at: lib/Format/SortJavaScriptImports.cpp:77 @@ +76,3 @@ +return false; + // NB: empty UR

Re: [PATCH] D20208: clang-format: [JS] fix template string width counting.

2016-05-16 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Nice. http://reviews.llvm.org/D20208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

Re: [PATCH] D19804: Make clang-format cleaner remove redundant commas in list and redundant colon in constructor initializer.

2016-05-17 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 :-). http://reviews.llvm.org/D19804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/li

Re: [PATCH] D20362: [clang-format] Make formatReplacements() also sort #includes.

2016-05-18 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. I am not even certain whether we want to keep a separate sortIncludes in the interface at all, but as this doesn't change the public API, it doesn't hurt. http://reviews.llvm.o

r270027 - clang-format: Fix enumerator case ranges.

2016-05-18 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu May 19 01:19:17 2016 New Revision: 270027 URL: http://llvm.org/viewvc/llvm-project?rev=270027&view=rev Log: clang-format: Fix enumerator case ranges. Before: case a... b: break; After: case a ... b: break; Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp c

r270028 - clang-format: Fix incorrect indentation in last line of macro definition

2016-05-18 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu May 19 01:30:48 2016 New Revision: 270028 URL: http://llvm.org/viewvc/llvm-project?rev=270028&view=rev Log: clang-format: Fix incorrect indentation in last line of macro definition Before: #define MACRO(a) \ if (a) { \ f(); \ } else

r270029 - clang-format: [JS] Fix spacing in destructuring assignments.

2016-05-19 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu May 19 02:18:07 2016 New Revision: 270029 URL: http://llvm.org/viewvc/llvm-project?rev=270029&view=rev Log: clang-format: [JS] Fix spacing in destructuring assignments. Before: const[a, b, c] = [1, 2, 3]; After: const [a, b, c] = [1, 2, 3]; Modified: cfe/trunk/

r270188 - clang-format: [JS] Treat "for" as a reserved word after a ".".

2016-05-19 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Fri May 20 01:16:01 2016 New Revision: 270188 URL: http://llvm.org/viewvc/llvm-project?rev=270188&view=rev Log: clang-format: [JS] Treat "for" as a reserved word after a ".". Otherwise, clang-format can get confused with statements like: x.for = 1; Modified: cfe/trun

Re: [PATCH] D17852: Added formatAndApplyAllReplacements that works on multiple files in libTooling.

2016-03-29 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Refactoring.h:91 @@ +90,3 @@ + Rewriter &Rewrite, + const format::FormatStyle &Style); + Do you have a use case where we'd want to

Re: [PATCH] D17852: Added formatAndApplyAllReplacements that works on multiple files in libTooling.

2016-03-29 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Refactoring.h:91 @@ +90,3 @@ + Rewriter &Rewrite, + const format::FormatStyle &Style); + ioeric wrote: > djasper wrote: > > Do you

Re: [PATCH] D17852: Added formatAndApplyAllReplacements that works on multiple files in libTooling.

2016-03-29 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/Refactoring.h:93 @@ +92,3 @@ +/// +/// See also "clang/Tooling/Core/Replacements.h". +bool formatAndApplyAllReplacements(const

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-04 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:770 @@ +769,3 @@ +/// \brief Returns the replacements corresponding to applying, fixing, and +/// reformatting \p Replaces. +tooling::Replacements fixReplacements(StringRef Code, I think we s

Re: clang-format: fix for 19986, extra spacing around c++14 lambda capture with initializer

2016-04-05 Thread Daniel Jasper via cfe-commits
Please use reviews.llvm.org to send out clang-format patches. On Mon, Apr 4, 2016 at 10:03 AM, Jacek Sieka via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Hello, > > Here's a little one-off patch that fixes > https://llvm.org/bugs/show_bug.cgi?id=19986 for me, by allowing a few > more thin

r265385 - clang-format: Fix cast detection on "this".

2016-04-05 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Apr 5 06:46:06 2016 New Revision: 265385 URL: http://llvm.org/viewvc/llvm-project?rev=265385&view=rev Log: clang-format: Fix cast detection on "this". Before: auto x = (X) this; After: auto x = (X)this; This fixes llvm.org/PR27198. Modified: cfe/trunk/lib/For

Re: [PATCH] D18793: fix for 19986, extra spacing around c++14 lambda capture with initializer

2016-04-05 Thread Daniel Jasper via cfe-commits
djasper added a comment. Please add tests in unittests/Format/FormatTest.cpp. Comment at: lib/Format/UnwrappedLineParser.cpp:1086 @@ +1085,3 @@ + int parens = 0; + while (!eof()) { +if (FormatTok->isOneOf(tok::l_paren, tok::l_square)) { We need

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-05 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1654 @@ +1653,3 @@ +UnwrappedLines.push_back(SmallVector()); + } + That I don't understand. Almost all fixers (cleaning up commas, constructor initializers, etc.) will only ever look at a singl

r265540 - clang-format: Fix incorrect function annotation detection.

2016-04-06 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Apr 6 08:58:09 2016 New Revision: 265540 URL: http://llvm.org/viewvc/llvm-project?rev=265540&view=rev Log: clang-format: Fix incorrect function annotation detection. Before: MACRO( abc).function() // wrap << abc; After: MACRO(abc).function() // wrap

r265545 - clang-format: Support labels in brace-less ifs.

2016-04-06 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Apr 6 10:02:46 2016 New Revision: 265545 URL: http://llvm.org/viewvc/llvm-project?rev=265545&view=rev Log: clang-format: Support labels in brace-less ifs. While I am not personally convinced about the usefulness of this construct, we should break it. Before: if (a) l

r265557 - clang-format: Fix label-in-if statement in macros where it is actually used.

2016-04-06 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Apr 6 11:41:39 2016 New Revision: 265557 URL: http://llvm.org/viewvc/llvm-project?rev=265557&view=rev Log: clang-format: Fix label-in-if statement in macros where it is actually used. Before: #define A \ if (a) \ label: \ f() After: #define A \ if

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-08 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:769 @@ -768,1 +768,3 @@ +/// \brief Returns the replacements corresponding to applying and fixing +/// \p Replaces. I am actually not sure that fixReplacements is the right terminology here

Re: [PATCH] D18943: clang-format: [JS] do not insert semicolons after wrapped annotations.

2016-04-10 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:708 @@ +707,3 @@ + if (Line && Line->Tokens.size() > 1) { +// If the token before the previous one is an '@', the previous token is an +// annotation and can precede another identifier/value. --

Re: [PATCH] D18943: clang-format: [JS] do not insert semicolons after wrapped annotations.

2016-04-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. Comment at: unittests/Format/FormatTestJS.cpp:689 @@ -688,1 +688,3 @@ "String"); + verifyFormat("function f(@Foo bar) {}"

Re: [PATCH] D18950: clang-format: [JS] Test for parameter annotations.

2016-04-11 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. LG. http://reviews.llvm.org/D18950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-11 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Format/Format.h:800 @@ -793,1 +799,3 @@ +/// \brief Fix any erroneous/redundant code in the given \p Ranges in \p Code. +/// Same as above, "fix" is probably not the right word. "cleanup" seems somewhat b

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. Can you elaborate more on what case this is actually addressing? Are you saying that you have a one-line file without linebreaks that you want clang-format to format? http://reviews.llvm.org/D19031 ___ cfe-commits mailing

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. Passing snippets / single lines from an IDE does not make sense. Don't try to go down this road. clang-format always needs the full file as context. If you are already in an IDE, that IDE should control the line endings, not clang-format. Write a thin wrapper that chang

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Daniel Jasper via cfe-commits
djasper added a comment. It has very basic newline detection, but if possible, I'd like to not significantly increase that. Specifically, I don't think it is worth the complexity of additional configuration options that users have to worry about, if it can just do the right thing (which IMO, it

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-12 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1677 @@ +1676,3 @@ + +class Formatter { +public: I think FormatStyle in the Processor should be const and Formatter should make its own copy to modify it. Comment at: lib/Format/Fo

Re: [PATCH] D19066: clang-format: `SpaceAfterTemplate` and `SpacesInBraces` options

2016-04-13 Thread Daniel Jasper via cfe-commits
djasper added a comment. Please read http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options. The "template" option was discussed multiple times and I remain convinced that the costs outweigh the benefit here. For the other option: - Can you make statements wrt

Re: [PATCH] D19058: clang-format: Pointer `*` is seen as multiplication in C-style casts

2016-04-13 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:1272 @@ +1271,3 @@ +// Casts are never binary operators, regardless of IsExpression +if (NextToken->isOneOf(tok::r_paren, tok::greater)) + return TT_PointerOrReference; I think i

Re: [PATCH] D19063: clang-format: Fixed line merging of more than two lines

2016-04-13 Thread Daniel Jasper via cfe-commits
djasper added a comment. Nice catch. Comment at: unittests/Format/FormatTest.cpp:285 @@ +284,3 @@ + + EXPECT_EQ("class Foo\n" +"{\n" How does this break? I generally add an Before and After of one of the test cases into my patch descriptions. htt

Re: [PATCH] D19064: clang-format: Allow include of clangFormat.h in managed context

2016-04-13 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/Format/Format.h:30 @@ +29,3 @@ +namespace vfs { + +class FileSystem; nit: Remove this empty line. http://reviews.llv

Re: [PATCH] D19065: clang-format: Last line in incomplete block is indented incorrectly

2016-04-13 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. http://reviews.llvm.org/D19065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D19069: clang-format: Fixed various brace wrapping and block merging bugs

2016-04-13 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1388-1390 @@ -1372,3 +1387,5 @@ parseBlock(/*MustBeDeclaration=*/false); -if (Style.BraceWrapping.BeforeElse) +if (Style.BraceWrapping.BeforeElse || +Style.BraceWrapping.AfterControl

Re: [PATCH] D19106: Fixed a bug in AnnotatedLine::startsWith when there are comments in the line.

2016-04-14 Thread Daniel Jasper via cfe-commits
djasper added a comment. Can you add a test? Comment at: lib/Format/TokenAnnotator.h:143 @@ +142,3 @@ + Tok = Tok->Next; +return startsWithInternal(Tok, K1) && + startsWithInternal(Tok->Next, Tokens...); It's a bit subtle that this works even

r266599 - clang-format: Improve heuristics to detect function declarations/definitions.

2016-04-18 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Apr 18 06:31:21 2016 New Revision: 266599 URL: http://llvm.org/viewvc/llvm-project?rev=266599&view=rev Log: clang-format: Improve heuristics to detect function declarations/definitions. Specifically understand ellipses in parameter lists and treat trailing reference qual

[PATCH] D19259: Initial version of misc-unused-using-decl check

2016-04-19 Thread Daniel Jasper via cfe-commits
djasper created this revision. djasper added a reviewer: alexfh. djasper added a subscriber: cfe-commits. http://reviews.llvm.org/D19259 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/UnusedUsingDeclsCheck.cpp clang-tidy/misc/UnusedUsingDeclsCheck

Re: [PATCH] D19242: clang-format: [JS] simplify import/export.

2016-04-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. Comment at: lib/Format/UnwrappedLineParser.cpp:1900 @@ +1899,3 @@ + // to the terminating `;`. For everything else, just return and continue + // parsing the s

Re: [PATCH] D19240: clang-format: [JS] support `interface` as a free standing identifier.

2016-04-19 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:1016 @@ +1015,3 @@ + unsigned StoredPosition = Tokens->getPosition(); + FormatToken *Next = Tokens->getNextToken(); + FormatTok = Tokens->setPosition(StoredPosition); -

Re: [PATCH] D19206: Add a test for "foo as bar" casts.

2016-04-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. http://reviews.llvm.org/D19206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D19204: clang-format: [JS] generator and async functions.

2016-04-19 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: unittests/Format/FormatTestJS.cpp:339 @@ +338,3 @@ + "}"); + verifyFormat("async function* f() {\n" + " yield fetch(x);\n" What does the star mean here? Should we actually introduce a token t

Re: [PATCH] D19259: Initial version of misc-unused-using-decl check

2016-04-19 Thread Daniel Jasper via cfe-commits
djasper marked 3 inline comments as done. Comment at: clang-tidy/misc/MiscTidyModule.cpp:123 @@ -121,1 +122,3 @@ +CheckFactories.registerCheck( +"misc-unused-using-decls"); CheckFactories.registerCheck( alexfh wrote: > I think, all "misc-unused-"

Re: [PATCH] D19259: Initial version of misc-unused-using-decl check

2016-04-19 Thread Daniel Jasper via cfe-commits
djasper updated this revision to Diff 54183. http://reviews.llvm.org/D19259 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/UnusedAliasDeclsCheck.h clang-tidy/misc/UnusedUsingDeclsCheck.cpp clang-tidy/misc/UnusedUsingDeclsCheck.h docs/clang-tid

[clang-tools-extra] r266735 - Initial version of misc-unused-using-decl check.

2016-04-19 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Apr 19 08:48:39 2016 New Revision: 266735 URL: http://llvm.org/viewvc/llvm-project?rev=266735&view=rev Log: Initial version of misc-unused-using-decl check. Added: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp clang-tools-extra/trunk/clang-tid

Re: [PATCH] D19240: clang-format: [JS] support `interface` as a free standing identifier.

2016-04-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. http://reviews.llvm.org/D19240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D19204: clang-format: [JS] generator and async functions.

2016-04-19 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: unittests/Format/FormatTestJS.cpp:339 @@ +338,3 @@ +TEST_F(FormatTestJS, AsyncFunctions) { + verifyFormat("async function f() {\n" + " let x = 1;\n" Fundamentally, I think there is two things we might need

Re: [PATCH] D19106: Fixed a bug in AnnotatedLine::startsWith when there are comments in the line.

2016-04-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. Comment at: lib/Format/TokenAnnotator.h:128 @@ +127,3 @@ + bool startsWithInternal(const FormatToken *Tok, A K1) const { +// Even though we skip comments in

[clang-tools-extra] r266864 - clang-tidy: [misc-unused-using-decls] Always use the canonical decl to

2016-04-20 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Apr 20 03:58:27 2016 New Revision: 266864 URL: http://llvm.org/viewvc/llvm-project?rev=266864&view=rev Log: clang-tidy: [misc-unused-using-decls] Always use the canonical decl to identify things. This fixes llvm.org/PR27430. Modified: clang-tools-extra/trunk/clang-t

[clang-tools-extra] r266866 - clang-tidy: [misc-unused-using-decls] Support template types.

2016-04-20 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Apr 20 04:48:56 2016 New Revision: 266866 URL: http://llvm.org/viewvc/llvm-project?rev=266866&view=rev Log: clang-tidy: [misc-unused-using-decls] Support template types. This fixes llvm.org/PR27429. Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsC

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-22 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/Format.cpp:1544 @@ -1508,2 +1543,3 @@ deriveLocalStyle(AnnotatedLines); -computeAffectedLines(AnnotatedLines.begin(), AnnotatedLines.end()); +AffectedRangeMgr.computeAffectedLines(AnnotatedLines.begin(), +

<    1   2   3   4   5   6   7   8   >