r270027 - clang-format: Fix enumerator case ranges.

2016-05-19 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=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

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.

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

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

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. Nice. http://reviews.llvm.org/D20208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

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

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:

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

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

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

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()), +

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

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

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

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())) {

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=rev Log: clang-format: Fix space after argument comments. Before: f(/*a=*/a, /*b=*/ ::b); After: f(/*a=*/a, /*b=*/::b); Modified:

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=rev Log: clang-format: Support enum type template arguments. Before: template class A { public : E *f(); }; After: template class A { public: E *f(); };

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

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

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

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

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,

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 =

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

2016-04-25 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: cfe/trunk/lib/Format/AffectedRangeManager.h:59 @@ +58,3 @@ + const AnnotatedLine *PreviousLine); + SourceManager + const SmallVector Ranges; And an empty line between

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(), +

[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=rev Log: clang-tidy: [misc-unused-using-decls] Support template types. This fixes llvm.org/PR27429. Modified:

[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=rev Log: clang-tidy: [misc-unused-using-decls] Always use the canonical decl to identify things. This fixes llvm.org/PR27430. Modified:

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

[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=rev Log: Initial version of misc-unused-using-decl check. Added: clang-tools-extra/trunk/clang-tidy/misc/UnusedUsingDeclsCheck.cpp

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

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

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

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

[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

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=rev Log: clang-format: Improve heuristics to detect function declarations/definitions. Specifically understand ellipses in parameter lists and treat trailing reference

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

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

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

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.

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.

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

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

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:

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,

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

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

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

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

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=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 (a)

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=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)

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=rev Log: clang-format: Fix incorrect function annotation detection. Before: MACRO( abc).function() // wrap << abc; After: MACRO(abc).function() // wrap

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

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

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

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

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

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] 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 , + const format::FormatStyle ); + ioeric wrote: > djasper wrote: > > Do you have a use

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 , + const format::FormatStyle ); + Do you have a use case where we'd want to call this

Re: r263709 - clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

