#
03618147 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't indent 'signals' as access specifier if it isn't one
Before: { signals.set(0); }
After: { signals.set(0); }
llvm-svn: 236630
|
#
1fe0d5ca |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Merge labels and subsequent semicolons.
E.g.:
default:;
This can be used to get around restrictions as to what can follow a label. It fixes llvm.org/PR19648.
llvm-svn: 236604
|
#
112b50e6 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Allow ternary expressions inside template parameters if the template parameters aren't inside an expression context.
This fixes llvm.org/PR23270.
llvm-svn: 236603
|
#
e92bf6f1 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Consider operator precedence as penalty when breaking before operators.
This fixes llvm.org/23382.
llvm-svn: 236602
|
#
04785d04 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Accept slightly more record declarations.
This fixes llvm.org/PR23397.
llvm-svn: 236599
|
#
2746a308 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix bad wrapping of ObjC method exprs.
Before: [aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa: aaaaaaaa aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];
After: [aaaaaaaaaaaaaaa
clang-format: Fix bad wrapping of ObjC method exprs.
Before: [aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa: aaaaaaaa aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];
After: [aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa:aaaaaaaa aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];
Note that this might now violate the column limit and we probably need an alternative way of indenting these then. However, that is still strictly better than the messy formatting that clang-format did before.
llvm-svn: 236598
show more ...
|
#
eb53668c |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Properly indent method calls without inputs.
Before: [aaaaaaaaaaa aaaaaaa];
After: [aaaaaaaaaaa aaaaaaa];
llvm-svn: 236597
|
#
e2408e37 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix another assertion discovered by the fuzzer.
In the process, fix an old todo that I don't really know how to write tests for. The problem is that Clang's lexer creates very strange
clang-format: Fix another assertion discovered by the fuzzer.
In the process, fix an old todo that I don't really know how to write tests for. The problem is that Clang's lexer creates very strange token sequences for these. However, the new approach seems generally better and easier to read so I am submitting it nonetheless.
llvm-svn: 236589
show more ...
|
#
62c78f54 |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Prevent assertion discovered by fuzzer.
llvm-svn: 236578
|
#
4d9ec17f |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Prevent exponential runtime in token annotator.
llvm-svn: 236577
|
#
6d9b88dd |
| 06-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix bug in multiline comment wrapping.
Splitting: /** * multiline block comment * */
Before: /** * multiline block *comment * */
After: /** * multiline
clang-format: Fix bug in multiline comment wrapping.
Splitting: /** * multiline block comment * */
Before: /** * multiline block *comment * */
After: /** * multiline block * comment * */
The reason was that the empty line inside the comment (with just the "*") was confusing the comment breaking logic.
llvm-svn: 236573
show more ...
|
#
de7ca75c |
| 04-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Force aligning different brackets relative to each other.
Before: void SomeFunction(vector< // break int> v);
After: void SomeFunction(vector< // break
clang-format: Force aligning different brackets relative to each other.
Before: void SomeFunction(vector< // break int> v);
After: void SomeFunction(vector< // break int> v);
llvm-svn: 236412
show more ...
|
#
e9f5357f |
| 30-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't merge short else blocks.
Before (with the appropriate flags settings): if (a) { f(); } else { g(); }
Before (with other appropriate flags settings): if (a) { f(); } el
clang-format: Don't merge short else blocks.
Before (with the appropriate flags settings): if (a) { f(); } else { g(); }
Before (with other appropriate flags settings): if (a) { f(); } else { g(); }
After: if (a) { f(); } else { g(); }
llvm-svn: 236217
show more ...
|
#
a4499133 |
| 29-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Add ability to align assignment operators.
In Objective-C some style guides use a style where assignment operators are aligned, in an effort to increase code readability. This patch ad
clang-format: Add ability to align assignment operators.
In Objective-C some style guides use a style where assignment operators are aligned, in an effort to increase code readability. This patch adds an option to the format library which allows this functionality. It is disabled by default for all the included styles, so it must be explicitly enabled.
The option will change code such as: - (void)method { NSNumber *one = @1; NSNumber *twentyFive = @25; }
to: - (void)method { NSNumber *one = @1; NSNumber *twentyFive = @25; }
Patch by Matt Oakes. Thank you!
Accidentally reformatted all the tests...
llvm-svn: 236100
show more ...
|
#
eb45cb7c |
| 29-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix selective indentaiton in nested blocks.
Buggy case: someFunction( [] { // comment int i; // invoke formatting here. }, // force line break
clang-format: Fix selective indentaiton in nested blocks.
Buggy case: someFunction( [] { // comment int i; // invoke formatting here. }, // force line break aaa);
llvm-svn: 236091
show more ...
|
#
775954be |
| 24-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't wrap after short first segments of builder calls.
Before: a() .aaaaa() .aaaaa() .aaaaa();
After: a().aaaaa() .aaaaa() .aaaaa();
llvm-svn: 2357
clang-format: Don't wrap after short first segments of builder calls.
Before: a() .aaaaa() .aaaaa() .aaaaa();
After: a().aaaaa() .aaaaa() .aaaaa();
llvm-svn: 235707
show more ...
|
#
de0d1f3c |
| 24-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: More selectively detect QT's "signals".
llvm-svn: 235702
|
#
0faa9136 |
| 23-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Properly detect variable declarations with ObjC.
Before: LoooooooooooooooooooooooooooooooooooooooongType LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
After: Loooooo
clang-format: Properly detect variable declarations with ObjC.
Before: LoooooooooooooooooooooooooooooooooooooooongType LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
After: LoooooooooooooooooooooooooooooooooooooooongType LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
llvm-svn: 235599
show more ...
|
#
caf84fe2 |
| 23-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Allow splitting "= default" and "= delete".
Otherwise, this can violate the column limit.
llvm-svn: 235592
|
#
532a0314 |
| 23-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't add unwanted space when creating new arrays.
Before: char** newargv = new char* [argc];
After: char** newargv = new char*[argc];
llvm-svn: 235583
|
#
289afc07 |
| 23-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Support nested block formatting with ColumnLimit=0.
llvm-svn: 235580
|
#
ee4a8a14 |
| 22-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix for #pragma option formatting.
Adapted patch from Sergey Razmetov. Thank you.
llvm-svn: 235492
|
#
e4ab49e8 |
| 20-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix incorrect multi-var declstmt detection.
This is now obvious as the pointer alignment behavior was changed.
Before (even with pointer alignment "Left"): MACRO Constructor(const i
clang-format: Fix incorrect multi-var declstmt detection.
This is now obvious as the pointer alignment behavior was changed.
Before (even with pointer alignment "Left"): MACRO Constructor(const int &i) : a(a), b(b) {}
After: MACRO Constructor(const int& i) : a(a), b(b) {}
llvm-svn: 235301
show more ...
|
#
20e15563 |
| 16-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Undo r214508. It was essentially always removing the space where we already had the flag ObjCSpaceBeforeProtocolList to control it. I don't know what I was thinking.
llvm-svn: 235076
|
#
2b1865c2 |
| 15-Apr-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Determine "in" as a keyword in ObjC for loops more precisely
Before: for (int i = 0; i < in [a]; ++i) ..
After: for (int i = 0; i < in[a]; ++i) ..
Also do some related cleanups.
clang-format: Determine "in" as a keyword in ObjC for loops more precisely
Before: for (int i = 0; i < in [a]; ++i) ..
After: for (int i = 0; i < in[a]; ++i) ..
Also do some related cleanups.
llvm-svn: 234980
show more ...
|