History log of /external/clang/lib/Format/FormatToken.h
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/lib/Format/FormatToken.h
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Format/FormatToken.h
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Format/FormatToken.h
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
/external/clang/lib/Format/FormatToken.h
c96894305223479789b990522b2877e766979f17 22-Oct-2013 Daniel Jasper <djasper@google.com> clang-format: Fix ObjC literal indentation in Google style.

Style guide demands a two-space indent.

Before:
NSArray *arguments = @[
kind == kUserTicket ? @"--user-store" : @"--system-store",
@"--print-tickets",
@"--productid",
@"com.google.Chrome"
];

After:
NSArray *arguments = @[
kind == kUserTicket ? @"--user-store" : @"--system-store",
@"--print-tickets",
@"--productid",
@"com.google.Chrome"
];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
a07aa665a12ab23bef7aa4aedfe113dd8b13da57 22-Oct-2013 Daniel Jasper <djasper@google.com> clang-format: Improve formatting of ObjC array literals.

Before:
NSArray *arguments =
@[ kind == kUserTicket ? @"--user-store" : @"--system-store",
@"--print-tickets", @"--productid", @"com.google.Chrome" ];
After:
NSArray *arguments = @[
kind == kUserTicket ? @"--user-store" : @"--system-store",
@"--print-tickets",
@"--productid",
@"com.google.Chrome"
];

This fixes llvm.org/PR15231.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
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,
#else
template <
#ifdef A
MyType<Some> >
#else
Type1, Type2>
#endif
param2,
#endif
param3) {
f();
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
01fe9f9f320dd4342664376f24eb1a0d004d03c8 10-Oct-2013 Alexander Kornienko <alexfh@google.com> Correctly detect colon in bit fields. Fixes PR17333.

Summary: Colon was incorrectly detected as a start of inheritance list. Fixed.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

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

Summary:
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
/external/clang/lib/Format/FormatToken.h
db4813a3997fcf3864d1190f8021ef68e42cc057 06-Sep-2013 Daniel Jasper <djasper@google.com> clang-format: Fix regression introduced by r189337.

Before:
if (aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) == 5) ...

After:
if (aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
== 5) ...

Also precompute startsBinaryExpression() to improve performance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
0b62cc30c9aa462184de0435dc083d944a41d67f 05-Sep-2013 Alexander Kornienko <alexfh@google.com> Handle zero-width and double-width characters in string literals and comments.

Summary:
Count column width instead of the number of code points. This also
includes correct handling of tabs inside string literals and comments (with an
exception of multiline string literals/comments, where tabs are present before
the first escaped newline).

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
567dcf95424d69657f75e4bfd028967ca1f9eb8d 05-Sep-2013 Daniel Jasper <djasper@google.com> clang-format: Enable formatting of nested blocks.

Among other things, this enables (better) formatting lambdas and
constructs like:
MACRO({
long_statement();
long_statement_2();
},
{
long_statement();
long_statement_2();
},
{ short_statement(); }, "");

This fixes llvm.org/PR15381.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
4b762a91faac0473fa380ea9731992b24867e2e6 02-Sep-2013 Alexander Kornienko <alexfh@google.com> Store first and last newline position in the token text for string literals and comments.

Summary:
Store first and last newline position in the token text for string literals and
comments to avoid doing .find('\n') for each possible solution.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
dcc0c5bb7ce9a731ecbc0b8e8477979cd9e730c0 29-Aug-2013 Alexander Kornienko <alexfh@google.com> Better support for multiline string literals (including C++11 raw string literals).

Summary:
Calculate characters in the first and the last line correctly so that
we only break before the literal when needed.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
c41e8198dc1f24a1c6d35046fc4d478546761648 29-Aug-2013 Manuel Klimek <klimek@google.com> Fixes various problems with accounting for tabs in the original code.

We now count the original token's column directly when lexing the
tokens, where we already have all knowledge about where lines start.

Before this patch, formatting:
void f() {
\tg();
\th();
}
would incorrectly count the \t's as 1 character if only the line
containing h() was reformatted, and thus indent h() at offset 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
d3fef0fe26da19685bdec6a1bd844505f604d593 27-Aug-2013 Daniel Jasper <djasper@google.com> clang-format: Format segments of builder-type calls one per line.

This fixes llvm.org/PR14818.

Before:
return llvm::StringSwitch<Reference::Kind>(name)
.StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
.StartsWith(".eh_frame", ORDER_EH_FRAME)
.StartsWith(".init", ORDER_INIT).StartsWith(".fini", ORDER_FINI)
.StartsWith(".hash", ORDER_HASH).Default(ORDER_TEXT);