2016-03-28 Thread Daniel Jasper via cfe-commits
::nmspc::nmspace::Value01, >>> nsp::nmspc::nmspace::Value002 ) ), >>> extraArg001 ) ); >>> >>> boost::scoped_ptr< Type01 > obj002( >>> new Type01( nsp::nmspc::TypeInfo001Ptr( new >>> nsp::nmspc::TypeInfo001( >

Re: r263709 - clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

2016-03-28 Thread Daniel Jasper via cfe-commits
gt; the ContinuationIndentWidth. >> 2. For nested blocks such as lambdas, at least in some of the cases. >> >> Both are also about wasting space. I think single argument function calls >> are closely related to those two. So, we could add an "StrictAlwaysBreak" &g

Re: r263709 - clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

2016-03-24 Thread Daniel Jasper via cfe-commits
o much with > our original style, and that will look like a regression for us. > > Kind regards, > Jean-Philippe. > > > 2016-03-17 12:00 GMT+00:00 Daniel Jasper via cfe-commits < > cfe-commits@lists.llvm.org>: > >> Author: djasper >> Date: Thu Mar 17 0

Re: [PATCH] D18432: Test commit access to clang repo.

2016-03-24 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/D18432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2016-03-22 Thread Daniel Jasper via cfe-commits
djasper closed this revision. djasper added a comment. Submitted as r264055. http://reviews.llvm.org/D17440 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r264055 - clang-format: [JS] do not wrap ES6 imports/exports.

2016-03-22 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Tue Mar 22 09:32:20 2016 New Revision: 264055 URL: http://llvm.org/viewvc/llvm-project?rev=264055=rev Log: clang-format: [JS] do not wrap ES6 imports/exports. "import ... from '...';" and "export ... from '...';" should be treated the same as

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

2016-03-22 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 now? http://reviews.llvm.org/D17440 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2016-03-22 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:760 @@ +759,3 @@ + if (CurrentToken->is(tok::kw_export)) { +// Find the 'from' part of export {...} from '...'; +// The difference here is that "export {...};" should not be treated as

Re: [PATCH] D18294: clang-format: [JS] no space in union and intersection types.

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper closed this revision. djasper added a comment. Submitted as r263961. http://reviews.llvm.org/D18294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r263961 - clang-format: [JS] no space in union and intersection types.

2016-03-21 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Mar 21 12:57:31 2016 New Revision: 263961 URL: http://llvm.org/viewvc/llvm-project?rev=263961=rev Log: clang-format: [JS] no space in union and intersection types. The operators | and & in types, as opposed to the bitwise operators, should not have whitespace around

Re: [PATCH] D18294: clang-format: [JS] no space in union and intersection types.

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper added a comment. Looks good. http://reviews.llvm.org/D18294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

r263943 - clang-format: Make include sorting's main include detection configurable.

2016-03-21 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Mar 21 09:11:27 2016 New Revision: 263943 URL: http://llvm.org/viewvc/llvm-project?rev=263943=rev Log: clang-format: Make include sorting's main include detection configurable. This patch adds a regular expression to configure suffixes of an included file to check

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

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Core/Replacement.h:231 @@ +230,3 @@ +typedef std::map +FileToReplacementsMap; + klimek wrote: > Honestly, I'd get rid of the typedef. Daniel, what do you think? I

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

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper added inline comments. 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; + I chose this name for better alphabetical ordering. I don't strongly lean either

Re: [PATCH] D18294: clang-format: [JS] no space in union and intersection types.

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:526 @@ +525,3 @@ +case tok::amp: + if (Style.Language == FormatStyle::LK_JavaScript && + !Contexts.back().IsExpression) { Don't use braces and possibly pull the comment out

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

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper updated this revision to Diff 51154. http://reviews.llvm.org/D18313 Files: include/clang/Format/Format.h lib/Format/Format.cpp unittests/Format/FormatTest.cpp unittests/Format/SortIncludesTest.cpp Index: unittests/Format/SortIncludesTest.cpp

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

2016-03-21 Thread Daniel Jasper via cfe-commits
djasper created this revision. djasper added a reviewer: klimek. djasper added a subscriber: cfe-commits. Herald added a subscriber: klimek. This patch adds a regular expression to configure suffixes of an included file to check whether it is the "main" include of the current file. Previously,

r263713 - clang-format: [JS] Make requoting of JavaScript string literals only

2016-03-19 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Mar 17 08:03:41 2016 New Revision: 263713 URL: http://llvm.org/viewvc/llvm-project?rev=263713=rev Log: clang-format: [JS] Make requoting of JavaScript string literals only change affected ranges. Modified: cfe/trunk/lib/Format/Format.cpp

r263709 - clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

2016-03-19 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Mar 17 07:00:22 2016 New Revision: 263709 URL: http://llvm.org/viewvc/llvm-project?rev=263709=rev Log: clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak. If a call takes a single argument, using AlwaysBreak can lead to lots of wasted lines and additional

r263710 - clang-format: [JS] Fix incorrect spacing around contextual keywords.

2016-03-18 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Mar 17 07:17:59 2016 New Revision: 263710 URL: http://llvm.org/viewvc/llvm-project?rev=263710=rev Log: clang-format: [JS] Fix incorrect spacing around contextual keywords. Before: x.of (); After: x.of(); Modified: cfe/trunk/lib/Format/TokenAnnotator.cpp

Re: [PATCH] D17910: clang-format: [JS] Handle certain cases of ASI.

2016-03-14 Thread Daniel Jasper via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Submitted as r263470. http://reviews.llvm.org/D17910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

r263470 - clang-format: [JS] Handle certain cases of ASI.

2016-03-14 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Mon Mar 14 14:21:36 2016 New Revision: 263470 URL: http://llvm.org/viewvc/llvm-project?rev=263470=rev Log: clang-format: [JS] Handle certain cases of ASI. Automatic Semicolon Insertion can only be properly handled by parsing source code. However conservatively catching just

Re: [PATCH] D17910: clang-format: [JS] Handle certain cases of ASI.

2016-03-14 Thread Daniel Jasper via cfe-commits
djasper added a comment. Looks good. Comment at: lib/Format/UnwrappedLineParser.cpp:667 @@ +666,3 @@ +return true; + // FIXME(martinprobst): This returns true for C/C++ keywords like 'struct'. + return FormatTok->is(tok::identifier) && We don't usually

Re: [PATCH] D18015: Make functions in altivec.h be inline.

2016-03-11 Thread Daniel Jasper via cfe-commits
djasper closed this revision. djasper added a comment. Formatted and submitted as r263302. http://reviews.llvm.org/D18015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18015: Make functions in altivec.h be inline.

2016-03-11 Thread Daniel Jasper via cfe-commits
djasper added a comment. Want me to run clang-format on the file/diff? http://reviews.llvm.org/D18015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2016-03-06 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Core/Replacement.h:230 @@ +229,3 @@ + +typedef std::map +FileToReplacementsMap; ioeric wrote: > djasper wrote: > > I think the key type in a map is always const, so no need for "const". > I

Re: [PATCH] D17910: clang-format: [JS] Handle certain cases of ASI.

2016-03-06 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:665 @@ +664,3 @@ +// well known cases. It *must not* return true in speculative cases. +bool UnwrappedLineParser::shouldInsertSemiBetween(FormatToken *Previous, +

r262776 - clang-format: [JS] Support destructuring assignments in for loops.

2016-03-05 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Sat Mar 5 12:34:26 2016 New Revision: 262776 URL: http://llvm.org/viewvc/llvm-project?rev=262776=rev Log: clang-format: [JS] Support destructuring assignments in for loops. Before: for (let { a, b } of x) { } After: for (let {a, b} of x) { } Modified:

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

2016-03-04 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Core/Replacement.h:228 @@ -226,3 +227,3 @@ /// \pre Replacements must be for the same file. -std::vector -calculateChangedRangesInFile(const tooling::Replacements ); +std::vector calculateChangedRangesInFile(const

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

2016-03-03 Thread Daniel Jasper via cfe-commits
djasper added inline comments. Comment at: include/clang/Tooling/Core/Replacement.h:237 @@ +236,3 @@ +/// related to the same file entry are put into the same vector. +FileToReplacementsMap groupReplacementsByFile(const Replacements , +

r262630 - clang-format: Use stable_sort when sorting #includes.

2016-03-03 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Thu Mar 3 11:34:14 2016 New Revision: 262630 URL: http://llvm.org/viewvc/llvm-project?rev=262630=rev Log: clang-format: Use stable_sort when sorting #includes. Otherwise, clang-format can output useless replacements in the presence of identical #includes Modified:

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

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

r262534 - clang-format: [JS] Optionally re-quote string literals.

2016-03-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 2 16:44:03 2016 New Revision: 262534 URL: http://llvm.org/viewvc/llvm-project?rev=262534=rev Log: clang-format: [JS] Optionally re-quote string literals. Turns "foo" into 'foo' (or vice versa, depending on configuration). This makes it more convenient to follow the

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

2016-03-02 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/Format.cpp:1140 @@ +1139,3 @@ + + void insertReplacement(SourceLocation Start, unsigned Length, + StringRef

Re: r262487 - test/Driver/cl-pch-errorhandling.cpp: Copy input file to a temporary

2016-03-02 Thread Daniel Jasper via cfe-commits
Feel free to change. I have no idea what I am doing here. On Wed, Mar 2, 2016 at 12:55 PM, Nico Weber <tha...@chromium.org> wrote: > (A different fix would've been to just add /Fp%.pch to set the output path > to be not next to the inputs.) > > On Wed, Mar 2, 2016 at 6:27 AM,

r262487 - test/Driver/cl-pch-errorhandling.cpp: Copy input file to a temporary

2016-03-02 Thread Daniel Jasper via cfe-commits
Author: djasper Date: Wed Mar 2 08:26:59 2016 New Revision: 262487 URL: http://llvm.org/viewvc/llvm-project?rev=262487=rev Log: test/Driver/cl-pch-errorhandling.cpp: Copy input file to a temporary location as we cannot assume the location of the input file to be writable. Modified:

Re: [PATCH] D17761: Added applyAllReplacementsAndFormat that works for multiple files.

2016-03-01 Thread Daniel Jasper via cfe-commits
djasper added a comment. I don't think this is the right abstraction: - Formatting so far is fundamentally per file. Grouping replacements per file is something that can be done outside of libFormat. - The logic to sort and deduplicate Replacements is important independent of whether

<    1   2   3   4   5   6   7   >