- Oct 25, 2013
-
-
Nico Weber authored
llvm-svn: 193433
-
- Oct 11, 2013
-
-
Alexander Kornienko authored
Changed clang-format-diff.py to output diff by default. Added -i option to apply changes to files instead. Summary: "svn diff|clang-format-diff.py" will just output the diff. Now it's possible to use: svn diff|clang-format-diff.py|patch -p0 as an equivalent to: svn diff|clang-format-diff.py -i ;) Reviewers: djasper Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1840 llvm-svn: 192505
-
- Oct 08, 2013
-
-
Daniel Jasper authored
Also let clang-format-diff.py detect errors based on clang-format's return code. Otherwise messages like "Can't find usable .clang-format, falling back to LLVM style" can make it fail, which might be undesired. Patch by Alp Toker. Thank you! llvm-svn: 192184
-
- Oct 02, 2013
-
-
Daniel Jasper authored
Patch by Alp Toker. Many thanks! Original descriptions: clang-format-diff incorrectly modifies unchanged lines due to an error in diff parsing. The unified diff format has a default line change count of 1, and 0 may be specified to indicate that no lines have been added. This patch updates the parser to accurately reflect the diff specification. This also has the benefit of stabilising the operation so it will produce the same output when run multiple times on the same changeset, which was previously not the case. No tests added because this script is not currently tested (though we should look into that!) llvm-svn: 191820
-
- Sep 30, 2013
-
-
David Blaikie authored
llvm-svn: 191682
-
Edwin Vane authored
The help text for clang-format's -style option and the function that processes its value is moved to libFormat in this patch. The goal is to enable other tools that use libFormat and also have a -style option to behave consistently with clang-format. llvm-svn: 191666
-
- Sep 21, 2013
-
-
Daniel Jasper authored
Copy and paste error in r190935.. llvm-svn: 191137
-
- Sep 18, 2013
-
-
Daniel Jasper authored
clang-format's -lines parameter makes this significantly easier. llvm-svn: 190935
-
- Sep 13, 2013
-
-
Daniel Jasper authored
With -style=file, clang-format now starts to search for a .clang-format file starting at the file given with -assume-filename if it reads from stdin. Otherwise, it would start searching from the current directory, which is not helpful for editor integrations. Also changed vim, emacs and sublime integrations to actually make use of this flag. This fixes llvm.org/PR17072. llvm-svn: 190691
-
- Sep 10, 2013
-
-
Hans Wennborg authored
Dotfiles are impractical on Windows. This makes clang-format search for the style configuration file as '_clang-format' in addition to the usual '.clang-format'. This is similar to how VIM searches for '_vimrc' on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1629 llvm-svn: 190413
-
- Sep 02, 2013
-
-
Alexander Kornienko authored
llvm-svn: 189765
-
Alexander Kornienko authored
llvm-svn: 189762
-
Chandler Carruth authored
fallback syntax used when we fail to find a '.clang-format' file. Adjust variable names appropriately. Update the editor integration pieces that specify a '-style' option to specify it as '-style=file'. I left the functionality in place because even if the preferred method is to use '.clang-format' files, this way if someone needs to clobber the style in their editor we show how to do so in these examples. Also check in a '.clang-format' file for Clang to ensure that separate checkouts and builds of Clang from LLVM can still get the nice formatting. =] This unfortunately required nuking the test for the absence of a '.clang-format' file as now the directory happening to be under your clang source tree will cause there to always be a file. ;] llvm-svn: 189741
-
- Aug 01, 2013
-
-
Daniel Jasper authored
Patch by Mark Lodato. Thank you! llvm-svn: 187592
-
- Jul 22, 2013
-
-
Daniel Jasper authored
After the first operation, the buffer contents has changed and thus all other operations would be invalid. Executing the operations in reversed order should fix this. llvm-svn: 186840
-
Daniel Jasper authored
llvm-svn: 186825
-
- Jul 21, 2013
-
-
Daniel Jasper authored
With this fix, only changed regions will be replaced in vim's buffer. Thereby, marks should mostly be left intact. Furthermore, this is a better fix for the performance problem in conjunction with 'foldmethod=syntax' (see r186660). llvm-svn: 186789
-
- Jul 20, 2013
-
-
Alexander Kornienko authored
Use -lines option instead of -offset/-length. This fixes problems with files using dos newlines (<CR><LF>). llvm-svn: 186740
-
- Jul 19, 2013
-
-
Daniel Jasper authored
The previous line-by-line replacement causes vim to take a long time if the foldmethod is set to 'syntax'. This should significantly improve performance in that case. llvm-svn: 186660
-
Alexander Kornienko authored
Added -lines X:Y option to specify line range to process. This is a more human-friendly alternative to -offset and -length. Differential Revision: http://llvm-reviews.chandlerc.com/D1160 llvm-svn: 186625
-
- Jul 16, 2013
-
-
Rafael Espindola authored
llvm-svn: 186448
-
- Jul 03, 2013
-
-
Daniel Jasper authored
This fixes llvm.org/PR16514. llvm-svn: 185531
-
- Jul 02, 2013
-
-
Daniel Jasper authored
Before, the computed byte range would include the trailing newline. clang-format on the other hand counts whitespace as belonging to the following token, so that git-clang-format inadvertendly reformats the first unmodified line as well. It is not entirely clear whether clang-format's behavior itself should be modified, but for now this seems to be a safe change. llvm-svn: 185423
-
- Jun 28, 2013
-
-
Alexander Kornienko authored
Summary: Some valid pre-C++11 constructs change meaning when lexed in C++11 mode, e.g. #define x(_a) printf("foo"_a); (example from http://llvm.org/bugs/show_bug.cgi?id=16342). "foo"_a is treated as a user-defined string literal when parsed in C++11 mode. In order to deal with this correctly, we need to set lexing mode according to which standard the code conforms to. We already have a configuration value for this (FormatStyle.Standard), which seems to be appropriate to use in this case as well. Reviewers: klimek CC: cfe-commits, gribozavr Differential Revision: http://llvm-reviews.chandlerc.com/D1028 llvm-svn: 185149
-
- Jun 14, 2013
-
-
Reid Kleckner authored
The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
-
- Jun 11, 2013
-
-
Manuel Klimek authored
Patch by Chris Gray. llvm-svn: 183739
-
- Jun 10, 2013
-
-
Reid Kleckner authored
Reviewers: klimek Differential Revision: http://llvm-reviews.chandlerc.com/D941 llvm-svn: 183654
-
- May 30, 2013
-
-
Daniel Jasper authored
This way, it has the same default as 'patch' and also the example in the code makes more sense as it is explicitly setting -p 1. llvm-svn: 182923
-
- May 23, 2013
-
-
Daniel Jasper authored
Put this somewhere on your path and use: git clang-format Awesome work by Mark Lodato. Many thanks! llvm-svn: 182596
-
- May 21, 2013
-
-
Daniel Jasper authored
llvm-svn: 182395
-
Daniel Jasper authored
llvm-svn: 182386
-
Daniel Jasper authored
With this patch, clang-format will try to keep the cursor at the original code position in editor integrations (implemented for emacs and vim). This means, after formatting, clang-format will try to keep the cursor on the same character of the same token. llvm-svn: 182373
-
- May 19, 2013
-
-
Alexander Kornienko authored
Summary: + improved handling of default style and predefined styles. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D813 llvm-svn: 182205
-
- May 16, 2013
-
-
Daniel Jasper authored
llvm-svn: 182015
-
- May 14, 2013
-
-
Daniel Jasper authored
- Remove free variables - Add function clang-format-buffer, e.g. for before-save-hooks - Wrap restoring windows in an unwind-protect Patch by Stephen Gildea! llvm-svn: 181766
-
- May 10, 2013
-
-
Alexander Kornienko authored
Summary: +updated ClangFormat.rst Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D780 llvm-svn: 181617
-
Alexander Kornienko authored
llvm-svn: 181593
-
Alexander Kornienko authored
llvm-svn: 181591
-
Alexander Kornienko authored
Summary: Adds actual config file reading to the clang-format utility. Configuration file name is .clang-format. It is looked up for each input file in its parent directories starting from immediate one. First found .clang-format file is used. When using standard input, .clang-format is searched starting from the current directory. Added -dump-config option to easily create configuration files. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, jordan_rose, kimgr Differential Revision: http://llvm-reviews.chandlerc.com/D758 llvm-svn: 181589
-
- May 07, 2013
-
-
Daniel Jasper authored
This is just a slight improvement for the fix in r181299, which fixes formatting the very last line of a file. llvm-svn: 181303
-