#
2aaedd3a |
| 18-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Make AlwaysBreakBeforeMultilineStrings more conservative.
In essence this is meant to consistently indent multiline strings by a fixed amount of spaces from the start of the line. Don'
clang-format: Make AlwaysBreakBeforeMultilineStrings more conservative.
In essence this is meant to consistently indent multiline strings by a fixed amount of spaces from the start of the line. Don't do this in cases where it wouldn't help anyway.
Before: someFunction(aaaaa, "aaaaa" "bbbbb");
After: someFunction(aaaaa, "aaaaa" "bbbbb");
llvm-svn: 240004
show more ...
|
#
e6fcf7d3 |
| 17-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: clang-format (NFC)
llvm-svn: 239903
|
#
d6e61889 |
| 17-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't generate unnecessary replacements for \r\n line endings.
Patch by Mathieu Champlon. Thank you.
llvm-svn: 239900
|
#
d246a5ac |
| 15-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: NFC. Move testing of selective formatting to a separate file.
This is a first step for splitting the huge FormatTest.cpp into separate files to make it easier to find specific tests.
clang-format: NFC. Move testing of selective formatting to a separate file.
This is a first step for splitting the huge FormatTest.cpp into separate files to make it easier to find specific tests.
llvm-svn: 239730
show more ...
|
#
60ba32d4 |
| 12-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Always add space before lambda-{
Before: int c = []() -> int *{ return 2; }();
After: int c = []() -> int * { return 2; }();
Based on patch by James Dennett (http://reviews.llvm.
clang-format: Always add space before lambda-{
Before: int c = []() -> int *{ return 2; }();
After: int c = []() -> int * { return 2; }();
Based on patch by James Dennett (http://reviews.llvm.org/D10410), thank you!
llvm-svn: 239600
show more ...
|
#
554e49fe |
| 12-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Understand C-style case in case label.
Before: case (my_int) ONE:
After: case (my_int)ONE:
This fixed llvm.org/PR23760
llvm-svn: 239597
|
#
f0c95b32 |
| 11-Jun-2015 |
Manuel Klimek <klimek@google.com> |
Fix crash in clang-format.
The following example used to crash clang-format. #define a\ /**/}
Adjusting the indentation level cache for the line starting with the comment would lead to an out-of
Fix crash in clang-format.
The following example used to crash clang-format. #define a\ /**/}
Adjusting the indentation level cache for the line starting with the comment would lead to an out-of-bounds array read.
llvm-svn: 239521
show more ...
|
#
229628b3 |
| 11-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't add spaces in foreach macro definition.
Before clang-format would e.g. add a space into
#define Q_FOREACH(x, y)
which turns this into a non-function-like macro.
Patch by St
clang-format: Don't add spaces in foreach macro definition.
Before clang-format would e.g. add a space into
#define Q_FOREACH(x, y)
which turns this into a non-function-like macro.
Patch by Strager Neds, thank you!
llvm-svn: 239513
show more ...
|
#
dee894f6 |
| 09-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Support //!-comments, increase test coverage.
llvm-svn: 239404
|
#
6f2b88a3 |
| 05-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: More eagerly wrap trailing return types.
Before: template <typename T> auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
clang-format: More eagerly wrap trailing return types.
Before: template <typename T> auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a) .aaaaaaaa());
After: template <typename T> auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());
Also add a test case for a difficult template parsing case I stumbled accross. Needs fixing.
llvm-svn: 239149
show more ...
|
#
5962fa80 |
| 03-Jun-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Properly reset BreakBeforeParameter when wrapping operators to the new line.
Before: LOG_IF(aaa == // bbb) << a << b;
After: LOG_IF(aaa == // bbb)
clang-format: Properly reset BreakBeforeParameter when wrapping operators to the new line.
Before: LOG_IF(aaa == // bbb) << a << b;
After: LOG_IF(aaa == // bbb) << a << b;
llvm-svn: 238911
show more ...
|
#
f841d3a6 |
| 28-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Lower binding strengths created by the [] created by ObjC method expressions and array literals. They should not bind stronger than regular parentheses or the braces of braced lists.
S
clang-format: Lower binding strengths created by the [] created by ObjC method expressions and array literals. They should not bind stronger than regular parentheses or the braces of braced lists.
Specific test case in JavaScript: Before: var aaaaa: List< SomeThing> = [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];
After: var aaaaa: List<SomeThing> = [ new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB() ];
llvm-svn: 238400
show more ...
|
#
3273930d |
| 27-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix false positive in function annotation detection.
llvm-svn: 238285
|
#
0843434e |
| 26-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Guard the bin-packing in braced lists on BinPackArguments instead of BinPackParameters. Braced lists are used as constructor calls in many places and so the bin-packing should follow wh
clang-format: Guard the bin-packing in braced lists on BinPackArguments instead of BinPackParameters. Braced lists are used as constructor calls in many places and so the bin-packing should follow what is done for other calls and not what is done for function declarations.
llvm-svn: 238184
show more ...
|
#
1a028227 |
| 26-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix child-formatting in macros.
This fixes a case where the column limit was incorrectly calculated leading to a macro like this:
#define A \
clang-format: Fix child-formatting in macros.
This fixes a case where the column limit was incorrectly calculated leading to a macro like this:
#define A \ [] { \ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx( \ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx); \ }
exceeding the column limit.
llvm-svn: 238182
show more ...
|
#
b09075a2 |
| 19-May-2015 |
Anders Waldenborg <anders@0x63.nu> |
clang-format: Add space in function pointers with SpaceBeforeParens=Always
"void (*my_function)(void)" should become "void (*my_function) (void)" when SpaceBeforeParens is set to 'Always'
Different
clang-format: Add space in function pointers with SpaceBeforeParens=Always
"void (*my_function)(void)" should become "void (*my_function) (void)" when SpaceBeforeParens is set to 'Always'
Differential Revision: http://reviews.llvm.org/D9835
llvm-svn: 237704
show more ...
|
#
9310166a |
| 19-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve *-detection.
Before: S << a *(10);
After: S << a * (10);
This fixes llvm.org/PR16500.
llvm-svn: 237690
|
#
d6e09e85 |
| 19-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve for-loop formatting.
Before: for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator I = Container.begin(),
clang-format: Improve for-loop formatting.
Before: for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator I = Container.begin(), E = Container.end(); I != E; ++I)
After: for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator I = Container.begin(), E = Container.end(); I != E; ++I)
This fixes llvm.org/PR23544.
llvm-svn: 237688
show more ...
|
#
fa3f8fbe |
| 19-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Support #include_next
Before: #include_next < test.h >
After: #include_next <test.h>
This fixes llvm.org/PR23500
llvm-svn: 237686
|
#
f5e5ee6d |
| 19-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Correctly detect casts to qualified types.
Before: ns::E f() { return (ns::E) - 1; }
After: ns::E f() { return (ns::E)-1; }
This fixes llvm.org/PR23503.
llvm-svn: 237684
|
#
ed41f774 |
| 19-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix regression caused by r237244.
Before: [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa. aaaaaaaa];
After: [call aaaaaaaa.aaaaaaaa.aaaaaa
clang-format: Fix regression caused by r237244.
Before: [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa. aaaaaaaa];
After: [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa .aaaaaaaa];
This merely papers over the fact that we aren't parsing ObjC method calls correctly. Also, the indentation is weird.
llvm-svn: 237681
show more ...
|
#
3c883d1d |
| 18-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix another regression caused by r237565.
Before: class C : test { class D : test{void f(){int i{2}; } } ; } ;
After: class C : test { class D : test { voi
clang-format: Fix another regression caused by r237565.
Before: class C : test { class D : test{void f(){int i{2}; } } ; } ;
After: class C : test { class D : test { void f() { int i{2}; } }; };
llvm-svn: 237569
show more ...
|
#
cec9ffd2 |
| 18-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix regression introduced by r237565.
Before: class C : public D { SomeClass SC { 2 }; };
After: class C : public D { SomeClass SC{2}; };
llvm-svn: 237568
|
#
47bbda09 |
| 18-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve detection of macros annotating functions.
Before: ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
clang-format: Improve detection of macros annotating functions.
Before: ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
After: ASSERT("aaaaaaaaaaaaaaa") << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
Also cleanup implementation a bit and only mark closing parenthesis of these annotations.
llvm-svn: 237567
show more ...
|
#
adba2aad |
| 18-May-2015 |
Daniel Jasper <djasper@google.com> |
clang-format: Allow braced initializers in template arguments of class specializations.
Before: template <class T> struct S < std::is_arithmetic<T> { } > {};
After: template <class T> s
clang-format: Allow braced initializers in template arguments of class specializations.
Before: template <class T> struct S < std::is_arithmetic<T> { } > {};
After: template <class T> struct S<std::is_arithmetic<T>{}> {};
llvm-svn: 237565
show more ...
|