| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Found by -Wmissing-prototypes.
llvm-svn: 231668
|
|
|
|
|
|
|
|
|
|
|
| |
I.e.:
#define A public:
// The new line before this line would be removed.
int a;
llvm-svn: 231636
|
|
|
|
|
|
| |
NFC.
llvm-svn: 231597
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was already a TODO to double-check whether the extra indenation
makes sense. A slightly different case reveals that it is actively harmful:
for (int i = 0; i < aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
bbbbbbbbbbbbbbbbbbbb < ccccccccccccccc;
++i) {
}
Here (and it is probably not a totally infrequent case, it just works out that
"i < " is four spaces and so the four space extra indentation makes the
operator precedence confusing. So, this will now instead be formatted
as:
for (int i = 0; i < aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
bbbbbbbbbbbbbbbbbbbb < ccccccccccccccc;
++i) {
}
llvm-svn: 231461
|
|
|
|
| |
llvm-svn: 231067
|
|
|
|
|
|
|
|
|
| |
With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can continue a preprocessor directive and initialize values
accordingly.
llvm-svn: 231066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
aaaaaaaaaaaaaaaaaaaaaa(
[](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa)
-> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; });
After:
aaaaaaaaaaaaaaaaaaaaaa(
[](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa {
return aaaaaaaaaaaaaaaaa;
});
llvm-svn: 230942
|
|
|
|
| |
llvm-svn: 230910
|
|
|
|
|
|
|
|
| |
Seems like the most consistent thing to do and in multi-var DeclStmts,
it is especially important to point out that the */& bind to the
identifier.
llvm-svn: 230903
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
NSArray *array = @[ @"a", @"a", ];
After:
NSArray *array = @[
@"a",
@"a",
];
llvm-svn: 230741
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
Aaaa aaaaaaaaaaa{
{
a, // +1 indent weird.
b, // trailing comma signals one per line.
}, // trailing comma signals one per line.
};
After:
Aaaa aaaaaaaaaaa{
{
a, // better!?
b, // trailing comma signals one per line.
}, // trailing comma signals one per line.
};
Interesting that this apparently was entirely untested :-(.
llvm-svn: 230627
|
|
|
|
|
|
|
|
|
|
| |
Before:
vector<int>(*foo_)[6];
After:
vector<int> (*foo_)[6];
llvm-svn: 230625
|
|
|
|
|
|
| |
This isn't generally nice, but better than violating the column limit.
llvm-svn: 230620
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.. when using SpacesInCStyleCastParentheses != SpacesInParentheses.
Before:
FormatStyle Spaces = getLLVMStyle();
Deleted &operator=(const Deleted &)& = default;
Spaces.SpacesInParentheses = true;
Deleted(const Deleted &)& = default;
Spaces.SpacesInCStyleCastParentheses = true;
Spaces.SpacesInParentheses= false;
Deleted( const Deleted & )& = default;
After:
FormatStyle Spaces = getLLVMStyle();
Deleted &operator=(const Deleted &)& = default;;
Spaces.SpacesInParentheses= true;
Deleted( const Deleted & )& = default;
Spaces.SpacesInCStyleCastParentheses = true;
Spaces.SpacesInParentheses= false;
Deleted(const Deleted &)& = default;
Patch by Jean-Philippe Dufraigne. Thank you!
llvm-svn: 230473
|
|
|
|
|
|
| |
Commit of patch in http://reviews.llvm.org/D7871
llvm-svn: 230395
|
|
|
|
|
|
| |
Commit of review http://reviews.llvm.org/D7766
llvm-svn: 230061
|
|
|
|
|
|
|
|
|
| |
Merge template strings (marked by backticks ``).
Do not format any contents of template strings.
Patch by Martin Probst. Thank you.
llvm-svn: 230011
|
|
|
|
|
|
| |
Patch by Martin Probst, thank you!
llvm-svn: 229865
|
|
|
|
|
|
| |
Patch by Martin Probst.
llvm-svn: 229863
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 229862
|
|
|
|
|
|
| |
Committing patch http://reviews.llvm.org/D6800.
llvm-svn: 229783
|
|
|
|
|
|
|
|
| |
Based on Java annotation support and style.
Patch by Martin Probst.
llvm-svn: 229703
|
|
|
|
|
|
|
|
|
|
| |
This adds support for JavaScript class definitions (again following
TypeScript & AtScript style). This only required support for
visibility modifiers in JS, everything else was already working.
Patch by Martin Probst, thank you.
llvm-svn: 229701
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for type annotations that follow TypeScript's,
Flow's, and AtScript's syntax style.
Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D7721
llvm-svn: 229700
|
|
|
|
| |
llvm-svn: 229486
|
|
|
|
| |
llvm-svn: 229485
|
|
|
|
|
|
| |
requiring the macro. NFC; Clang edition.
llvm-svn: 229339
|
|
|
|
| |
llvm-svn: 229326
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents contracting:
auto lambda = []() {
int a = 2
#if A
+ 2
#endif
;
};
into:
auto lambda = []() { int a = 2
#if A + 2
#endif ; };
Which is obviously BAD.
This fixes llvm.org/PR22496.
llvm-svn: 228522
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
@try {
// ...
}
@finally {
// ...
}
Now:
@try {
// ...
} @finally {
// ...
}
This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.
This is dependent on BraceBreakingStyle. The snippet above is with the
Attach style. Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.
llvm-svn: 228483
|
|
|
|
| |
llvm-svn: 228288
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets clang-format format
__try {
} __except(0) {
}
and
__try {
} __finally {
}
correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set,
so this turns this on. This also enables a few other keywords, but it
shouldn't overly perturb regular clang-format operation. __except is a
context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to
a few more places.
Fixes PR22321.
llvm-svn: 228148
|
|
|
|
|
|
|
| |
Added an assertion that triggered in an existing test case (without
observable differences) and fixed the code.
llvm-svn: 227677
|
|
|
|
|
|
|
|
|
|
| |
I have so far not succeeded in finding a nicely reduced test case or an
observable difference which could help me create a test failure without
msan.
Committing without test to unblock kcc's further fuzzing progress.
llvm-svn: 227433
|
|
|
|
| |
llvm-svn: 227427
|
|
|
|
|
|
|
|
| |
We did't properly mark all of an AnnotatedLine's children as finalized
and thus would reformat the same tokens in different branches of #if/#else
sequences leading to invalid replacements.
llvm-svn: 226930
|
|
|
|
|
|
|
|
|
|
| |
Before:
*a = b *c;
After:
*a = b * c;
llvm-svn: 226923
|
|
|
|
| |
llvm-svn: 226698
|
|
|
|
| |
llvm-svn: 226685
|
|
|
|
| |
llvm-svn: 226680
|
|
|
|
|
|
| |
Discovered by the awesome test case and ASAN.
llvm-svn: 226678
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
const char *x =
"hello llvm";
After:
const char *x = "hello llvm";
This fixes llvm.org/PR22245.
Patch by Bill Meltsner, thank you!
llvm-svn: 226564
|
|
|
|
|
|
|
|
| |
Crashing input:
/\
/ comment
llvm-svn: 226454
|
|
|
|
|
|
|
|
|
|
|
| |
Previously crashing input:
void f(
#if A
);
#else
#endif
llvm-svn: 226451
|
|
|
|
|
|
| |
Input "a<," made clang-format crash.
llvm-svn: 226450
|
|
|
|
| |
llvm-svn: 226449
|
|
|
|
| |
llvm-svn: 226448
|
|
|
|
| |
llvm-svn: 226447
|
|
|
|
|
|
|
| |
This assert would trigger on:
#d , = }
llvm-svn: 226446
|
|
|
|
|
|
|
| |
Disable AlwaysBreakBeforeMultilineString, as the style guides don't
really say to do so.
llvm-svn: 225982
|