History log of /external/clang/tools/clang-format/ClangFormat.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
/external/clang/tools/clang-format/ClangFormat.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/tools/clang-format/ClangFormat.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/tools/clang-format/ClangFormat.cpp
11d10c32c9f2a893dc101cb9ed12bcd30d9cf1f8 09-Nov-2013 Bill Wendling <isanbard@gmail.com> Use a StringRef. Saves 0.00000000000001s on execution time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
4a795861e1288de4ac888e787c9e466df21b82b3 08-Nov-2013 Alp Toker <alp@nuanti.com> clang-format: Write files atomically

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!)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
f7d9e63858138134953e713f948b20a8b8c9a872 08-Oct-2013 Daniel Jasper <djasper@google.com> clang-format: Don't exit with failure on empty files.

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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192184 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
c6801d3bb7eb414d0c990e8542c7c22ff33ff5f2 30-Sep-2013 David Blaikie <dblaikie@gmail.com> Remove unused variable introduced in 191666

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
f4e12c8c1325ea04b54ed0b5869258254458b091 30-Sep-2013 Edwin Vane <edwin.vane@intel.com> Moving style option formatting to libFormat

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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
62df7ef28c5a1ed3f5ffd1036162cafe0e1fcd4c 13-Sep-2013 Daniel Jasper <djasper@google.com> clang-format: Add -assume-filename option for editor integrations.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
9a7a50eef777765e4d20e3b1f3670b32582114fb 10-Sep-2013 Hans Wennborg <hans@hanshq.net> Allow _clang-format as alternative to .clang-format config filename

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
4e65c98f67b80a7f85ecd5b550a5e10a834f702c 02-Sep-2013 Alexander Kornienko <alexfh@google.com> Added WebKit style to the BasedOnStyle handling and to the relevant help messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
7de13bb716a76cf4c0d6593bd06d53a480a8980e 02-Sep-2013 Alexander Kornienko <alexfh@google.com> Whitespace changes in help messages + updated help output in .rst file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
439fc85f4663810984962a8346d000be79df6bdc 02-Sep-2013 Chandler Carruth <chandlerc@gmail.com> Switch the default mode for clang-format to '-file'. Make 'LLVM' the
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. ;]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
d95f88a616952ec36d065748f72f75f4d97d6ee7 19-Jul-2013 Alexander Kornienko <alexfh@google.com> 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
d965f95daa97097c8ddc5e1165ceae585a888719 16-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Update for llvm API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
c1baef687bd2e53aa5ac54b825d66eda86c9e408 03-Jul-2013 Daniel Jasper <djasper@google.com> Prevent error message when formatting an empty file.

This fixes llvm.org/PR16514.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
a1753f4be12737f36ce9c6eccccddd3be1ec514b 28-Jun-2013 Alexander Kornienko <alexfh@google.com> Use lexing mode based on FormatStyle.Standard.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
33886c7345397058096697a8a031a688a7bef762 21-May-2013 Daniel Jasper <djasper@google.com> Fix behavior of clang-format's -cursor flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
6bd3b93200c6ae141d0f7444ffb4cacd52b183ed 21-May-2013 Daniel Jasper <djasper@google.com> Let clang-format move the cursor appropriately.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
885f87b4be987fd8912779419ec88e3c37481967 19-May-2013 Alexander Kornienko <alexfh@google.com> Clang-format: allow -style="{yaml/json}" on command line

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
46529e5bf7f46ec8771a091ff3ab9877620f7036 10-May-2013 Alexander Kornienko <alexfh@google.com> Reformat clang-format help strings, filter out irrelevant options.

Summary: +updated ClangFormat.rst

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D780

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
dbaa5b04834f74e68e746ac2e4abbcd20623f90d 10-May-2013 Alexander Kornienko <alexfh@google.com> Updated clang-format help messages for -offset and -length

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
0ca318bbad87b599e69f27a5297eb18b2f10b715 10-May-2013 Alexander Kornienko <alexfh@google.com> Minor clarifications in help messages and a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
dd256314cf391063329e504f0ece46ee51bbfa2a 10-May-2013 Alexander Kornienko <alexfh@google.com> Config file support for clang-format, part 2.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
fb59486ef3624d09896b09a978b28eb63cfd3c46 06-May-2013 Alexander Kornienko <alexfh@google.com> Added Mozilla style, cleaned get*Style methods.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
4cdc0cde1396df5d937c39c626abe99760197654 24-Apr-2013 Alexander Kornienko <alexfh@google.com> clang-format support for multiple input files.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
b3c881752b5decf2d71a1c008930ca3587a96041 08-Apr-2013 Daniel Jasper <djasper@google.com> Remove outdated part of help message.

The styles are now documented with the -style option. This fixes
llvm.org/PR15689.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp
7c4a9a04b4b2a44259b34078434e087987872095 20-Mar-2013 Daniel Jasper <djasper@google.com> Add clang-format binary to cfe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/tools/clang-format/ClangFormat.cpp