| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
Patch by Eugene Zelenko!
Differential Revision: http://reviews.llvm.org/D12741
llvm-svn: 247218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Constructor() : initializer(0) {}
template <typename T>
Constructor()
: initializer(0) {}
After:
Constructor() : initializer(0) {}
template <typename T>
Constructor() : initializer(0) {}
llvm-svn: 246146
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeType MemberFunction(const Deleted &)&;
After:
SomeType MemberFunction(const Deleted &) &;
Seems to be much more common.
llvm-svn: 245934
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
DEPRECATED("Use NewClass::NewFunction instead.") int OldFunction(
const string ¶meter) {}
Could not be formatted at all, as clang-format would both require and
disallow the break before "int".
llvm-svn: 245846
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
more consistent.
Before:
SomeType MemberFunction(const Deleted &)&&;
SomeType MemberFunction(const Deleted &) && { ... }
After:
SomeType MemberFunction(const Deleted &)&&;
SomeType MemberFunction(const Deleted &)&& { ... }
llvm-svn: 245843
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#define A \
{ a, a } \
,
After:
#define A {a, a},
llvm-svn: 245837
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bit of a step back of what we did in r222531, as there are
some corner cases in C++, where this kind of formatting is really bad.
Example:
Before:
virtual aaaaaaaaaaaaaaaa(std::function<bool()> IsKindWeWant = [&]() {
return true;
}, aaaaa aaaaaaaaa);
After:
virtual aaaaaaaaaaaaaaaa(std::function<bool()> IsKindWeWant =
[&]() { return true; },
aaaaa aaaaaaaaa);
The block formatting logic in JavaScript will probably go some other changes,
too, and we'll potentially be able to make the rules more consistent again. For
now, this seems to be the best approach for C++.
llvm-svn: 245694
|
|
|
|
|
|
|
|
|
|
| |
Before:
#elif(AAAA && BBBB)
After:
#elif (AAAA && BBBB)
llvm-svn: 245043
|
|
|
|
|
|
|
|
|
|
| |
Before:
decltype(a* b) F();
After:
decltype(a * b) F();
llvm-svn: 244891
|
|
|
|
|
|
|
|
|
|
| |
Before:
[ a, a ]() -> a<1>{};
After:
[a, a]() -> a<1> {};
llvm-svn: 244890
|
|
|
|
|
|
| |
Patch by Jon Chesterfield, thank you!
llvm-svn: 244660
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:
* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.
Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.
Reviewers: djasper, klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D11837
llvm-svn: 244446
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would format
call(
p);
as
call(
p);
with MaxEmptyLinesToKeep == 0.
Now we format it as:
call(p);
llvm-svn: 243429
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (;; * a = b) {}
After:
for (;; *a = b) {}
llvm-svn: 242849
|
|
|
|
|
|
| |
sequence. Discovered by the fuzzer.
llvm-svn: 242738
|
|
|
|
|
|
| |
compatibility and variable alignment.
llvm-svn: 242611
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
- (void)shortf:(GTMFoo *)theFoo
dontAlignNamef:(NSRect)theRect {
}
After:
- (void)shortf:(GTMFoo *)theFoo
dontAlignNamef:(NSRect)theRect {
}
Patch by Kwasi Mensah, thank you!
llvm-svn: 242484
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In proto, enum constants can contain complex options and should be
handled more like individual declarations.
Before:
enum Type {
UNKNOWN = 0 [(some_options) =
{
a: aa,
b: bb
}];
};
After:
enum Type {
UNKNOWN = 0 [(some_options) = {
a: aa,
b: bb
}];
};
llvm-svn: 242404
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D11177
llvm-svn: 242316
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int aaaaa[] = {
1, 2,
3, // comment
4, 5,
6 // comment
};
After:
int aaaaa[] = {
1, 2, 3, // comment
4, 5, 6 // comment
};
llvm-svn: 242299
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeFunction({[&] {
// comment
},
[&] {
// comment
}});
After:
SomeFunction({[&] {
// comment
},
[&] {
// comment
}});
llvm-svn: 242138
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D11125
llvm-svn: 242039
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D10883
llvm-svn: 241986
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
class Test {
aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa:
aaaaaaaaaaaaaaaaaaaaaaaa): aaaaaaaaaaaaaaaaaaaaaa {}
}
After:
class Test {
aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaaaaaaaa):
aaaaaaaaaaaaaaaaaaaaaa {}
}
llvm-svn: 241908
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (
auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbbbbbbb;
++aaaaaaaaaaaaaaaaaaaaaaaaaaa) {
After:
for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbbbbbbb;
++aaaaaaaaaaaaaaaaaaaaaaaaaaa) {
llvm-svn: 241601
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=
](int iiiiiiiiiiii) {
return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;
});
After:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=](
int iiiiiiiiiiii) {
return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;
});
llvm-svn: 241583
|
|
|
|
| |
llvm-svn: 241446
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaa:
aaaaaaaaaaaaaaaaaa): aaaaaaaaaaaaaaaaaaaaaa {}
After:
aaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaa: aaaaaaaaaaaaaaaaaa):
aaaaaaaaaaaaaaaaaaaaaa {}
llvm-svn: 241444
|
|
|
|
|
|
|
|
|
|
|
| |
__attribute__ was treated as the name of a function definition, with the
tokens in parentheses being the parameter list. This formats incorrectly
with AlwaysBreakAfterDefinitionReturnType. Fix it by treating
__attribute__ like decltype.
Patch by Strager Neds, thank you.
llvm-svn: 241439
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.
Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:
MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END
Now, using the options
MacroBlockBegin: "^[A-Z_]+_BEGIN$"
MacroBlockEnd: "^[A-Z_]+_END$"
will yield the expected result:
MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END
Differential Revision: http://reviews.llvm.org/D10840
llvm-svn: 241363
|
|
|
|
| |
llvm-svn: 241339
|
|
|
|
| |
llvm-svn: 241337
|
|
|
|
|
|
|
| |
Using the token type "unknown" can interfere badly with
WhitespaceManager's way of handling multiline comments.
llvm-svn: 241273
|
|
|
|
| |
llvm-svn: 241264
|
|
|
|
|
|
| |
The lexer wasn't properly reset leading to unexpected deletions.
llvm-svn: 241262
|
|
|
|
| |
llvm-svn: 241259
|
|
|
|
|
|
|
| |
Some counts were off, we don't need to take the leading newlines of the
first ` into account and some tests were just wrong.
llvm-svn: 241257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
trailing return types.
Before:
template <typename T>
auto x() & -> int {}
After:
template <typename T>
auto x() & -> int {}
llvm-svn: 241188
|
|
|
|
|
|
|
|
|
|
|
| |
Among other things, this makes clang-format understand arbitrary blocks
embedded in them, such as:
SomeFunction({MACRO({ return output; }), b});
where MACRO could e.g. expand to a lambda.
llvm-svn: 241059
|
|
|
|
|
|
|
|
| |
functions only
Differential Revision: http://reviews.llvm.org/D10774
llvm-svn: 240959
|
|
|
|
|
|
|
|
| |
Summary: This makes the Mozilla style defaults more compliant with the Mozilla style guide. A few options were removed in order to use the LLVM style defaults.
Differential Revision: http://reviews.llvm.org/D10771
llvm-svn: 240957
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);
After:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);
llvm-svn: 240934
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Depends on D10785.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D10786
llvm-svn: 240909
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D10784
llvm-svn: 240907
|
|
|
|
|
|
|
|
|
|
| |
Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.
Patch from Strager Neds!
http://reviews.llvm.org/D10372
llvm-svn: 240896
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional string operator= 1;
After:
optional string operator = 1;
llvm-svn: 240624
|
|
|
|
| |
llvm-svn: 240548
|
|
|
|
| |
llvm-svn: 240353
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch is generated using this command:
$ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
-checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
work/llvm/tools/clang
To reduce churn, not touching namespaces spanning less than 10 lines.
llvm-svn: 240270
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
conservative.
In particular, this fixes an unwanted corner case.
Before:
string s =
someFunction("aaaa"
"bbbb");
After:
string s = someFunction(
"aaaa"
"bbbb");
llvm-svn: 240129
|