| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
integrations.
llvm-svn: 225516
|
|
|
|
|
|
|
|
|
|
|
|
| |
- includes header/footer as required by MELPA
- correctly handles buffers that are not associated with a file
- displays stderr and exit code of clang-format process
- customizable via the emacs customization interface and file-/directory-
local variables
Patch by Johann Klähn.
llvm-svn: 225447
|
|
|
|
| |
llvm-svn: 223685
|
|
|
|
|
|
|
| |
With it, it prints the file being formatted. Apparently people are
formatting thousands of files and some progress indication is helpful.
llvm-svn: 221990
|
|
|
|
| |
llvm-svn: 221606
|
|
|
|
|
|
|
| |
This makes the emacs integration ``provide`` a clang-format feature,
so that a .emacs can ``require`` it.
llvm-svn: 221330
|
|
|
|
| |
llvm-svn: 221254
|
|
|
|
|
|
|
|
|
| |
If g:clang_format_path is set in the vimrc, that path will take precedence over
the hard coded path (which is reliant on the PATH environment variable). This
provides an easy mechanism for switching the selected clang-format binary during
development.
llvm-svn: 221108
|
|
|
|
|
|
|
| |
The double carriage return would silence a warning due to a missing
.clang-format. Permit the error to bubble through.
llvm-svn: 221107
|
|
|
|
| |
llvm-svn: 220893
|
|
|
|
| |
llvm-svn: 220890
|
|
|
|
|
|
| |
Hopefully fixing windows builds.
llvm-svn: 220878
|
|
|
|
|
|
|
|
|
|
| |
This moves classes for storing and applying replacements to separate
files. These classes specifically are used by clang-format which doesn't
have any other dependencies on clangAST. Thereby, the size of
clang-format's binary can be cut roughly in half and its build time sped
up.
llvm-svn: 220867
|
|
|
|
|
|
|
|
|
|
| |
Improve the documentation for vim integration of clang-format. Prefer the use
of <c-o> to do the normal mode command execution to avoid side-effects of the
escape and re-insertion (cursor movement). Tweak the macros to use a double
return to avoid having to manually return control to the editor from the
subprocess.
llvm-svn: 220685
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var regex = / a\//; int i;
After:
var regex = /a\//;
int i;
This required pushing the Lexer into its wrapper class and generating a
new one in this specific case. Otherwise, the sequence get lexed as a
//-comment. This is hacky, but I don't know a better way (short of
supporting regex literals in the Lexer).
Pushing the Lexer down seems to make all the call sites simpler.
llvm-svn: 217444
|
|
|
|
|
|
|
|
|
|
| |
Before:
not. and . or . not_eq = 1;
After:
not.and.or.not_eq = 1;
llvm-svn: 217179
|
|
|
|
|
|
|
|
| |
On operating systems like the BSDs, it is typically the case that
/usr/bin/python does not exist. We should therefore use /usr/bin/env
instead. This is also done in various other scripts in tools/.
llvm-svn: 216945
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.
Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.
Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.
llvm-svn: 213171
|
|
|
|
| |
llvm-svn: 212408
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes a const_cast added in r211884 that occurred due to an
inconsistency in how MemoryBuffers are handled between some parts of
clang and LLVM.
MemoryBuffers are immutable and the general convention in the LLVM
project is to omit const from immutable types as it's simply
redundant/verbose (see llvm::Type, for example). While this change
doesn't remove "const" from /every/ MemoryBuffer, it at least makes this
chain of ownership/usage consistent.
llvm-svn: 211915
|
|
|
|
| |
llvm-svn: 210817
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And "none" pseudo-style indicating that formatting should be not
applied.
(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.
(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.
Patch by Adam Strzelecki. Thank you!
llvm-svn: 209446
|
|
|
|
|
|
| |
Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.
llvm-svn: 209417
|
|
|
|
| |
llvm-svn: 208766
|
|
|
|
|
|
| |
Patch by Bobby Moretti.
llvm-svn: 208269
|
|
|
|
|
|
|
|
| |
This reverts r172072. clang-format used to use DiagnosticEngine to output
errors: http://llvm.org/viewvc/llvm-project?view=revision&revision=172071. Now
it doesn't, so this code is obsolete.
llvm-svn: 206479
|
|
|
|
| |
llvm-svn: 205842
|
|
|
|
|
|
| |
This will allow using an early return statement in a subsequent change.
llvm-svn: 203501
|
|
|
|
|
|
| |
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
|
|
|
|
| |
llvm-svn: 202269
|
|
|
|
| |
llvm-svn: 200839
|
|
|
|
|
|
| |
Support for protocol buffer files seems complete enough.
llvm-svn: 199750
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
$ clang-format --version
LLVM (http://llvm.org/):
LLVM version 3.5svn
Optimized build with assertions.
Built Jan 3 2014 (14:28:46).
Default target: x86_64-apple-darwin13.0.0
Host CPU: core-avx-i
Now:
$ bin/clang-format --version
clang-format version 3.5 (198452)
llvm-svn: 198694
|
|
|
|
|
|
|
| |
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.
llvm-svn: 198686
|
|
|
|
| |
llvm-svn: 197668
|
|
|
|
|
|
|
|
|
|
| |
While debating the finer points of file extension matching, we somehow missed
the bigger problem that the current code will match anything starting with the
default or user-specified pattern (e.g. lit.site.cfg.in).
Fix this by doing what find(1) does, implicitly wrapping the pattern with ^$.
llvm-svn: 197608
|
|
|
|
|
|
| |
It's handled correctly as a C-family language.
llvm-svn: 197542
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
-regex and -iregex both mimic options of the find utility.
Made the default list of extensions case-insensitive, so that it's not only C
and CPP extensions are accepted in upper case.
Reviewers: djasper
Reviewed By: djasper
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2415
llvm-svn: 197378
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for more filename extensions based on the list in the clang
plus JavaScript.
Also adds a -regex option so users can override defaults if they have unusual
file extensions or want to format everything in the diff.
Keeping with tradition the flag is modelled on Unix conventions, this time
matching the semantics of find(1).
llvm-svn: 196917
|
|
|
|
|
|
| |
CMakeLists.txt.
llvm-svn: 196916
|
|
|
|
|
|
|
| |
Also use write() for unified diff output to avoid further processing by the
print function (e.g. trailing newline).
llvm-svn: 196484
|
|
|
|
|
|
| |
Also update docs to reflect recently changed -i inplace edit behaviour.
llvm-svn: 196336
|
|
|
|
|
|
| |
Patch by James Park.
llvm-svn: 196265
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
They were previously not part of the install target.
Differential Revision: http://llvm-reviews.chandlerc.com/D2154
llvm-svn: 194741
|
|
|
|
| |
llvm-svn: 194301
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sublime Text 2 uses Python 2.6
Sublime Text 3 uses Python 3.3
The `print` function has been available as a __future__ import since
2.6, so use it.
Patch by Johan Engelen!
llvm-svn: 194287
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch clang-format over to Rewriter::overwriteChangedFiles().
The previous implementation was attempting to stream back directly to the
original file and failing if it was already memory mapped by MemoryBuffer,
an operation unsupported by Windows.
MemoryBuffer generally mmaps files larger than the physical page size so
this will have been difficult to reproduce consistently.
This change also reduces flicker in code editors and IDEs on all platforms
when reformatting in-place.
Note that other incorrect uses of MemoryBuffer exist in LLVM/clang and
will need a similar fix.
A test should be added for Windows when libFormat performance issues are
fixed (it takes longer than a day to format a 1MB file at present!)
llvm-svn: 194250
|
|
|
|
| |
llvm-svn: 193433
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|