History log of /external/clang/lib/Format/FormatToken.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
74317e4d3a6e662412cdd971df57da326229fedb 24-Oct-2013 Daniel Jasper <djasper@google.com> clang-format: Be more conservative about column layout formatting.

Specifically, if a braced list has at least one nested braced list,
format it either all on one line or in one column (i.e. one item per

This seems in general to be an improvement as the structure of nested
braced lists can make a tightly packed outer braced list hard to read.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193345 91177308-0d34-0410-b5e6-96231b3b80d8
3c6aea7ac63265c769b5fe09e213ab1c4cee111e 24-Oct-2013 Daniel Jasper <djasper@google.com> clang-format: Cleanup array initializer and dict initializer formatting.

Significant changes:
- Also recognize these literals with missing "@" for robustness.
- Reorganize tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193325 91177308-0d34-0410-b5e6-96231b3b80d8
ae76f7f850a9101a20191b10241ca72c23dc40dd 11-Oct-2013 Manuel Klimek <klimek@google.com> Support formatting of preprocessor branches.

We now correctly format:
void SomeFunction(int param1,
#ifdef X
NoTemplate param2,
template <
#ifdef A
MyType<Some> >
Type1, Type2>
param3) {

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192503 91177308-0d34-0410-b5e6-96231b3b80d8
5798120bc015360951d13a06e17501b909ecd21d 13-Sep-2013 Daniel Jasper <djasper@google.com> clang-format: Fix incorrect enum parsing / layouting.

enum {
Bar = Foo < int,
int > ::value

enum {
Bar = Foo<int, int>::value

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190674 91177308-0d34-0410-b5e6-96231b3b80d8
83a7dcdf5fce1bdf74ce985419d77a41a51abfa2 10-Sep-2013 Alexander Kornienko <alexfh@google.com> Calculate and store ColumnWidth instead of CodePointCount in FormatTokens.

This fixes various issues with mixed tabs and spaces handling, e.g.
when realigning block comments.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190395 91177308-0d34-0410-b5e6-96231b3b80d8
451f1e0e5040db6a114217e7bd9767bf751d5bd3 27-Aug-2013 Daniel Jasper <djasper@google.com> clang-format: Fix bug in column layout.

Before (with 60 character limit in Google style):
return {
{aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa},
{aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa}};
return {{aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa},
{aaaaaaaaaaaaaaaaaaaaaaaaa}, {aaaaaaaaaaaaaaaaa}};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189327 91177308-0d34-0410-b5e6-96231b3b80d8
332c67703f63fafd26cf88fc31faeb80c1523725 26-Aug-2013 Daniel Jasper <djasper@google.com> clang-format: Fix bug in column-layout formatting.

Specific arrangements of comments after trailing commas could confuse
the column width calculation, e.g. in:

vector<int> x = { a, b,
/* some */ /* comment */ };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189211 91177308-0d34-0410-b5e6-96231b3b80d8
ed51c02f4c87ddb2d2f45193e4041921ac363f76 23-Aug-2013 Daniel Jasper <djasper@google.com> clang-format: Handle trailing commas in column layout of braced list.

Before, this was causing errors.

Also exit early in breakProtrudingToken() (before the expensive call to
SourceManager::getSpellingColumnNumber()). This makes formatting huge
(100k+-item) braced lists possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189094 91177308-0d34-0410-b5e6-96231b3b80d8
d4a03dbb0bdbd4908375306283cb61813bd8f454 22-Aug-2013 Daniel Jasper <djasper@google.com> clang-format: Add column layout formatting for braced lists

With this patch, braced lists (with more than 3 elements are formatted in a
column layout if possible). E.g.:

static const uint16_t CallerSavedRegs64Bit[] = {
X86::RAX, X86::RDX, X86::RCX, X86::RSI, X86::RDI,
X86::R8, X86::R9, X86::R10, X86::R11, 0

Required other changes:
- FormatTokens can now have a special role that contains extra data and can do
special formattings. A comma separated list is currently the only
- Move penalty calculation entirely into ContinuationIndenter (there was a last
piece still in UnwrappedLineFormatter).

Review: http://llvm-reviews.chandlerc.com/D1457

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189018 91177308-0d34-0410-b5e6-96231b3b80d8