summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format: Smarter replacement in the vim integration.Daniel Jasper2013-07-211-7/+6
| | | | | | | | | 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
* Use -lines option instead of -offset/-length. This fixes problems with files ↵Alexander Kornienko2013-07-201-6/+3
| | | | | | using dos newlines (<CR><LF>). llvm-svn: 186740
* Improve clang-format vim integration.Daniel Jasper2013-07-191-2/+2
| | | | | | | | 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
* Added -lines X:Y option to specify line range to process. This is a more ↵Alexander Kornienko2013-07-181-16/+67
| | | | | | | | human-friendly alternative to -offset and -length. Differential Revision: http://llvm-reviews.chandlerc.com/D1160 llvm-svn: 186625
* Update for llvm API change.Rafael Espindola2013-07-161-1/+1
| | | | llvm-svn: 186448
* Prevent error message when formatting an empty file.Daniel Jasper2013-07-031-0/+2
| | | | | | This fixes llvm.org/PR16514. llvm-svn: 185531
* Fix ranges computed by git clang-format.Daniel Jasper2013-07-021-2/+2
| | | | | | | | | | | | 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
* Use lexing mode based on FormatStyle.Standard.Alexander Kornienko2013-06-281-3/+4
| | | | | | | | | | | | | | | | | | | | | 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
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | 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
* Make it possible to assign clang-format-buffer to a keybinding.Manuel Klimek2013-06-111-0/+1
| | | | | | Patch by Chris Gray. llvm-svn: 183739
* [clang-format] Don't flash an ugly cmd prompt in Vim on WindowsReid Kleckner2013-06-101-1/+9
| | | | | | | | Reviewers: klimek Differential Revision: http://llvm-reviews.chandlerc.com/D941 llvm-svn: 183654
* Fix default value of clang-format-diff's -p option.Daniel Jasper2013-05-301-1/+1
| | | | | | | 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
* clang-format integration for git.Daniel Jasper2013-05-231-0/+513
| | | | | | | | | | Put this somewhere on your path and use: git clang-format Awesome work by Mark Lodato. Many thanks! llvm-svn: 182596
* Fix off-by-one error in clang-format's emacs integration.Daniel Jasper2013-05-211-2/+2
| | | | llvm-svn: 182395
* Fix behavior of clang-format's -cursor flag.Daniel Jasper2013-05-211-1/+1
| | | | llvm-svn: 182386
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-213-13/+35
| | | | | | | | | 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
* Clang-format: allow -style="{yaml/json}" on command lineAlexander Kornienko2013-05-191-8/+30
| | | | | | | | | | | | | | 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
* Add basic clang-format integration for sublime text.Daniel Jasper2013-05-161-0/+55
| | | | llvm-svn: 182015
* Update clang-format emacs integration.Daniel Jasper2013-05-141-15/+29
| | | | | | | | | | - 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
* Reformat clang-format help strings, filter out irrelevant options.Alexander Kornienko2013-05-101-27/+52
| | | | | | | | | | | | | | Summary: +updated ClangFormat.rst Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D780 llvm-svn: 181617
* Updated clang-format help messages for -offset and -lengthAlexander Kornienko2013-05-101-7/+13
| | | | llvm-svn: 181593
* Minor clarifications in help messages and a comment.Alexander Kornienko2013-05-101-2/+4
| | | | llvm-svn: 181591
* Config file support for clang-format, part 2.Alexander Kornienko2013-05-101-14/+50
| | | | | | | | | | | | | | | | | | | | 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
* Further fix to clang-format emacs integration.Daniel Jasper2013-05-071-1/+1
| | | | | | | This is just a slight improvement for the fix in r181299, which fixes formatting the very last line of a file. llvm-svn: 181303
* Fix clang-format emacs integration in last line.Daniel Jasper2013-05-071-2/+2
| | | | | | | | Emacs seems to have a line that is just past the last character of the buffers content. This needs to be handled specially so that clang-format is not called with an invalid -offset. llvm-svn: 181299
* Added Mozilla style, cleaned get*Style methods.Alexander Kornienko2013-05-061-2/+7
| | | | | | | | | | | | | | Summary: Patch based on a patch by Ehsan Akhgari. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D750 llvm-svn: 181196
* Basic clang-format integration for BBEdit.Daniel Jasper2013-05-021-0/+27
| | | | | | Thanks to Avi Drissman! llvm-svn: 180933
* Fix scrolling bug in clang-format's emacs integration.Daniel Jasper2013-04-251-5/+9
| | | | | | | This patch ensure that nothing scrolls even if the same buffer is opened in multiple windows. llvm-svn: 180252
* clang-format support for multiple input files.Alexander Kornienko2013-04-241-20/+57
| | | | | | | | | | | | | | | | | | | Summary: Added support for multiple input files, that can be used both with and without in-place edit (-i) option. Added checks for -offset and -length options: don't allow them on multiple files, check that they don't fall outside input file, made both options unsigned, so that there's no need to check for negative values. Removed "-1 can be used for end-of-file" from -length description. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D719 llvm-svn: 180185
* Small improvements to clang-format documentation and integrationDaniel Jasper2013-04-172-8/+9
| | | | | | scripts. llvm-svn: 179676
* Fix clang-format-diff.py script.Daniel Jasper2013-04-121-1/+1
| | | | llvm-svn: 179377
* Provide better emacs integration.Daniel Jasper2013-04-121-33/+13
| | | | | | | | | | | The new emacs integration is simpler, does not save the current file before reformatting and ensures that emacs does not scroll as a result of formatting. Also explicitly set the style in clang-format tests to make them more robust. llvm-svn: 179372
* Improvements to clang-format integrations.Daniel Jasper2013-04-093-6/+58
| | | | | | | | This adds an emacs editor integration (thanks to Ami Fischman). Also pulls out the style into a variable for the vi integration and just uses clang-formats defaults style in clang-format-diff.py. llvm-svn: 179098
* Remove outdated part of help message.Daniel Jasper2013-04-081-1/+0
| | | | | | | The styles are now documented with the -style option. This fixes llvm.org/PR15689. llvm-svn: 179017
* Add clang-format binary to cfe.Daniel Jasper2013-03-205-0/+368
llvm-svn: 177506
OpenPOWER on IntegriCloud