#
eabede6d |
| 30-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve alignment after 'return'.
Previously, comments, could totally confuse it.
Before: return // true if code is one of a or b. code == a || co
clang-format: Improve alignment after 'return'.
Previously, comments, could totally confuse it.
Before: return // true if code is one of a or b. code == a || code == b;
After: return // true if code is one of a or b. code == a || code == b;
llvm-svn: 191654
show more ...
|
#
0b1f76b6 |
| 29-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix assertion on incomplete string literals.
Before, this could would lead to an assert: llvm::errs() << " << a;
llvm-svn: 191639
|
#
45dc1b2f |
| 27-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Added a comment and another test for the UT_ForIndentation option
llvm-svn: 191530
|
#
3c3d09c8 |
| 27-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Implemented tab usage only for indentation (http://llvm.org/PR17363)
Summary: Changed UseTab to be a enum with three options: Never, Always, ForIndentation (true/false are still supported when readi
Implemented tab usage only for indentation (http://llvm.org/PR17363)
Summary: Changed UseTab to be a enum with three options: Never, Always, ForIndentation (true/false are still supported when reading .clang-format). IndentLevel should currently be propagated correctly for all tokens, except for block comments. Please take a look at the general idea before I start dealing with block comments.
Reviewers: klimek, djasper
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1770
llvm-svn: 191527
show more ...
|
#
db4c21f9 |
| 27-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Correctly indent with tabs when whitespace starts from the column not divisible by TabWidth.
Summary: The width of the first inserted tab character depends on the initial column, so we need to handl
Correctly indent with tabs when whitespace starts from the column not divisible by TabWidth.
Summary: The width of the first inserted tab character depends on the initial column, so we need to handle the first tab in a special manner.
Reviewers: klimek, djasper
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1763
llvm-svn: 191497
show more ...
|
#
f3167903 |
| 27-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve formatting of functions with multiple trailing tokens.
Before: void SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaa) override final;
clang-format: Improve formatting of functions with multiple trailing tokens.
Before: void SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaa) override final;
After: void SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaa) override final;
llvm-svn: 191494
show more ...
|
#
69bd8fb7 |
| 27-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix formatting bug with comment in weird place.
Before: template <typename T> // T should be one of {A, B}. void f() {}
After: template <typename T> // T should be one o
clang-format: Fix formatting bug with comment in weird place.
Before: template <typename T> // T should be one of {A, B}. void f() {}
After: template <typename T> // T should be one of {A, B}. void f() {}
llvm-svn: 191492
show more ...
|
#
d94bff37 |
| 25-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Option to removing the space before assignment operators.
Patch contributed by Aaron Wishnick. Thank you!
llvm-svn: 191375
|
#
df620b24 |
| 21-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve address-of-operator detection
Before: size = sizeof * a;
After: size = sizeof *a;
llvm-svn: 191139
|
#
fb81b09d |
| 17-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't accidentally move tokens into preprocessor directive.
This fixes llvm.org/PR17265.
Before: Foo::Foo() #ifdef BAR : baz(0) #endif { }
After: Foo::Foo() #ifdef
clang-format: Don't accidentally move tokens into preprocessor directive.
This fixes llvm.org/PR17265.
Before: Foo::Foo() #ifdef BAR : baz(0) #endif { }
After: Foo::Foo() #ifdef BAR : baz(0) #endif { }
llvm-svn: 190861
show more ...
|
#
545c652d |
| 17-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Add comment to tests explaining their grouping.
llvm-svn: 190858
|
#
88f9222c |
| 17-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix line breaking bug after empty ifs.
Before: if () { } else { }
After: if () { } else { }
This fixed llvm.org/PR17262.
llvm-svn: 190855
|
#
0de8efa6 |
| 17-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't split a >>-operator.
Before (with column limit 60): aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa > > aaaaa);
After: aaaaaaaaaaaaaaaaaaaaaaaaaaaa( a
clang-format: Don't split a >>-operator.
Before (with column limit 60): aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa > > aaaaa);
After: aaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaa >> aaaaa);
(Not sure how that could have stayed in that long without being detected..)
llvm-svn: 190854
show more ...
|
#
81e3294e |
| 16-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
When in pre-c++11 mode, treat _T("xxx") as a single string literal, repeat the _T() part around each fragment. This addresses http://llvm.org/PR17122
Reviewers: djasper
Reviewed By: djasper
CC: cf
When in pre-c++11 mode, treat _T("xxx") as a single string literal, repeat the _T() part around each fragment. This addresses http://llvm.org/PR17122
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek, rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D1640
llvm-svn: 190804
show more ...
|
#
5c9e3cdb |
| 14-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix bug in style option AlwaysBreakTemplateDeclarations.
Before: template <template <typename> class Fooooooo, template <typename> class Baaaaaaar> struct C
clang-format: Fix bug in style option AlwaysBreakTemplateDeclarations.
Before: template <template <typename> class Fooooooo, template <typename> class Baaaaaaar> struct C {};
After: template <template <typename> class Fooooooo, template <typename> class Baaaaaaar> struct C {};
llvm-svn: 190747
show more ...
|
#
f3d97797 |
| 13-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Detect braced lists in subscript expressions.
Before (even with Style.Cpp11BracedListStyle): f(MyMap[{ composite, key }]);
After: f(MyMap[{composite, key}]);
llvm-svn: 190678
|
#
015ed028 |
| 13-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix incorrect enum parsing / layouting.
Before: enum { Bar = Foo < int, int > ::value };
After: enum { Bar = Foo<int, int>::value };
llvm-svn: 190674
|
#
5ca9b714 |
| 11-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix bug in pointer detection
Before: for (int i = 0; i* 2 < z; i *= 2) {} After: for (int i = 0; i * 2 < z; i *= 2) {}
llvm-svn: 190546
|
#
9e649af0 |
| 11-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Support for CR LF newlines.
Summary: reformat() tries to determine the newline style used in the input (either LF or CR LF), and uses it for the output. Maybe not every single case is supported, but
Support for CR LF newlines.
Summary: reformat() tries to determine the newline style used in the input (either LF or CR LF), and uses it for the output. Maybe not every single case is supported, but at least the bug described in http://llvm.org/PR17182 should be resolved.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1643
llvm-svn: 190519
show more ...
|
#
d8d47fa5 |
| 10-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Don't divide L and #x in macro definitions. Fixes http://llvm.org/PR17144
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/
Don't divide L and #x in macro definitions. Fixes http://llvm.org/PR17144
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1639
llvm-svn: 190408
show more ...
|
#
917f9e04 |
| 10-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Correctly calculate OriginalColumn after multi-line tokens.
Summary: This also unifies the handling of escaped newlines for all tokens.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, kl
Correctly calculate OriginalColumn after multi-line tokens.
Summary: This also unifies the handling of escaped newlines for all tokens.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1638
llvm-svn: 190405
show more ...
|
#
71665cd1 |
| 10-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Understand function type typedefs with typeof.
Before: typedef typeof(int(int, int)) * MyFunc; After: typedef typeof(int(int, int)) *MyFunc;
This fixes llvm.org/PR17178.
llvm-svn
clang-format: Understand function type typedefs with typeof.
Before: typedef typeof(int(int, int)) * MyFunc; After: typedef typeof(int(int, int)) *MyFunc;
This fixes llvm.org/PR17178.
llvm-svn: 190401
show more ...
|
#
39856b71 |
| 10-Sep-2013 |
Alexander Kornienko <alexfh@google.com> |
Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.
Summary: This fixes various issues with mixed tabs and spaces handling, e.g. when realigning block comments.
Reviewers: kl
Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.
Summary: This fixes various issues with mixed tabs and spaces handling, e.g. when realigning block comments.
Reviewers: klimek, djasper
Reviewed By: djasper
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1608
llvm-svn: 190395
show more ...
|
#
9b246e09 |
| 08-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Keep empty lines and format 1-line nested blocks.
Let clang-format consistently keep up to one empty line (configured via FormatStyle::MaxEmptyLinesToKeep) in nested blocks, e.g. lambd
clang-format: Keep empty lines and format 1-line nested blocks.
Let clang-format consistently keep up to one empty line (configured via FormatStyle::MaxEmptyLinesToKeep) in nested blocks, e.g. lambdas. Also, actually format single statements in nested blocks.
Before: DEBUG({ int i; }); DEBUG({ int i; // an empty line here would just be removed. int j; });
After: DEBUG({ int i; }); DEBUG({ int i;
int j; });
llvm-svn: 190278
show more ...
|
#
87f18f11 |
| 06-Sep-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix regression introduced by r190038.
Before: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } After: Constructor()
clang-format: Fix regression introduced by r190038.
Before: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { } After: Constructor() : aaaaaaaaaaaaaaaaaaaa(a), bbbbbbbbbbbbbbbbbbbbbbbb(b) { }
llvm-svn: 190209
show more ...
|