| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r256750 has been leading to an undesired behavior:
aaaaaaaaaa
.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
This change increases penalty for wrapping before member accesses that aren't
calls. Thus, this is again formatted as (as it has been before r256750):
aaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 256830
|
| |
|
|
| |
llvm-svn: 256759
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
export default[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb];
export default[];
After:
export default [
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
];
export default [];
llvm-svn: 256758
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the [] in the following example were recognized as an array
subscript leading to weird indentation.
Before:
var aaaa = aaaaa || // wrap
[];
After:
var aaaa = aaaaa || // wrap
[];
llvm-svn: 256753
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
return aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaa)
.aaaa(aaaaaaaaaaaaaa);
After:
return aaaaaaaaaaaaaaaa
.aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa)
.aaaa(aaaaaaaaaaaaaa);
llvm-svn: 256750
|
| |
|
|
|
|
| |
function calls.
llvm-svn: 256740
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Before:
std::function<std::string(const std::string &)> my_lambda = [](
const string &s) { return s; };
After:
std::function<std::string(const std::string &)> my_lambda =
[](const string &s) { return s; };
llvm-svn: 256739
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
- (void)shortf:(GTMFoo *)theFoo
longKeyword:(NSRect)theRect
longerKeyword:(float)theInterval
error:(NSError **)theError {
}
After:
- (void)shortf:(GTMFoo *)theFoo
longKeyword:(NSRect)theRect
longerKeyword:(float)theInterval
error:(NSError **)theError {
}
llvm-svn: 256738
|
| |
|
|
| |
llvm-svn: 256737
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
optional AAA aaa = 1 [foo =
{
key: "a" //
},
bar = {
key: "a" //
}];
After:
optional AAA aaa = 1 [
foo = {
key: "a" //
},
bar = {
key: "a" //
}
];
llvm-svn: 256736
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
breaking between array subscripts.
Before:
if (aaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaa]
[aaaaaaaaaaaaa])
After:
if (aaaaaaaaaaaaaaaaaaaaaaaa &&
aaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaa][aaaaaaaaaaaaa])
llvm-svn: 256640
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
function foo(check: Object): check
is{foo: string, bar: string, baz: string, foobar: string} {
return 'bar' in check;
}
After:
function foo(check: Object):
check is {foo: string, bar: string, baz: string, foobar: string} {
return 'bar' in check;
}
llvm-svn: 256631
|
| |
|
|
|
|
|
|
|
|
|
| |
Before:
enum: string
[];
After:
enum: string[];
llvm-svn: 256546
|
| |
|
|
|
|
|
|
|
|
| |
Before:
int x = f (&h)();
After:
int x = f(&h)();
llvm-svn: 256488
|
| |
|
|
| |
llvm-svn: 256412
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
Include sorting generally can break .cc files, especially on Windows. Make
this opt-in for Chromium style to give us some more time to roll this out.
(Given that the Google style guide is used by many companies, some of them
probably writing code on Windows, one could argue this should be opt-in in
general...)
llvm-svn: 256288
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
interface I {
o: {}
[];
}
After:
interface I {
o: {}[];
}
llvm-svn: 256247
|
| |
|
|
|
|
|
|
| |
initializers. For now, only use it for 20 items or more. Otherwise,
clang-format formats these one-per-line and thus increases the vertical
code size a lot.
llvm-svn: 256246
|
| |
|
|
| |
llvm-svn: 256245
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f() { struct Dummy { };
f();
}
After:
void f() {
struct Dummy {};
f();
}
llvm-svn: 256175
|
| |
|
|
|
|
| |
the main #include.
llvm-svn: 256170
|
| |
|
|
|
|
| |
The style guide allows both, but apparently, this is the more dominant use.
llvm-svn: 256154
|
| |
|
|
|
|
| |
includes.
llvm-svn: 256153
|
| |
|
|
|
|
|
|
|
|
|
| |
Before, the first (non-system) header in a file was considered to be
the main include. This is conservative as it makes clang-format change
the #include order less often. Instead implement some basic usage of
the filename itself. With this patch, clang-format considers every
header to be a main include if the header file's basename is a prefix
to the filename the #include is in.
llvm-svn: 256148
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
Specifically, it is sometimes necessary to keep certain #includes as
the first #include, even before the main #include for a .cc file.
Switching the category to be signed instead of unsigned isn't ideal,
but it seems as good of an option as any and is fully backwards
compatible.
llvm-svn: 255757
|
| |
|
|
|
|
|
|
| |
Brought up in codereviews:
http://reviews.llvm.org/D15445
http://reviews.llvm.org/D15485
llvm-svn: 255484
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: 254414
|
| |
|
|
|
|
| |
Patch by Alexander Richardson, thank you!
llvm-svn: 254407
|
| |
|
|
|
|
|
|
|
|
|
| |
misalignments like the following:
int a, b = 2;
int c = 3;
Patch by Beren Minor, thanks!
llvm-svn: 254406
|
| |
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
multiple lines, also break before the variable name.
Before:
std::vector<aaaaaa, // wrap
aa> aaa;
After:
std::vector<aaaaaa, // wrap
aa>
aaa;
llvm-svn: 253871
|
| |
|
|
| |
llvm-svn: 253860
|
| |
|
|
| |
llvm-svn: 253772
|
| |
|
|
|
|
| |
work properly.
llvm-svn: 253674
|
| |
|
|
| |
llvm-svn: 253672
|
| |
|
|
| |
llvm-svn: 253671
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command line flag can from now on be used to override whatever is set
in the style.
llvm-svn: 253202
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 252089
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unaffected lines with incorrect initial indent.
Starting from:
namespace {
int i; // There shouldn't be indentation here.
int j; // <- call clang-format on this line.
}
Before:
namespace {
int i;
int j;
}
After:
namespace {
int i;
int j;
}
llvm-svn: 251824
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
after a change. With r251474, clang-format could indent the entire rest of the file, if there is a missing closing brace, e.g. while writing code in an editor.
Summary:
With this change, clang-format stops formatting when either it leaves
the current scope or when it comes back to the initial scope after
going into a nested one.
Reviewers: klimek
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D14213
llvm-svn: 251760
|
| |
|
|
|
|
|
|
| |
Correct handling for C++17 inline namespaces. We would previously fail to
identify the inline namespaces as a namespace name since multiple ones may be
concatenated now with C++17.
llvm-svn: 251690
|