| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaa(aaaaaaaaaaaa)][bbbbbbbbbbb(
bbbbbbbbbbbb)]
After:
aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaa(aaaaaaaaaaaa)]
[bbbbbbbbbbb(bbbbbbbbbbbb)]
llvm-svn: 256343
|
|
|
|
|
|
|
|
|
|
| |
Before:
return * this += 1;
After:
return *this += 1;
llvm-svn: 256342
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the behavior of AlwaysBreakAfterDeclarationReturnType
so that it supports breaking after declarations, definitions, or
both.
Differential Revision: http://reviews.llvm.org/D10370
Reviewed By: Daniel Jasper
llvm-svn: 256046
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
before it is not a closing parenthesis.
Otherwise, this frequently leads to "hanging" indents that users
perceive as "weird".
Before:
return !soooooooooooooome_map.insert(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
.second;
After:
return !soooooooooooooome_map
.insert(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
.second;
llvm-svn: 254933
|
|
|
|
| |
llvm-svn: 253900
|
|
|
|
|
|
| |
No functional changes intended.
llvm-svn: 253873
|
|
|
|
|
|
|
|
|
|
| |
Before:
bool b = f(g<int>)&&c;
After:
bool b = f(g<int>) && c;
llvm-svn: 253872
|
|
|
|
|
|
| |
work properly.
llvm-svn: 253674
|
|
|
|
| |
llvm-svn: 253672
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
MACRO(> );
After:
MACRO(>);
Not overly important, but easy and good for symmetry reasons :-).
llvm-svn: 253669
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
extend.foo.Bar {
}
After:
extend .foo.Bar {
}
llvm-svn: 253667
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://gcc.gnu.org/onlinedocs/gcc/Typeof.html
Differences from the GCC extension:
* __auto_type is also permitted in C++ (but only in places where
it could appear in C), allowing its use in headers that might
be shared across C and C++, or used from C++98
* __auto_type can be combined with a declarator, as with C++ auto
(for instance, "__auto_type *p")
* multiple variables can be declared in a single __auto_type
declaration, with the C++ semantics (the deduced type must be
the same in each case)
This patch also adds a missing restriction on applying typeof to
a bit-field, which GCC has historically rejected in C (due to
lack of clarity as to whether the operand should be promoted).
The same restriction also applies to __auto_type in C (in both
GCC and Clang).
This also fixes PR25449.
Patch by Nicholas Allegra!
llvm-svn: 252690
|
|
|
|
|
|
| |
is import-statement-like and shouldn't be wrapped.
llvm-svn: 251643
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If this option is set, clang-format will always insert a line wrap, e.g.
before the first parameter of a function call unless all parameters fit
on the same line. This obviates the need to make a decision on the
alignment itself.
Use this style for Google's JavaScript style and add some minor tweaks
to correctly handle nested blocks etc. with it. Don't use this option
for for/while loops.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D14104
llvm-svn: 251405
|
|
|
|
|
|
|
|
|
|
| |
Before (with spaces in parentheses):
void inFunction() { std::function<void( int, int )> fct; }
After:
void inFunction() { std::function<void( int, int)> fct; }
llvm-svn: 251284
|
|
|
|
|
|
|
|
|
|
|
| |
Chromium follows the Android style guide for Java code, and that doesn't make
the distinction between fields and non-fields that the Google Java style guide
makes:
https://source.android.com/source/code-style.html#use-standard-java-annotations
https://google.github.io/styleguide/javaguide.html#s4.8.5-annotations
llvm-svn: 250422
|
|
|
|
|
|
|
|
|
|
| |
key in Obj-C dictionary literals
This fixes: https://llvm.org/PR22647
Patch by Kent Sutherland. Thank you.
llvm-svn: 250010
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504
TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but
not TT_ObjCForIn, so lines that look like:
for (id nextObject in (NSArray *)myArray)
would incorrectly turn into:
for (id nextObject in(NSArray *)myArray)
Patch by Kent Sutherland, thank you.
llvm-svn: 249553
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f(Type(¶meter)[10]) {}
void f(Type (*parameter)[10]) {}
After:
void f(Type (¶meter)[10]) {}
void f(Type (*parameter)[10]) {}
llvm-svn: 249502
|
|
|
|
|
|
|
|
|
|
| |
Before:
return options != nullptr &&operator==(*options);
After:
return options != nullptr && operator==(*options);
llvm-svn: 249501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expanded upon
calling the reformat function.
All presets have been chose to keep the existing formatting, so there
shouldn't be any difference in formatting behavior.
Also change the dump_format_style.py to properly document the nested
structs that are used to keep these flags discoverable among all the
configuration flags.
llvm-svn: 248802
|
|
|
|
|
|
|
|
|
| |
JavaScript allows keywords to appear in IdenfierName positions, e.g.
fields, or object literal members, but not as plain identifiers.
Patch by Martin Probst. Thank you!
llvm-svn: 248714
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you!
llvm-svn: 248713
|
|
|
|
|
|
| |
Before: assert a&& b;
Now: assert a && b;
llvm-svn: 247750
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch by Jon Chesterfield, thank you!
llvm-svn: 244660
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D11177
llvm-svn: 242316
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
__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
|
|
|
|
| |
llvm-svn: 241339
|
|
|
|
| |
llvm-svn: 241337
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
trailing return types.
Before:
template <typename T>
auto x() & -> int {}
After:
template <typename T>
auto x() & -> int {}
llvm-svn: 241188
|
|
|
|
|
|
|
|
| |
functions only
Differential Revision: http://reviews.llvm.org/D10774
llvm-svn: 240959
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional string operator= 1;
After:
optional string operator = 1;
llvm-svn: 240624
|
|
|
|
| |
llvm-svn: 240110
|
|
|
|
|
|
| |
is().
llvm-svn: 240008
|
|
|
|
| |
llvm-svn: 239903
|
|
|
|
|
|
|
|
|
|
|
| |
This makes this consistent with non-typescript enums.
Also shuffle the language-dependent stuff in mustBreakBefore to a
single location.
Patch initiated by Martin Probst.
llvm-svn: 239894
|
|
|
|
|
|
|
| |
starts with a given sequence of tokens. Only the one-token version is
used yet, but other usages are coming up momentarily.
llvm-svn: 239892
|