- Aug 13, 2014
-
-
Benjamin Kramer authored
Modifications made by clang-tidy with minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215557 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 09, 2014
-
-
Daniel Jasper authored
Also run clang-format over clang-format's files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208409 91177308-0d34-0410-b5e6-96231b3b80d8
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208392 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 08, 2014
-
-
Daniel Jasper authored
Most of this patch was created by Alexander Rojas in http://reviews.llvm.org/D2555 Thank you! Synced and addressed review comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208302 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: return {body: {setAttribute: function(key, val) {this[key] = val; } , getAttribute : function(key) { return this[key]; } , style : { direction: '' } } } ; After: return { body: { setAttribute: function(key, val) { this[key] = val; }, getAttribute: function(key) { return this[key]; }, style: {direction: ''} } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208292 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 14, 2014
-
-
Manuel Klimek authored
Now correctly formats: { int a; void f() { callme(some(parameter1, <<<<<<< text by the vcs parameter2), ||||||| text by the vcs parameter2), parameter3, ======= text by the vcs parameter2, parameter3), >>>>>>> text by the vcs otherparameter); } } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206157 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 11, 2014
-
-
Manuel Klimek authored
We will need this to correctly handle conflict markers inside macro definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206029 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 07, 2014
-
-
Ahmed Charles authored
This compiles cleanly with lldb/lld/clang-tools-extra/llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 24, 2014
-
-
Manuel Klimek authored
This was done when we were not able to parse lambdas to handle some edge cases for block formatting different in return statements, but is not necessary any more. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199982 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 07, 2014
-
-
Chandler Carruth authored
encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 23, 2013
-
-
Daniel Jasper authored
Among other things, this fixes llvm.org/PR15269. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197900 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 12, 2013
-
-
Alexander Kornienko authored
Summary: Added BraceBreakingStyle::BS_GNU. I'm not sure about the correctness of static initializer formatting, but compound statements should be fine. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2372 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197138 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 13, 2013
-
-
Manuel Klimek authored
While it is mostly a user error to have the extra semicolon, formatting it graciously will correctly format in the cases where we do not fully understand the code (macros). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192543 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 11, 2013
-
-
Manuel Klimek authored
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(); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192503 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 13, 2013
-
-
Daniel Jasper authored
Before: enum { Bar = Foo < int, int > ::value }; After: enum { Bar = Foo<int, int>::value }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190674 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 05, 2013
-
-
Douglas Gregor authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190075 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190038 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 04, 2013
-
-
Manuel Klimek authored
This patch makes sure we produce the right number of unwrapped lines, a follow-up patch will make the whitespace formatting consistent. Before: void f() { int i = {[operation setCompletionBlock : ^{ [self onOperationDone]; }] } ; } After: void f() { int i = {[operation setCompletionBlock : ^{ [self onOperationDone]; }] }; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189932 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 03, 2013
-
-
Manuel Klimek authored
Implements parsing of lambdas in the UnwrappedLineParser. This introduces the correct line breaks; the formatting of lambda captures are still incorrect, and the braces are also still formatted as if they were braced init lists instead of blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189818 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 01, 2013
-
-
Daniel Jasper authored
With this patch, clang-format can be configured to: * not indent in namespace at all (former behavior). * indent in namespace as in other blocks. * indent only in inner namespaces (as required by WebKit style). Also fix alignment of access specifiers in WebKit style. Patch started by Marek Kurdej. Thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187540 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 09, 2013
-
-
Daniel Jasper authored
Before: someFunction(OtherParam, BracedList{ // comment 1 (Forcing intersting break) param1, param2, // comment 2 param3, param4 }); After: someFunction(OtherParam, BracedList{ // comment 1 (Forcing intersting break) param1, param2, // comment 2 param3, param4 }); To do so, the UnwrappedLineParser now stores the information about the kind of brace in the FormatToken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185914 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jul 08, 2013
-
-
Daniel Jasper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185823 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 03, 2013
-
-
Alexander Kornienko authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183115 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 29, 2013
-
-
Manuel Klimek authored
Gets rid of AnnotatedToken, putting everything into FormatToken. FormatTokens are created once, and only referenced by pointer. This enables multiple future features, like having tokens shared between multiple UnwrappedLines (while there's still work to do to fully enable that). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182859 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 28, 2013
-
-
Manuel Klimek authored
The FormatToken is now not copyable any more. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182772 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
With this patch, we create all tokens in one go before parsing and pass an ArrayRef<FormatToken*> to the UnwrappedLineParser. The UnwrappedLineParser is switched to use pointer-to-token internally. The UnwrappedLineParser still copies the tokens into the UnwrappedLines. This will be fixed in an upcoming patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182768 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 27, 2013
-
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182742 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
Unify handling of whitespace when breaking protruding tokens with other whitespace replacements. As a side effect, the BreakableToken structure changed significantly: - have a common base class for single-line breakable tokens, as they are much more similar - revamp handling of multi-line comments; we now calculate the information about lines in multi-line comments similar to normal tokens, and always issue replacements As a result, we were able to get rid of special casing of trailing whitespace deletion for comments in the whitespace manager and the BreakableToken and fixed bugs related to tab handling and escaped newlines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182738 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182732 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 24, 2013
-
-
Alexander Kornienko authored
Summary: Added stack of preprocessor branching directives, and ignore all tokens inside #if 0 except for preprocessor directives. Reviewers: klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D855 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182658 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 23, 2013
-
-
Manuel Klimek authored
Replaces the use of WhitespaceStart + WhitspaceLength. This made a bug in the formatter obvous where we would incorrectly calculate the next column. FIXME: There's a similar bug left regarding TokenLength. We should probably also move to have a TokenRange instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182572 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182569 91177308-0d34-0410-b5e6-96231b3b80d8
-
Manuel Klimek authored
Allows formatting of C++11 braced init list constructs, like: vector<int> v { 1, 2, 3 }; f({ 1, 2 }); This involves some changes of how tokens are handled in the UnwrappedLineFormatter. Note that we have a plan to evolve the design of the token flow into one where we create all tokens up-front and then annotate them in the various layers (as we currently already have to create all tokens at once anyway, the current abstraction does not help). Thus, this introduces FIXMEs towards that goal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182568 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 15, 2013
-
-
Daniel Jasper authored
We only ever implemented one and that one is not actually all that helpful (e.g. gets incorrectly triggered by macros). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181871 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 17, 2013
-
-
Alexander Kornienko authored
Summary: Added BreakableLineComment, moved common code from BreakableBlockComment to newly added BreakableComment. As a side-effect of the rewrite, found another problem with escaped newlines and had to change code which removes trailing whitespace from line comments not to break after this patch. Reviewers: klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D682 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179693 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 12, 2013
-
-
Manuel Klimek authored
Previously we'd only detect structural errors on the very first level. This leads to incorrectly balanced braces not being discovered, and thus incorrect indentation. This change fixes the problem by: - changing the parser to use an error state that can be detected anywhere inside the productions, for example if we get an eof on SOME_MACRO({ some block <eof> - previously we'd never break lines when we discovered a structural error; now we break even in the case of a structural error if there are two unwrapped lines within the same line; thus, void f() { while (true) { g(); y(); } } will still be re-formatted, even if there's missing braces somewhere in the file - still exclude macro definitions from generating structural error; macro definitions are inbalanced snippets git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179379 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 04, 2013
-
-
Daniel Jasper authored
With [] marking the selected range, clang-format invoked on [ ] int a; Would so far not reformat anything. With this patch, it formats a line if its leading whitespace is touched. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176435 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 29, 2013
-
-
Daniel Jasper authored
No functional changes. Also removed experimental-warning from all of clang-format's files, as it is no longer accurate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173830 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 23, 2013
-
-
Manuel Klimek authored
This gives us the ability to guess better defaults for whether a * between identifiers is a pointer dereference or binary operator. Now correctly formats: void f(a *b); void f() { f(a * b); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173243 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 22, 2013
-
-
Manuel Klimek authored
Changing nextToken() in the UnwrappedLineParser to get the next non-comment token. This allows us to correctly layout a whole class of snippets, like: if /* */(/* */ a /* */) /* */ f() /* */; /* */ else /* */ g(); Fixes a bug in the formatter where we would assume there is a previous non-comment token. Also adds the indent level of an unwrapped line to the debug output in the parser. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173168 91177308-0d34-0410-b5e6-96231b3b80d8
-