| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Disable AlwaysBreakBeforeMultilineString, as the style guides don't
really say to do so.
llvm-svn: 225982
|
|
|
|
|
|
|
|
|
|
|
| |
r225141 changed the defaults of AllowShortIfStatementsOnASingleLine and
AlignTrailingComments for Google style and added explicit overrides for
Chromium style to undo these changes. For AllowShortIfStatementsOnASingleLine
that's good as the Android style guide (which Chromium uses for Java) explicitly
permits single-line ifs. But it's silent on trailing comments, to it makes
sense for Chromium style to just follow Google style.
llvm-svn: 225363
|
|
|
|
|
|
| |
No tests added as all of these are already tested separately.
llvm-svn: 225141
|
|
|
|
|
|
| |
This led, e.g. to break JavaScript regex literals too early.
llvm-svn: 224419
|
|
|
|
|
|
| |
No functional changes intended.
llvm-svn: 223936
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int f() { // comment return 42; }
After:
int f() { // comment
return 42;
}
This fixes llvm.org/PR21769.
llvm-svn: 223609
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;
Without alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;
This fixes llvm.org/PR21666.
llvm-svn: 223117
|
|
|
|
|
|
|
|
|
|
|
| |
For Java, don't do any of the deviations from Google Style that Chromium style
does for C++.
Chromium's Java follows Android Java style [1], which is roughly Google Java
style with an indent of 4 and a continuation indent of 8.
1: https://source.android.com/source/code-style.html
llvm-svn: 222839
|
|
|
|
|
|
|
|
| |
Activated for and tested by Google's Java style.
This fixes llvm.org/PR21667.
llvm-svn: 222819
|
|
|
|
|
|
| |
Re-apply r222638 and r222641 without variadic templates.
llvm-svn: 222747
|
|
|
|
|
|
| |
does not support variadic templates. Also reverting r222641 because it was relying on 222638.
llvm-svn: 222656
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
switch (a) {
#if FOO
case 0: return 0; #endif
}
After:
switch (a) {
#if FOO
case 0: return 0;
#endif
}
This fixed llvm.org/PR21544.
llvm-svn: 222642
|
|
|
|
|
|
|
| |
Provide more overloads to simplify testing the type of a token. No
functional changes intended.
llvm-svn: 222638
|
|
|
|
|
|
|
| |
These are like import statements and should not be line-wrapped. Minor
restructuring of the handling of other import statements.
llvm-svn: 222637
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously this was only used for JavaScript.
Before:
functionCall({
int i;
int j;
},
aaaa, bbbb, cccc);
After:
functionCall({
int i;
int j;
}, aaaa, bbbb, cccc);
llvm-svn: 222531
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With AllowShortCaseLabelsOnASingleLine set to true:
This gets now left unchanged:
case 1:
// comment
return;
Whereas before it was changed into:
case 1: // comment return;
This fixes llvm.org/PR21630.
llvm-svn: 222529
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
public void union
(Object o);
public void struct
(Object o);
public void delete (Object o);
After:
public void union(Object o);
public void struct(Object o);
public void delete(Object o);
Patch by Harry Terkelsen, thank you!
llvm-svn: 222357
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeFunction(parameter,
parameter);
After:
SomeFunction(parameter,
parameter);
Patch by Harry Terkelsen, thank you!
llvm-svn: 222284
|
|
|
|
|
|
|
|
|
|
| |
Before:
someObject.and ();
After:
someObject.and();
llvm-svn: 221978
|
|
|
|
|
|
|
|
|
|
| |
Before:
Function < F, ? extends T > function;
After:
Function<F, ? extends T> function;
llvm-svn: 221976
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.
Before,
extern "C" {
void ExternCFunction();
}
was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.
Fixes http://crbug.com/432640 and part of PR21419.
llvm-svn: 221897
|
|
|
|
|
|
|
|
| |
This reverts commit eefd2eaad43c5c2b17953ae7ed1e72b28e696f7b.
Apparently, this change was a bit premature.
llvm-svn: 221365
|
|
|
|
|
|
|
|
|
| |
Slightly easier to write, more efficient and prevents bugs by
misspelling them.
No functional changes intended.
llvm-svn: 221259
|
|
|
|
|
|
| |
The style guide is changing..
llvm-svn: 220977
|
|
|
|
| |
llvm-svn: 220883
|
|
|
|
|
|
|
|
|
|
| |
Previously a regex-literal containing "/*" would through clang-format
off, e.g.:
var regex = /\/*$/;
Would lead to none of the following code to be formatted.
llvm-svn: 220860
|
|
|
|
|
|
|
|
|
|
| |
Apparently, people are very much divided on what the "correct"
indentation is. So, best to give them a choice.
The new flag is called ObjCBlockIndentWidth and the default is now set
to the same value as IndentWidth for the pre-defined styles.
llvm-svn: 220784
|
|
|
|
|
|
| |
style.
llvm-svn: 220778
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeFunction([]() {
#define A a
return 43; });
After:
SomeFunction([]() {
#define A a
return 43;
});
llvm-svn: 220684
|
|
|
|
|
|
|
| |
This is desirable for the Chromium style guide:
http://www.chromium.org/developers/coding-style
llvm-svn: 219400
|
|
|
|
|
|
| |
NFC.
llvm-svn: 219000
|
|
|
|
|
|
|
|
|
| |
Specifically, this also counts for stuff like (with style "inline"):
var x = function() {
return 1;
};
llvm-svn: 218689
|
|
|
|
|
|
|
| |
Chromium's now using some c++11 language features, so it's now fine that
clang-format produces vector<vector<int>>.
llvm-svn: 218392
|
|
|
|
| |
llvm-svn: 217759
|
|
|
|
|
|
|
|
|
| |
This will allow:
int aaaaaaaaaaaaaa =
bbbbbbbbbbbbbb
+ ccccccccccccccc;
llvm-svn: 217757
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
http://llvm.org/bugs/show_bug.cgi?id=20892
Add support of C-style formatting enabling/disabling directives. Now the following two styles are supported:
// clang-format on
/* clang-format on */
The flexibility in comments (support of extra spaces and/or slashes, etc.) is deliberately avoided to simplify search in large code bases.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, curdeius, klimek
Differential Revision: http://reviews.llvm.org/D5309
llvm-svn: 217588
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On a single line:
switch (a) {
case 1: x = 1; return;
case 2: x = 2; return;
default: break;
}
Not on a single line:
switch (a) {
case 1:
x = 1;
return;
case 2:
x = 2;
return;
default:
break;
}
This partly addresses llvm.org/PR16535. In the long run, we probably want to
lay these out in columns.
llvm-svn: 217501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var regex = / a\//; int i;
After:
var regex = /a\//;
int i;
This required pushing the Lexer into its wrapper class and generating a
new one in this specific case. Otherwise, the sequence get lexed as a
//-comment. This is hacky, but I don't know a better way (short of
supporting regex literals in the Lexer).
Pushing the Lexer down seems to make all the call sites simpler.
llvm-svn: 217444
|
|
|
|
|
|
|
|
|
|
| |
Before:
not. and . or . not_eq = 1;
After:
not.and.or.not_eq = 1;
llvm-svn: 217179
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This permits to add a space after closing parenthesis of a C-style cast.
Defaults to false to preserve old behavior.
Fixes llvm.org/PR19982.
Before:
(int)i;
After:
(int) i;
Patch by Marek Kurdej.
llvm-svn: 217022
|
|
|
|
|
|
|
|
|
|
| |
ownership is explicitly done using unique_ptr.
Only those callers who are dynamically passing ownership should need the
3 argument form. Those accepting the default ("do pass ownership")
should do so explicitly with a unique_ptr now.
llvm-svn: 216614
|
|
|
|
| |
llvm-svn: 216585
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
int a[5];
a[3] += 42;
After:
int a[ 5 ];
a[ 3 ] += 42;
Fixes LLVM bug #17887 (http://llvm.org/bugs/show_bug.cgi?id=17887).
Patch by Marek Kurdej, thank you!
llvm-svn: 216449
|
|
|
|
|
|
| |
Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording.
llvm-svn: 215982
|
|
|
|
| |
llvm-svn: 214976
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch:
int ThisWillBeFormatted;
// clang-format off
int ThisWontBeFormatted;
// clang-format on
int Formatted;
This is for regions where a significantly nicer code layout can be found
knowing the content of the code.
This fixes llvm.org/PR20463.
llvm-svn: 214966
|
|
|
|
|
|
|
|
|
|
| |
This is required for GNU coding style, among others.
Also update the configuration documentation.
Modified from an original patch by Jarkko Hietaniemi, thank you!
llvm-svn: 214858
|
|
|
|
|
|
| |
Also consolidate 'backward compatibility'
llvm-svn: 212974
|
|
|
|
|
|
|
|
|
| |
Though not completely identical, make former
IndentFunctionDeclarationAfterType change this flag for backwards
compatibility (it is somewhat close in meaning and better the err'ing on
an unknown config flag).
llvm-svn: 212597
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Key changes:
- Correctly (well ...) distinguish function declarations and variable
declarations with ()-initialization.
- Don't indent when breaking function declarations/definitions after the
return type.
- Indent variable declarations and typedefs when breaking after the
type.
This fixes llvm.org/PR17999.
llvm-svn: 212591
|