After:
return llvm::StringSwitch<Reference::Kind>(name)
.StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
.StartsWith(".eh_frame", ORDER_EH_FRAME)
.StartsWith(".init", ORDER_INIT)
.StartsWith(".fini", ORDER_FINI)
.StartsWith(".hash", ORDER_HASH)
.Default(ORDER_TEXT);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
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
implementation.
- 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
/external/clang/lib/Format/FormatToken.h
e8b10d3d5b90efaf60ad89e96f6500f971ceec41 26-Jul-2013 Daniel Jasper <djasper@google.com> clang-format: Add two new style options to support WebKit style.

New options:
* Break before the commas of constructor initializers and align
the commas with the colon.
* Break before binary operators

Additionally, for styles without column limit, don't just accept
linebreaks done by the user, but instead remove 'invalid' (according
to the current style) linebreaks and add 'required' ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
561211d35b5a2825fba6d0c017044f6896b204fd 16-Jul-2013 Daniel Jasper <djasper@google.com> clang-format: Improve handling of unterminated string literals.

Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
c7bd68f9edcbca95e882d0ab18d09371f0bdb82c 10-Jul-2013 Daniel Jasper <djasper@google.com> Add experimental flag for adaptive parameter bin-packing.

This is not activated for any style, might change or go away
completely.

For those that want to play around with it, set
ExperimentalAutoDetectBinPacking to true.

clang-format will then:
Look at whether function calls/declarations/definitions are currently
formatted with one parameter per line (on a case-by-case basis). If so,
clang-format will avoid bin-packing the parameters. If all parameters
are on one line (thus that line is "inconclusive"), clang-format will
make the choice dependent on whether there are other bin-packed
calls/declarations in the same file.

The reason for this change is that bin-packing in some situations can be
really bad and an author might opt to put one parameter on each line. If
the author does that, he might want clang-format not to mess with that.
If the author is unhappy with the one-per-line formatting, clang-format
can easily be convinced to bin-pack by putting any two parameters on the
same line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
2ca3741a962ded08866596577aaee2f4ab74c955 09-Jul-2013 Daniel Jasper <djasper@google.com> Initial support for formatting trailing return types.

This fixes llvm.org/PR15170.

For now, the basic formatting rules are (based on the C++11 standard):
* Surround the "->" with spaces.
* Break before "->".

Also fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
0de1c4d152b5fbf0b383e9fa8396e334f029c716 09-Jul-2013 Daniel Jasper <djasper@google.com> Fix alignment of closing brace in braced initializers.

Before:
someFunction(OtherParam, BracedList{
// comment 1 (Forcing intersting break)
param1, param2,
// comment 2
param3, param4
});
After:
someFunction(OtherParam, BracedList{
// comment 1 (Forcing intersting break)
param1, param2,
// comment 2
param3, param4
});

To do so, the UnwrappedLineParser now stores the information about the
kind of brace in the FormatToken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
2a409b62126d8f0b8f5749d5ed435ad2b394b526 08-Jul-2013 Daniel Jasper <djasper@google.com> Reformat clang-format's source files after r185822 and others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
0bdc6434fa0fea933b6ab566eff751afdba40a2a 04-Jul-2013 Alexander Kornienko <alexfh@google.com> Fixed typo: NoneComment -> NonComment, no other changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
53d4f318d9fe8e09bd3afc3114abc04812840992 01-Jul-2013 Craig Topper <craig.topper@gmail.com> Use LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
0e5a8887ff30957f4bf59cc91965e7a620dbf34a 25-Jun-2013 Nico Weber <nicolasweber@gmx.de> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
54e6c9d1f15153d1756642080866f10a91cc86ea 07-Jun-2013 Alexander Kornienko <alexfh@google.com> Improved handling of escaped newlines at the token start.

Summary: Remove them from the TokenText as well.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
00895106f9ed602af67984ec4d225a0cdc8c12af 05-Jun-2013 Alexander Kornienko <alexfh@google.com> UTF-8 support for clang-format.

Summary:
Detect if the file is valid UTF-8, and if this is the case, count code
points instead of just using number of bytes in all (hopefully) places, where
number of columns is needed. In particular, use the new
FormatToken.CodePointCount instead of TokenLength where appropriate.
Changed BreakableToken implementations to respect utf-8 character boundaries
when in utf-8 mode.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits, rsmith, gribozavr

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h
3b71155dc93fb3556dfe8b758ae6e448b6fbb9c8 03-Jun-2013 Alexander Kornienko <alexfh@google.com> Moved FormatToken to a separate header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Format/FormatToken.h