| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
As the memory ownership is handled by the SpecificBumpPtrAllocator
anyway, there is no need to duplicate states when inserting them into
the Seen-set. This leads to an improvement of ~10% on the benchmark
formatting file.
No functional changes intended.
llvm-svn: 209422
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int i{a *b};
After:
int i{a * b};
Also fix unrelated issue where braced init lists were counted as blocks
and prevented single-line functions.
llvm-svn: 209412
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If simple (one-statement) blocks can be inlined, the length needs to be
calculated correctly.
Before (in JavaScript but this also affects lambdas, etc.):
var x = {
valueOf: function() { return 1; }
};
After:
var x = {valueOf: function() { return 1; }};
llvm-svn: 209410
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
goog.array.forEach(array, function() {
doSomething();
doSomething();
},
this);
After:
goog.array.forEach(array, function() {
doSomething();
doSomething();
}, this);
llvm-svn: 209291
|
| |
|
|
|
|
|
|
|
|
| |
Before:
var b = a.map((x) = > x + 1);
After:
var b = a.map((x) => x + 1);
llvm-svn: 209112
|
| |
|
|
| |
llvm-svn: 208838
|
| |
|
|
|
|
|
|
|
| |
With AllowShortBlocksOnASingleLine, clang-format allows:
if (a) { return; }
Based on patch by Gonzalo BG, thank you!
llvm-svn: 208765
|
| |
|
|
|
|
|
|
|
|
| |
Before:
var regex = /\\/ g; // This isn't even recognized as regex.
After:
var regex = /\\/g; // It now is.
llvm-svn: 208539
|
| |
|
|
|
|
|
| |
Required pulling LambdaExpr::Capture into its own header.
No functionality change.
llvm-svn: 208470
|
| |
|
|
|
|
| |
Also run clang-format over clang-format's files.
llvm-svn: 208409
|
| |
|
|
| |
llvm-svn: 208404
|
| |
|
|
| |
llvm-svn: 208392
|
| |
|
|
| |
llvm-svn: 208285
|
| |
|
|
| |
llvm-svn: 208281
|
| |
|
|
|
|
| |
Patch by Bobby Moretti.
llvm-svn: 208269
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
So that JS functions can also be merged into a single line.
Before:
var func = function() {
return 1;
};
After:
var func = function() { return 1; };
llvm-svn: 208176
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#ifdef _DEBUG
int foo( int i = 0 )
#else
int foo( int i = 5 )
#endif { return i; }
After:
#ifdef _DEBUG
int foo( int i = 0 )
#else
int foo( int i = 5 )
#endif
{
return i;
}
llvm-svn: 207958
|
| |
|
|
| |
llvm-svn: 207533
|
| |
|
|
|
|
|
|
|
|
|
| |
Before:
void f() {
return; }
After:
void f() { return; }
llvm-svn: 207527
|
| |
|
|
|
|
|
|
|
|
| |
definition below all of the header #include lines, clang edition.
If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.
llvm-svn: 206849
|
| |
|
|
| |
llvm-svn: 206339
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also removed spaces before colons as they don't seem to be used
frequently.
Before:
optional int32 b = 2
[(foo_options) = {aaaaaaaaaaaaaaaaaaa : 123 bbbbbbbbbbbbbbbbbbbbbbbb :
"baz"}];
After:
optional int32 b = 2 [(foo_options) = {aaaaaaaaaaaaaaaaaaa: 123,
bbbbbbbbbbbbbbbbbbbbbbbb:"baz"}];
llvm-svn: 206269
|
| |
|
|
|
|
|
|
|
|
|
| |
Before:
int bi{1 '000' 000};
After:
int bi{1'000'000};
This fixes llvm.org/PR19342.
llvm-svn: 206263
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically, for a nested block or lambda, don't try to put the single
statement body inline, if it exceeds the column limit.
This should not change any observable behavior (as those would never
have led to the 'best' solution), but significantly speeds up formatting
time.
This fixes llvm.org/PR18761. Formatting time goes down from ~100s to a
few ms.
llvm-svn: 206260
|
| |
|
|
|
|
|
| |
This somewhat improves the performance problem reported in
llvm.org/PR18761. No other behavior changes intended.
llvm-svn: 206258
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now correctly formats:
{
int a;
void f() {
callme(some(parameter1,
<<<<<<< text by the vcs
parameter2),
||||||| text by the vcs
parameter2),
parameter3,
======= text by the vcs
parameter2, parameter3),
>>>>>>> text by the vcs
otherparameter);
}
}
llvm-svn: 206157
|
| |
|
|
|
|
|
| |
We will need this to correctly handle conflict markers inside macro
definitions.
llvm-svn: 206029
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Before, it would turn:
SomeFunction([]() { // Cool function..
return 43;
});
Into this:
SomeFunction([]() { // Cool function.. return 43; });
llvm-svn: 205849
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before AllowShortFunctionsOnASingleLine could either be true, merging
all functions, or false, merging no functions. This patch adds a third
value "Inline", which can be used to only merge short functions defined
inline in a class, i.e.:
void f() {
return 42;
}
class C {
void f() { return 42; }
};
llvm-svn: 205760
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
switch (a) {
case 1: { return 'a'; }
}
After:
switch (a) {
case 1: {
return 'a';
}
}
llvm-svn: 205611
|
| |
|
|
|
|
|
|
| |
This fixes llvm.org/PR17242.
Patch by Brian Green, thank you!
llvm-svn: 205307
|
| |
|
|
|
|
|
| |
This unbreaks polly-formatting-tests and we can make a decision for
LLVM style independently.
llvm-svn: 204467
|
| |
|
|
| |
llvm-svn: 204462
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
They very rarely aid readability.
Formatting:
void f() {
if (a) {
f();
}
}
Now leads to:
void f() {
if (a) {
f();
}
}
llvm-svn: 204460
|
| |
|
|
|
|
| |
class.
llvm-svn: 203999
|
| |
|
|
|
|
| |
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
|
| |
|
|
|
|
|
|
|
| |
init list formatting. This suggestion has now gone into the LLVM coding
standards, and is particularly relevant now that we're using C++11.
Updated a really ridiculous number of tests to reflect this change.
llvm-svn: 202637
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
auto result = SomeObject
// Calling someFunction on SomeObject
.someFunction();
After:
auto result = SomeObject
// Calling someFunction on SomeObject
.someFunction();
llvm-svn: 201138
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before (81 columns):
#define A \
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { return aaaaaaaa; } \
int i;
After:
#define A \
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() { \
return aaaaaaaa; \
} \
int i;
llvm-svn: 200974
|
| |
|
|
| |
llvm-svn: 200652
|
| |
|
|
|
|
|
| |
Before, this would lead to a crash:
f('', true);
llvm-svn: 200540
|
| |
|
|
|
|
|
|
|
| |
Mozilla and WebKit seem to use a space after @property (verified by
grepping their codebases) so we turn this on there as well.
Change by Christian Legnitto. Thank you!
llvm-svn: 200320
|
| |
|
|
|
|
|
| |
As per the style guide, two lines are required between top-level
elements.
llvm-svn: 199660
|
| |
|
|
|
|
|
|
|
| |
With this patch, there is dedicated testing for protocol buffers
(https://developers.google.com/protocol-buffers/).
Also some minor tweaks formatting tweaks.
llvm-svn: 199580
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Before:
var arr = [ 1, 2, 3 ];
var obj = {a : 1, b : 2, c : 3};
After:
var arr = [1, 2, 3];
var obj = {a: 1, b: 2, c: 3};
llvm-svn: 199317
|
| |
|
|
|
|
|
| |
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.
llvm-svn: 198686
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Added CommentPragmas option for this.
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2460
llvm-svn: 198310
|
| |
|
|
| |
llvm-svn: 198191
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Constructor() : a(a) {}
After:
Constructor()
: a(a)
{
}
This style guide is pretty precise about this.
llvm-svn: 197980
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Unexpectedly, it seems that people commonly know what they were doing
when writing a comment.
Also, being more conservative about comment breaking has the advantage
of giving more flexibility. If a linebreak within the comment can
improve formatting, the author can add it (after which clang-format
won't undo it). There is no way to override clang-format's behavior if
it breaks a comment.
llvm-svn: 197698
|