| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203
llvm-svn: 264257
|
|
|
|
|
|
| |
This reverts commit r264254.
llvm-svn: 264256
|
|
|
|
| |
llvm-svn: 264254
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, format::getStyle assumes that the given file resides in
the real file system, which prevents the use of virtual file system in testing etc.
This patch adds a parameter in format::getStyle interface so that users can specify
the right file system. By default, the file system is the real file system.
Reviewers: djasper, klimek
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D18399
llvm-svn: 264253
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Test commit access to clang repo.
Reviewers: cfe-commits
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D18432
llvm-svn: 264252
|
|
|
|
|
|
|
|
|
| |
"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.
Patch by Martin Probst.
llvm-svn: 264055
|
|
|
|
|
|
|
|
|
| |
The operators | and & in types, as opposed to the bitwise operators,
should not have whitespace around them (e.g. `Foo<Bar|Baz>`).
Patch by Martin Probst. Thank you.
llvm-svn: 263961
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a regular expression to configure suffixes of an
included file to check whether it is the "main" include of the current
file. Previously, clang-format has allowed arbitrary suffixes on the
formatted file, which is still the case when no IncludeMainRegex is
specified.
llvm-svn: 263943
|
|
|
|
|
|
| |
change affected ranges.
llvm-svn: 263713
|
|
|
|
|
|
|
|
|
|
| |
Before:
x.of ();
After:
x.of();
llvm-svn: 263710
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a call takes a single argument, using AlwaysBreak can lead to lots
of wasted lines and additional indentation without improving the
readability in a significant way.
Before:
caaaaaaaaaaaall(
caaaaaaaaaaaall(
caaaaaaaaaaaall(
caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa))));
After:
caaaaaaaaaaaall(caaaaaaaaaaaall(caaaaaaaaaaaall(
caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa))));
llvm-svn: 263709
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations prevents breaking code during development, which greatly
improves usability.
JS code should still use semicolons, and ASI code should be flagged by
a compiler or linter.
Patch by Martin Probst. Thank you.
llvm-svn: 263470
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (let { a, b } of x) {
}
After:
for (let {a, b} of x) {
}
llvm-svn: 262776
|
|
|
|
|
|
|
| |
Otherwise, clang-format can output useless replacements in the presence
of identical #includes
llvm-svn: 262630
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow the Google JavaScript style
guide:
https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings
This functionality is behind the option "JavaScriptQuotes", which can be:
* "leave" (no re-quoting)
* "single" (change to single quotes)
* "double" (change to double quotes)
This also changes single quoted JavaScript string literals to be treated
as tok::string_literal, not tok::char_literal, which fixes two unrelated
tests.
Patch by Martin Probst. Thank you.
llvm-svn: 262534
|
|
|
|
|
|
| |
Patch by Erik Kessler, thank you.
llvm-svn: 262402
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a commonly useful feature to have, and we have implemented it
multiple times with different kinds of bugs. This implementation
centralizes the idea in a set of functions that we can then use from the various
tools.
Reverts r262234, which is a revert of r262232, and puts the functions
into FOrmat.h, as they are closely coupled to clang-format, and we
otherwise introduce a cyclic dependency between libFormat and
libTooling.
Patch by Eric Liu.
llvm-svn: 262323
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ternary expressions.
Before:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb +
cccccccccccccccc;
After:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
aaaaa :
bbbbbbbbbbbbbbb + cccccccccccccccc;
llvm-svn: 262293
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa]
[a].aaaaaaaaaaaaaaaaaaaaaa();
After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a]
.aaaaaaaaaaaaaaaaaaaaaa();
llvm-svn: 262292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var x = {
a: a,
b: b, 'c': c,
};
After:
var x = {
a: a,
b: b,
'c': c,
};
llvm-svn: 262291
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change:
SomeFunction(
[] {
int i;
return i; // Format this line.
},
[] {
return 2; // Don't "fix" this.
});
llvm-svn: 262216
|
|
|
|
|
|
| |
style.
llvm-svn: 261563
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 261528
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (var i of[2, 3]) {}
After:
for (var i of [2, 3]) {}
llvm-svn: 260518
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
<< aaa;
After:
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
Diag(aaaaaaaaaaaaaaaaaaaa, aaaaaaaa)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
<< aaa;
llvm-svn: 260517
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, make it more expensive than breaking after the return
type of a function definition/declaration.
Before:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
After:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
llvm-svn: 260497
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, //
ccccccc(aaaaaaaaaaaaaaaaa, //
b));
After:
bbbbbbbbbbbb(aaaaaaaaaaaaaaaaaaaaaaaa, //
ccccccc(aaaaaaaaaaaaaaaaa, //
b));
This fixes llvm.org/PR24905.
llvm-svn: 260080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
f({a},
() => {
g(); //
});
After:
f({a}, () => {
g(); //
});
llvm-svn: 260060
|
|
|
|
|
|
| |
style.
llvm-svn: 260057
|
|
|
|
|
|
|
|
|
|
| |
Before:
f(a.operator() < A > ());
After:
f(a.operator()<A>());
llvm-svn: 259884
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
/*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb :
ccccccccccccccccccccccccccc;
After:
int i = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
/*bbbbbbbbbbbbbbbbbbbb=*/bbbbbbbbbbbbbbbbbbbbbbbbb :
ccccccccccccccccccccccccccc;
llvm-svn: 259670
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum?: string
[];
After:
enum?: string[];
llvm-svn: 259628
|
|
|
|
|
|
| |
Patch by Matthew Whitehead, thank you.
llvm-svn: 259487
|
|
|
|
|
|
|
|
|
|
|
|
| |
initializers.
Before:
Constructor() : member([](A *a, B * b) {}) {}
After:
Constructor() : member([](A *a, B *b) {}) {}
llvm-svn: 259353
|
|
|
|
| |
llvm-svn: 259352
|
|
|
|
| |
llvm-svn: 259351
|
|
|
|
| |
llvm-svn: 259350
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
@Annotation("Some"
+ " text")
List<Integer>
list;
After:
@Annotation("Some"
+ " text")
List<Integer> list;
llvm-svn: 258981
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html
"This is the way [autoconf] ends
Not with a bang but a whimper."
-T.S. Eliot
Reviewers: chandlerc, grosbach, bob.wilson, echristo
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D16472
llvm-svn: 258862
|
|
|
|
|
|
|
|
|
|
| |
Before:
a[ ::b::c];
After:
a[::b::c];
llvm-svn: 258123
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaa[bbbb]
.cccc();
After:
aaaa[bbbb].cccc();
llvm-svn: 257763
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang-format only works for JavaScript code, if all the semicolons are
present anyway, so this linebreak can never be desired.
Before (with appropriate statement lengths or column limit):
return
[ aaa ];
After:
return [
aaaa
];
llvm-svn: 257741
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After reading the style guides again, they don't actually say how to
pack or not pack array literals. Based on some user reports, array
initializers can unnecessarily get quite long if they contain many
small elements. Array literals with trailing commas are still formatted
one per line so that users have a way to opt out of the packing.
Before:
var array = [
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa,
aaaaaa
];
After:
var array = [
aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa, aaaaaa,
aaaaaa, aaaaaa
];
llvm-svn: 257615
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
export abstract class X {y: number;}
(and all sorts of other havoc in more complicated cases).
After:
export abstract class X { y: number; }
llvm-svn: 257451
|
|
|
|
| |
llvm-svn: 257406
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As soon as a comment had whitespace changes inside of the token, we
couldn't identify the whole comment as a trailing comment anymore and
alignment stopped working. Add a new boolean to Change for this special
case and fix trailing comment identification to use it.
This also changes WhitespaceManager to sum the length of all Changes
inside of a token into the first Change.
Before this fix
int xy; // a
int z; //b
became
int xy; // a
int z; // b
with this patch we immediately get to:
int xy; // a
int z; // b
Differential Revision: http://reviews.llvm.org/D16058
llvm-svn: 257341
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaa operator,(aaaaaaaaaaaaaaaaaaaaa &
aaaaaaaaaaaaaaaaaaaaaaaaaa) const;
After:
aaaaaaaaaaaaaaaaaaaaaa operator,(
aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaaaaaaaaaaaaaaaaaaa) const;
llvm-svn: 257330
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r257257 change the way clang-format enforces line breaks after a
templated type has been line-wrapped. This was to fix an incorrect line
break if BinPackParameters is set to false. However, it also leads to
an unwanted line break in a different case. Thus, for now, only do this
when BinPackParameters is false. This isn't ideal yet, but helps us
until we have a better solution.
With BinPackParameters:
Before:
void fffffffffff(aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaa> aaaaaaaaaa);
After:
void fffffffffff(
aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaa>
aaaaaaaaaa);
llvm-svn: 257325
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
return [
aaaaaaaaaaaaaaaaaaaaaa
].aaaaaaa(function() {
//
})
.bbbbbb();
After:
return [aaaaaaaaaaaaaaaaaaaaaa]
.aaaaaaa(function() {
//
})
.bbbbbb();
llvm-svn: 257324
|
|
|
|
|
|
|
|
| |
Previously, all whitespace characters would increase the starting
column, which doesn't make sense. This fixes a problem, e.g. with the
length calculation in JS template strings.
llvm-svn: 257267
|