| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 236592
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: cl::HideUnrelatedOptions allows tools to hide all options not part of a specific OptionCategory. This is the common use case for cl::getRegisteredOptions, which should be deprecated in the future because it exposes implementation details of command line parsing.
Reviewers: dexonsmith
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D7109
llvm-svn: 226741
|
|
|
|
|
|
| |
integrations.
llvm-svn: 225516
|
|
|
|
| |
llvm-svn: 221606
|
|
|
|
|
|
| |
Hopefully fixing windows builds.
llvm-svn: 220878
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch by Bobby Moretti.
llvm-svn: 208269
|
|
|
|
|
|
| |
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
|
|
|
|
| |
llvm-svn: 202269
|
|
|
|
| |
llvm-svn: 200839
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 194301
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 191682
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
messages.
llvm-svn: 189765
|
|
|
|
| |
llvm-svn: 189762
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
human-friendly alternative to -offset and -length.
Differential Revision: http://llvm-reviews.chandlerc.com/D1160
llvm-svn: 186625
|
|
|
|
| |
llvm-svn: 186448
|
|
|
|
|
|
| |
This fixes llvm.org/PR16514.
llvm-svn: 185531
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 182386
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: +updated ClangFormat.rst
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D780
llvm-svn: 181617
|
|
|
|
| |
llvm-svn: 181593
|
|
|
|
| |
llvm-svn: 181591
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
The styles are now documented with the -style option. This fixes
llvm.org/PR15689.
llvm-svn: 179017
|
|
llvm-svn: 177506
|