- Mar 21, 2016
-
-
Daniel Jasper authored
The operators | and & in types, as opposed to the bitwise operators, should not have whitespace around them (e.g. `Foo<Bar|Baz>`). Patch by Martin Probst. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263961 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
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, clang-format has allowed arbitrary suffixes on the formatted file, which is still the case when no IncludeMainRegex is specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263943 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 17, 2016
-
-
Daniel Jasper authored
change affected ranges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263713 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: x.of (); After: x.of(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263710 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
If a call takes a single argument, using AlwaysBreak can lead to lots of wasted lines and additional indentation without improving the readability in a significant way. Before: caaaaaaaaaaaall( caaaaaaaaaaaall( caaaaaaaaaaaall( caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa)))); After: caaaaaaaaaaaall(caaaaaaaaaaaall(caaaaaaaaaaaall( caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa)))); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263709 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 14, 2016
-
-
Daniel Jasper authored
Automatic Semicolon Insertion can only be properly handled by parsing source code. However conservatively catching just a few, common situations prevents breaking code during development, which greatly improves usability. JS code should still use semicolons, and ASI code should be flagged by a compiler or linter. Patch by Martin Probst. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263470 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 05, 2016
-
-
Daniel Jasper authored
Before: for (let { a, b } of x) { } After: for (let {a, b} of x) { } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262776 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 03, 2016
-
-
Daniel Jasper authored
Otherwise, clang-format can output useless replacements in the presence of identical #includes git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262630 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 02, 2016
-
-
Daniel Jasper authored
Turns "foo" into 'foo' (or vice versa, depending on configuration). This makes it more convenient to follow the Google JavaScript style guide: https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings This functionality is behind the option "JavaScriptQuotes", which can be: * "leave" (no re-quoting) * "single" (change to single quotes) * "double" (change to double quotes) This also changes single quoted JavaScript string literals to be treated as tok::string_literal, not tok::char_literal, which fixes two unrelated tests. Patch by Martin Probst. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262534 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 01, 2016
-
-
Daniel Jasper authored
Patch by Erik Kessler, thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262402 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262329 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262324 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
This is a commonly useful feature to have, and we have implemented it multiple times with different kinds of bugs. This implementation centralizes the idea in a set of functions that we can then use from the various tools. Reverts r262234, which is a revert of r262232, and puts the functions into FOrmat.h, as they are closely coupled to clang-format, and we otherwise introduce a cyclic dependency between libFormat and libTooling. Patch by Eric Liu. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262323 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
ternary expressions. Before: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb + cccccccccccccccc; After: return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb + cccccccccccccccc; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262293 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa] [a].aaaaaaaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a] .aaaaaaaaaaaaaaaaaaaaaa(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262292 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: var x = { a: a, b: b, 'c': c, }; After: var x = { a: a, b: b, 'c': c, }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262291 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 29, 2016
-
-
Daniel Jasper authored
With this change: SomeFunction( [] { int i; return i; // Format this line. }, [] { return 2; // Don't "fix" this. }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262216 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 22, 2016
-
-
Daniel Jasper authored
Patch by Martin Probst. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261528 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 18, 2016
-
-
Richard Trieu authored
Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261271 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 11, 2016
-
-
Daniel Jasper authored
Before: for (var i of[2, 3]) {} After: for (var i of [2, 3]) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260518 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) << aaa; After: Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) << aaa; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260517 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
In particular, make it more expensive than breaking after the return type of a function definition/declaration. Before: template <typename T> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa< T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa); After: template <typename T> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260497 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 08, 2016
-
-
Daniel Jasper authored
Before: bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, // ccccccc(aaaaaaaaaaaaaaaaa, // b)); After: bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, // ccccccc(aaaaaaaaaaaaaaaaa, // b)); This fixes llvm.org/PR24905. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260080 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 07, 2016
-
-
Daniel Jasper authored
Before: f({a}, () => { g(); // }); After: f({a}, () => { g(); // }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260060 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 05, 2016
-
-
Daniel Jasper authored
Before: f(a.operator() < A > ()); After: f(a.operator()<A>()); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259884 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 03, 2016
-
-
Daniel Jasper authored
Before: int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb : ccccccccccccccccccccccccccc; After: int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? /*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb : ccccccccccccccccccccccccccc; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259670 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: enum?: string []; After: enum?: string[]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259628 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 02, 2016
-
-
Daniel Jasper authored
Patch by Matthew Whitehead, thank you. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259487 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 01, 2016
-
-
Daniel Jasper authored
initializers. Before: Constructor() : member([](A *a, B * b) {}) {} After: Constructor() : member([](A *a, B *b) {}) {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259353 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259352 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259351 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259350 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 27, 2016
-
-
Daniel Jasper authored
Before: @Annotation("Some" + " text") List<Integer> list; After: @Annotation("Some" + " text") List<Integer> list; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258981 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 26, 2016
-
-
Chris Bieneman authored
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258862 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 19, 2016
-
-
Manuel Klimek authored
Before: a[ ::b::c]; After: a[::b::c]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258123 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 14, 2016
-
-
Daniel Jasper authored
Before: aaaa[bbbb] .cccc(); After: aaaa[bbbb].cccc(); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257763 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
clang-format only works for JavaScript code, if all the semicolons are present anyway, so this linebreak can never be desired. Before (with appropriate statement lengths or column limit): return [ aaa ]; After: return [ aaaa ]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257741 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 13, 2016
-
-
Daniel Jasper authored
After reading the style guides again, they don't actually say how to pack or not pack array literals. Based on some user reports, array initializers can unnecessarily get quite long if they contain many small elements. Array literals with trailing commas are still formatted one per line so that users have a way to opt out of the packing. Before: var array = [ aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa ]; After: var array = [ aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa ]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257615 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 12, 2016
-
-
Daniel Jasper authored
Before: export abstract class X {y: number;} (and all sorts of other havoc in more complicated cases). After: export abstract class X { y: number; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257451 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 11, 2016
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257406 91177308-0d34-0410-b5e6-96231b3b80d8
-