- May 26, 2015
-
-
Daniel Jasper authored
This fixes a case where the column limit was incorrectly calculated leading to a macro like this: #define A \ [] { \ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx( \ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx); \ } exceeding the column limit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238182 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 12, 2015
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237114 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: #define MACRO() \ Debug(aaa, /* force line break */ \ { \ int i; \ int j; \ }) After: #define MACRO() \ Debug(aaa, /* force line break */ \ { \ int i; \ int j; \ }) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237108 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
Summary: a) Pull out a class LevelIndentTracker whose responsibility is to keep track of the indent of levels across multiple annotated lines. b) Put all responsibility for merging lines into the LineJoiner; make the LineJoiner iterate over the lines so we never operate on a line that might be merged later; this makes the interface safer to use. c) Move formatting of the end-of-file whitespace into formatFirstToken. Fix bugs that became obvious after the refactoring: 1. We would not format lines with offsets correctly inside nested blocks if only the outer expression was affected: int x = s({ // clang-format only this line class X { public: // ^ this starts at the non-modified indnent level; previously we would // not fix this, now we correctly outdent it. void f(); }; }); 2. We would incorrectly align comments across lines that do not have comments for lines with nested blocks: int expression; // with comment int x = s({ int y; // comment int z; // we would incorrectly align this comment with the comment on // 'expression' }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237104 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 11, 2015
-
-
Manuel Klimek authored
Pull various parts of the UnwrappedLineFormatter into their own abstractions. NFC. There are two things left for subsequent changes (to keep this reasonably small) - the UnwrappedLineFormatter now has a bad name - the UnwrappedLineFormatter::format function is still too large git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236974 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 07, 2015
-
-
Manuel Klimek authored
Implements a way to retrieve information about whether some lines were not formatted due to syntax errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236722 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 05, 2015
-
-
Daniel Jasper authored
Patch by Martin Probst. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236485 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 30, 2015
-
-
Daniel Jasper authored
Before (with the appropriate flags settings): if (a) { f(); } else { g(); } Before (with other appropriate flags settings): if (a) { f(); } else { g(); } After: if (a) { f(); } else { g(); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236217 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 29, 2015
-
-
Daniel Jasper authored
Buggy case: someFunction( [] { // comment int i; // invoke formatting here. }, // force line break aaa); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236091 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 23, 2015
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235580 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 13, 2015
-
-
Daniel Jasper authored
Formatting: #define A { { #define B } } Before: #define A \ { \ { #define B } \ } After: #define A \ { \ { #define B \ } \ } This fixes llvm.org/PR22884. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232166 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 09, 2015
-
-
Daniel Jasper authored
I.e.: #define A public: // The new line before this line would be removed. int a; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231636 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 07, 2015
-
-
Nico Weber authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228483 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 04, 2015
-
-
Nico Weber authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228148 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 29, 2015
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227427 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 23, 2015
-
-
Daniel Jasper authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226930 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 17, 2014
-
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224430 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 12, 2014
-
-
Daniel Jasper authored
This fixed llvm.org/PR21804 and hopefully a few other strange cases. Before: if (blah_blah(whatever, whatever, [] { doo_dah(); doo_dah(); })) { } } After: if (blah_blah(whatever, whatever, [] { doo_dah(); doo_dah(); })) { } } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224112 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 10, 2014
-
-
Daniel Jasper authored
No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223936 91177308-0d34-0410-b5e6-96231b3b80d8
-