#
3a33f029 |
| 12-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Implemented GNU-style formatting for compound statements.
Summary: Added BraceBreakingStyle::BS_GNU. I'm not sure about the correctness of static initializer formatting, but compound statements shou
Implemented GNU-style formatting for compound statements.
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
llvm-svn: 197138
show more ...
|
#
763ec2ba |
| 10-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Remove IndentBlocks, which sneaked winto the previous commit
llvm-svn: 196929
|
#
fe7a57fa |
| 10-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Early attempts to format in GNU style.
Summary: This still misses a few important features, so there's no mention of this style in the help message, but a few style rules are implemented.
Reviewers
Early attempts to format in GNU style.
Summary: This still misses a few important features, so there's no mention of this style in the help message, but a few style rules are implemented.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2371
llvm-svn: 196928
show more ...
|
#
c1637f16 |
| 10-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Allow predefined styles to define different options for different languages.
Summary: Allow predefined styles to define different options for different languages so that one can run: clang-format
Allow predefined styles to define different options for different languages.
Summary: Allow predefined styles to define different options for different languages so that one can run: clang-format -style=google file1.cpp file2.js
or use a single .clang-format file with "BasedOnStyle: Google" for both c++ and JS files.
Added Google style for JavaScript with "BreakBeforeTernaryOperators" set to false.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2364
llvm-svn: 196909
show more ...
|
#
6d2c88ea |
| 10-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Trivial change: added 'using clang::format::FormatStyle;'
llvm-svn: 196903
|
#
fdca83d4 |
| 10-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Support GNU style rule to put a space before opening parenthesis.
Summary: The rule from the GNU style states: "We find it easier to read a program when it has spaces before the open-parentheses and
Support GNU style rule to put a space before opening parenthesis.
Summary: The rule from the GNU style states: "We find it easier to read a program when it has spaces before the open-parentheses and after the commas."
http://www.gnu.org/prep/standards/standards.html#index-spaces-before-open_002dparen
This patch makes clang-format adds an option to put spaces before almost all open parentheses, except the cases, where different behavior is dictated by the style rules or language syntax: * preprocessor: ** function-like macro definitions can't have a space between the macro name and the parenthesis; ** `#if defined(...)` can have a space, but it seems, that it's more frequently used without a space in GCC, for example; * never add spaces after unary operators; * adding spaces between two opening parentheses is controlled with the `SpacesInParentheses` option; * never add spaces between `[` and `(` (there's no option yet).
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2326
llvm-svn: 196901
show more ...
|
#
ecc232d5 |
| 04-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Fix the regression caused by r196378
llvm-svn: 196380
|
#
31e95540 |
| 04-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Leave constructor initializer lists on one line in styles with no column limit.
Summary: Allow tryFitMultipleLinesInOne join unwrapped lines when ContinuationIndenter::mustBreak doesn't agree. But d
Leave constructor initializer lists on one line in styles with no column limit.
Summary: Allow tryFitMultipleLinesInOne join unwrapped lines when ContinuationIndenter::mustBreak doesn't agree. But don't merge any lines, that are separate in the input.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2321
llvm-svn: 196378
show more ...
|
Revision tags: llvmorg-3.4.0-rc2 |
|
#
bc4ae449 |
| 02-Dec-2013 |
Alexander Kornienko <alexfh@google.com> |
Added an option to specify fallback style.
Summary: Added -fallback-style option. Changed clang-format to stop searching for .clang-format when an invalid file is found.
Reviewers: djasper, klimek
Added an option to specify fallback style.
Summary: Added -fallback-style option. Changed clang-format to stop searching for .clang-format when an invalid file is found.
Reviewers: djasper, klimek
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2292
llvm-svn: 196108
show more ...
|
#
0e81f1ad |
| 02-Dec-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix excessive formatting caused by r195954.
Due to a bug in the patch, clang-format would more or less simply format all multi-line comments.
llvm-svn: 196080
|
#
cabdd738 |
| 29-Nov-2013 |
Alexander Kornienko <alexfh@google.com> |
Added LanguageStandard::LS_JavaScript to gate all JS-specific parsing.
Summary: Use LS_JavaScript for files ending with ".js". Added support for ">>>=" operator.
Reviewers: djasper, klimek
Reviewe
Added LanguageStandard::LS_JavaScript to gate all JS-specific parsing.
Summary: Use LS_JavaScript for files ending with ".js". Added support for ">>>=" operator.
Reviewers: djasper, klimek
Reviewed By: djasper
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2242
llvm-svn: 195961
show more ...
|
#
38c82408 |
| 29-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Extends formatted ranges to subsequent lines comments.
Before: int aaaa; // This line is formatted. // The comment continues .. // .. here.
Befor
clang-format: Extends formatted ranges to subsequent lines comments.
Before: int aaaa; // This line is formatted. // The comment continues .. // .. here.
Before: int aaaa; // This line is formatted. // The comment continues .. // .. here.
This fixes llvm.org/PR17914.
llvm-svn: 195954
show more ...
|
#
9c199568 |
| 28-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Improve selective formatting of nested statements.
Previously, clang-format could create quite corrupt formattings if individual lines of nested blocks (e.g. in "DEBUG({})" or lambdas)
clang-format: Improve selective formatting of nested statements.
Previously, clang-format could create quite corrupt formattings if individual lines of nested blocks (e.g. in "DEBUG({})" or lambdas) were used. With this patch, it tries to extend the formatted regions to leave around some reasonable format without always formatting the entire surrounding statement.
llvm-svn: 195925
show more ...
|
#
5877bf1b |
| 25-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Fix formatting of empty files (fixes c-index-tests).
llvm-svn: 195638
|
#
5500f616 |
| 25-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Refactor calculation of lines intersecting with -lines.
No functional changes intended. However, it seems to have found a buggy behavior in one of the tests. I think this structure is
clang-format: Refactor calculation of lines intersecting with -lines.
No functional changes intended. However, it seems to have found a buggy behavior in one of the tests. I think this structure is generally desirable and it will make a planned bugfix significantly easier.
llvm-svn: 195634
show more ...
|
#
9aa62407 |
| 21-Nov-2013 |
Alexander Kornienko <alexfh@google.com> |
Better implementation of JavaScript === and !== operators.
Summary: Now based on token merging. Now they are not only prevented from being split, but are actually formatted as comparison operators.
Better implementation of JavaScript === and !== operators.
Summary: Now based on token merging. Now they are not only prevented from being split, but are actually formatted as comparison operators.
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2240
llvm-svn: 195354
show more ...
|
#
3cfa9739 |
| 20-Nov-2013 |
Alexander Kornienko <alexfh@google.com> |
Added an option to allow short function bodies be placed on a single line.
Summary: The AllowShortFunctionsOnASingleLine option now controls short function body placement on a single line independen
Added an option to allow short function bodies be placed on a single line.
Summary: The AllowShortFunctionsOnASingleLine option now controls short function body placement on a single line independent of the BreakBeforeBraces option. Updated tests using BreakBeforeBraces other than BS_Attach.
Addresses http://llvm.org/PR17888
Reviewers: klimek, djasper
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2230
llvm-svn: 195256
show more ...
|
Revision tags: llvmorg-3.4.0-rc1 |
|
#
c302161f |
| 19-Nov-2013 |
Alexander Kornienko <alexfh@google.com> |
Refactoring: replaced (*(I + x)) with I[x].
Summary: Pure refactoring, no semantic changes intended.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://l
Refactoring: replaced (*(I + x)) with I[x].
Summary: Pure refactoring, no semantic changes intended.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2220
llvm-svn: 195128
show more ...
|
#
393e3088 |
| 13-Nov-2013 |
Alexander Kornienko <alexfh@google.com> |
Correctly mark first token in the presence of UTF-8 BOM.
Summary: Fixes http://llvm.org/PR17753
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-r
Correctly mark first token in the presence of UTF-8 BOM.
Summary: Fixes http://llvm.org/PR17753
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2159
llvm-svn: 194576
show more ...
|
#
98fb6e1b |
| 08-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Don't auto-break short macros in WebKit style.
This fixes llvm.org/PR17842.
llvm-svn: 194268
|
#
165b29e2 |
| 08-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Make breaking before ternary operators configurable.
llvm-svn: 194229
|
#
56f8b439 |
| 06-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Separate line-merging logic into its own class.
No functional changes (intended).
llvm-svn: 194179
|
#
bbf5c1c9 |
| 05-Nov-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Allow line merging and partial formatting of nested blocks
Before, clang-format would always format entire nested blocks, which can be unwanted e.g. for long DEBUG({...}) statements. A
clang-format: Allow line merging and partial formatting of nested blocks
Before, clang-format would always format entire nested blocks, which can be unwanted e.g. for long DEBUG({...}) statements. Also clang-format would not allow to merge lines in nested blocks (e.g. to put "if (a) return;" on one line in Google style).
This is the first step of several refactorings mostly focussing on the additional functionality (by reusing the "format many lines" code to format the children of a nested block). The next steps are: * Pull out the line merging into its own class. * Seperate the formatting of many lines from the formatting of a single line (and the analysis of the solution space).
llvm-svn: 194090
show more ...
|
#
dd978ae0 |
| 29-Oct-2013 |
Daniel Jasper <djasper@google.com> |
clang-format: Option to control spacing in template argument lists.
Same as SpacesInParentheses, this option allows adding a space inside the '<' and '>' of a template parameter list.
Patch by Chri
clang-format: Option to control spacing in template argument lists.
Same as SpacesInParentheses, this option allows adding a space inside the '<' and '>' of a template parameter list.
Patch by Christopher Olsen.
This fixes llvm.org/PR17301.
llvm-svn: 193614
show more ...
|
#
1a3605cd |
| 25-Oct-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
I am about to change llvm::MemoryBuffer::getFile take take a Twine. Change clang first so that the build still works.
llvm-svn: 193428
|