| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
the template parameters aren't inside an expression context.
This fixes llvm.org/PR23270.
llvm-svn: 236603
|
|
|
|
|
|
|
|
| |
before operators.
This fixes llvm.org/23382.
llvm-svn: 236602
|
|
|
|
|
|
| |
This fixes llvm.org/PR23397.
llvm-svn: 236599
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
[aaaaaaaaaaa
aaaaaaa];
After:
[aaaaaaaaaaa
aaaaaaa];
llvm-svn: 236597
|
|
|
|
| |
llvm-svn: 236594
|
|
|
|
|
|
| |
We were already ignoring those already.
llvm-svn: 236591
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 236578
|
|
|
|
| |
llvm-svn: 236577
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optional methods use ? tokens like this:
interface X { y?(): z; }
It seems easiest to detect and disambiguate these from ternary
expressions by checking if the code is in a declaration context. Turns
out that that didn't quite work properly for interfaces in Java and JS,
and for JS file root contexts.
Patch by Martin Probst, thank you.
llvm-svn: 236488
|
|
|
|
|
|
| |
Patch by Martin Probst.
llvm-svn: 236485
|
|
|
|
| |
llvm-svn: 236415
|
|
|
|
| |
llvm-svn: 236413
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void SomeFunction(vector< // break
int> v);
After:
void SomeFunction(vector< // break
int> v);
llvm-svn: 236412
|
|
|
|
|
|
|
|
|
|
| |
OriginalColumn might not be set, so fall back to Location and SourceMgr
in case it is missing. Also initialize end column in case the token is
multi line, but it's the ` token itself that starts the multi line.
Patch by Martin Probst, thank you!
llvm-svn: 236383
|
|
|
|
|
|
|
|
|
|
| |
Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by
whitespace.
Patch by Martin Probst, thank you.
llvm-svn: 236382
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Buggy case:
someFunction(
[] {
// comment
int i; // invoke formatting here.
}, // force line break
aaa);
llvm-svn: 236091
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
a()
.aaaaa()
.aaaaa()
.aaaaa();
After:
a().aaaaa()
.aaaaa()
.aaaaa();
llvm-svn: 235707
|
|
|
|
| |
llvm-svn: 235702
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
LoooooooooooooooooooooooooooooooooooooooongType
LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
After:
LoooooooooooooooooooooooooooooooooooooooongType
LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
llvm-svn: 235599
|
|
|
|
|
|
| |
Otherwise, this can violate the column limit.
llvm-svn: 235592
|
|
|
|
|
|
|
|
|
|
| |
Before:
char** newargv = new char* [argc];
After:
char** newargv = new char*[argc];
llvm-svn: 235583
|
|
|
|
|
|
| |
They are very similar to import statements.
llvm-svn: 235582
|
|
|
|
| |
llvm-svn: 235580
|
|
|
|
|
|
| |
Adapted patch from Sergey Razmetov. Thank you.
llvm-svn: 235492
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 235078
|
|
|
|
|
|
|
| |
space where we already had the flag ObjCSpaceBeforeProtocolList to
control it. I don't know what I was thinking.
llvm-svn: 235076
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch by Martin Probst.
llvm-svn: 234754
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 234753
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 234752
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D8926
llvm-svn: 234678
|
|
|
|
| |
llvm-svn: 234320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes formatting unnamed bitfields (llvm.org/PR21999).
Before:
struct MyStruct {
uchar data;
uchar:
8;
uchar:
8;
uchar other;
};
After:
struct MyStruct {
uchar data;
uchar : 8;
uchar : 8;
uchar other;
};
llvm-svn: 234318
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);
After:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);
llvm-svn: 234304
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is different ..
.aaaa( //
cccc); // .. from this.
After:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is identical ..
.aaaa( //
cccc); // .. to this.
llvm-svn: 234300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
let theObject = {someMethodName() {
doTheThing();
doTheOtherThing();
},
someOtherMethodName() {
doSomething();
doSomethingElse();
}};
After:
let theObject = {
someMethodName() {
doTheThing();
doTheOtherThing();
},
someOtherMethodName() {
doSomething();
doSomethingElse();
}
};
llvm-svn: 234091
|
|
|
|
| |
llvm-svn: 234055
|
|
|
|
| |
llvm-svn: 233698
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
goog.scope(function() {
// test
var x = 0;
// test
});
After:
goog.scope(function() {
// test
var x = 0;
// test
});
llvm-svn: 233530
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb).a();
After:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb)
.a();
llvm-svn: 233304
|
|
|
|
|
|
|
| |
NewlinesBefore and HasUnescapedNewline were not properly propagated
leading to llvm.org/PR23032.
llvm-svn: 233276
|
|
|
|
|
|
| |
NFC.
llvm-svn: 232975
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void aaaaa(
aaaaaaaaaaaa* aaaaaaaaaaaaaa) {} // even violation the column limit
After:
void aaaaa(aaaaaaaaaaaa*
aaaaaaaaaaaaaa) {}
llvm-svn: 232717
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa*
const aaaaaaaaaaaa) {}
After:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaa* const aaaaaaaaaaaa) {}
llvm-svn: 232635
|