| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
if (aaaaaaaa && bbbbbbbbbbbbbbb // need to wrap
== cccccccccccccc) ...
After:
if (aaaaaaaa
&& bbbbbbbbbbbbbbb // need to wrap
== cccccccccccccc) ...
The same rule has already be implemented for BreakBeforeBinaryOperators
set to false in r205527.
llvm-svn: 206159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeFunction([]() {
int i = 42;
return i;
},
[]() {
int j = 43;
return j;
});
After:
SomeFunction([]() {
int i = 42;
return i;
},
[]() {
int j = 43;
return j;
});
llvm-svn: 205848
|
|
|
|
|
|
| |
No functional changes intended.
llvm-svn: 204930
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Among other things, this fixes llvm.org/PR15269.
llvm-svn: 197900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Especially try to keep existing line breaks before raw string literals,
as the code author might have aligned content to it.
Thereby, clang-format now keeps things like:
parseStyle(R"(
BasedOnStyle: Google,
ColumnLimit: 100)");
parseStyle(
R"(BasedOnStyle: Google,
ColumnLimit: 100)");
llvm-svn: 197368
|
|
|
|
| |
llvm-svn: 195253
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f() {
CHECK_EQ(aaaa, (
*bbbbbbbbb)->cccccc)
<< "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";
}
After:
void f() {
CHECK_EQ(aaaa, (*bbbbbbbbb)->cccccc)
<< "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";
}
llvm-svn: 195240
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
indentation with tabs.
Summary:
Store IndentationLevel in ParentState and use it instead of the
Line::Level when indening.
Also fixed incorrect indentation level calculation in formatFirstToken.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1797
llvm-svn: 192563
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now correctly format:
void SomeFunction(int param1,
#ifdef X
NoTemplate param2,
#else
template <
#ifdef A
MyType<Some> >
#else
Type1, Type2>
#endif
param2,
#endif
param3) {
f();
}
llvm-svn: 192503
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Pure refactoring, should be no semantic changes.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1796
llvm-svn: 191772
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This also unifies the handling of escaped newlines for all tokens.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1638
llvm-svn: 190405
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes two issues:
1) The indent of a line comment was not adapted to the subsequent
statement as it would be outside of a nested block.
2) A missing DryRun flag caused actualy breaks to be inserted in
overly long comments while trying to come up with the best line
breaking decisions.
llvm-svn: 190123
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Among other things, this enables (better) formatting lambdas and
constructs like:
MACRO({
long_statement();
long_statement_2();
},
{
long_statement();
long_statement_2();
},
{ short_statement(); }, "");
This fixes llvm.org/PR15381.
llvm-svn: 190038
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
literals).
Summary:
Calculate characters in the first and the last line correctly so that
we only break before the literal when needed.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1544
llvm-svn: 189595
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes llvm.org/PR14818.
Before:
return llvm::StringSwitch<Reference::Kind>(name)
.StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
.StartsWith(".eh_frame", ORDER_EH_FRAME)
.StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
.StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);
After:
return llvm::StringSwitch<Reference::Kind>(name)
.StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
.StartsWith(".eh_frame", ORDER_EH_FRAME)
.StartsWith(".init", ORDER_INIT)
.StartsWith(".fini", ORDER_FINI)
.StartsWith(".hash", ORDER_HASH)
.Default(ORDER_TEXT);
llvm-svn: 189353
|
|
|
|
|
|
|
|
| |
.. in conjunction with Style.AlwaysBreakBeforeMultilineStrings. Also,
simplify the implementation by handling newly split strings and already
split strings by the same code.
llvm-svn: 189102
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch, braced lists (with more than 3 elements are formatted in a
column layout if possible). E.g.:
static const uint16_t CallerSavedRegs64Bit[] = {
X86::RAX, X86::RDX, X86::RCX, X86::RSI, X86::RDI,
X86::R8, X86::R9, X86::R10, X86::R11, 0
};
Required other changes:
- FormatTokens can now have a special role that contains extra data and can do
special formattings. A comma separated list is currently the only
implementation.
- Move penalty calculation entirely into ContinuationIndenter (there was a last
piece still in UnwrappedLineFormatter).
Review: http://llvm-reviews.chandlerc.com/D1457
llvm-svn: 189018
|
|
Goals: Structure code better and make components easier to use for
future features (e.g. column layout for long braced initializers).
No functional changes intended.
llvm-svn: 188543
|