History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1301 – 1325 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 559b63cb 28-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand __attribute__s preceding parameter lists.

Before:
ReturnType __attribute__((unused))
function(int i);

After:
ReturnType __attribute__((unused))
function(int i);

clang-format: Understand __attribute__s preceding parameter lists.

Before:
ReturnType __attribute__((unused))
function(int i);

After:
ReturnType __attribute__((unused))
function(int i);

This fixes llvm.org/PR18632.

llvm-svn: 200337

show more ...


# e9beea24 28-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Add support for a space after @property

Mozilla and WebKit seem to use a space after @property (verified by
grepping their codebases) so we turn this on there as well.

Change by Chris

clang-format: Add support for a space after @property

Mozilla and WebKit seem to use a space after @property (verified by
grepping their codebases) so we turn this on there as well.

Change by Christian Legnitto. Thank you!

llvm-svn: 200320

show more ...


# ff974ab8 25-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect space removal.

Before:
Deleted &operator=(const Deleted &)&= default;
Deleted &operator=(const Deleted &)&&= delete;

After:
Deleted &operator=(const Deleted &)& =

clang-format: Fix incorrect space removal.

Before:
Deleted &operator=(const Deleted &)&= default;
Deleted &operator=(const Deleted &)&&= delete;

After:
Deleted &operator=(const Deleted &)& = default;
Deleted &operator=(const Deleted &)&& = delete;

llvm-svn: 200073

show more ...


# 421147ec 24-Jan-2014 Manuel Klimek <klimek@google.com>

Get rid of special parsing for return statements.

This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not neces

Get rid of special parsing for return statements.

This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not necessary any more.

llvm-svn: 199982

show more ...


# 6b70ec0d 22-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect lambda recognition.

Before:
std::unique_ptr<int[]> foo() {}

After:
std::unique_ptr<int []> foo() {}

Also, the formatting could go severely wrong after such a functi

clang-format: Fix incorrect lambda recognition.

Before:
std::unique_ptr<int[]> foo() {}

After:
std::unique_ptr<int []> foo() {}

Also, the formatting could go severely wrong after such a function
before.

llvm-svn: 199817

show more ...


# 7cfde414 21-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: text following #if is likely an expression.

Before:
#if AAAA &&BBBB

After:
#if AAAA && BBBB

llvm-svn: 199713


# 7052ce6d 19-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Better support and testing for protocol buffers.

With this patch, there is dedicated testing for protocol buffers
(https://developers.google.com/protocol-buffers/).

Also some minor tw

clang-format: Better support and testing for protocol buffers.

With this patch, there is dedicated testing for protocol buffers
(https://developers.google.com/protocol-buffers/).

Also some minor tweaks formatting tweaks.

llvm-svn: 199580

show more ...


# 31745731 19-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix ObjC block as first call parameter formatting.

Before:
foo (^{ bar(); });
After:
foo(^{ bar(); });

llvm-svn: 199573


# 47ef6dde 17-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Don't break lines starting with "import <string-literal>"

The author might be missing the "#" or these might be protocol buffer
definitions. Either way, we should not break the line or

clang-format: Don't break lines starting with "import <string-literal>"

The author might be missing the "#" or these might be protocol buffer
definitions. Either way, we should not break the line or the string.

There don't seem to be other valid use cases.

llvm-svn: 199501

show more ...


# a225bced 16-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve formatting of ObjC Blocks with return type.

Before:
int a = [operation block:^int(int * i) { return 1; }];

After:
int a = [operation block:^int(int *i) { return 1; }];

ll

clang-format: Improve formatting of ObjC Blocks with return type.

Before:
int a = [operation block:^int(int * i) { return 1; }];

After:
int a = [operation block:^int(int *i) { return 1; }];

llvm-svn: 199411

show more ...


# cb51cf40 16-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Enable formatting of lambdas with explicit return type.

So clang-format can now format:

int c = []()->int { return 2; }();
int c = []()->vector<int> { return { 2 }; }();

llvm-svn

clang-format: Enable formatting of lambdas with explicit return type.

So clang-format can now format:

int c = []()->int { return 2; }();
int c = []()->vector<int> { return { 2 }; }();

llvm-svn: 199368

show more ...


# b2e10a54 15-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fixed formatting of JavaScript container literals

Before:
var arr = [ 1, 2, 3 ];
var obj = {a : 1, b : 2, c : 3};

After:
var arr = [1, 2, 3];
var obj = {a: 1, b: 2, c: 3};

ll

clang-format: Fixed formatting of JavaScript container literals

Before:
var arr = [ 1, 2, 3 ];
var obj = {a : 1, b : 2, c : 3};

After:
var arr = [1, 2, 3];
var obj = {a: 1, b: 2, c: 3};

llvm-svn: 199317

show more ...


# d07c2ee9 14-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix bug introduced in r198871.

We cannot simply change the start column to accomodate for the @ in an
ObjC string literal as that will make clang-format happily violate the
column limi

clang-format: Fix bug introduced in r198871.

We cannot simply change the start column to accomodate for the @ in an
ObjC string literal as that will make clang-format happily violate the
column limit.

Use a different workaround instead. However, a better long-term
solution might be to join the @ and the rest of the literal into a
single token.

llvm-svn: 199198

show more ...


# f6c7c18b 13-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix corner case with comment in ctor initializer.

Formatting:
Constructor() :
// Comment forcing unwanted break.
aaaa(aaaa) {}

Before:
Constructor()
:
//

clang-format: Fix corner case with comment in ctor initializer.

Formatting:
Constructor() :
// Comment forcing unwanted break.
aaaa(aaaa) {}

Before:
Constructor()
:
// Comment forcing unwanted break.
aaaa(aaaa) {}

After:
Constructor()
: // Comment forcing unwanted break.
aaaa(aaaa) {}

llvm-svn: 199107

show more ...


# 85bde4cd 13-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Don't indent relative to ./->.

Before:
SomeThing // break
.SomeFunction( // break
param);
After:
SomeThing // break
.SomeFunction( // break

clang-format: Don't indent relative to ./->.

Before:
SomeThing // break
.SomeFunction( // break
param);
After:
SomeThing // break
.SomeFunction( // break
param);

Seems to be more common in editors and codebases I have looked at.

llvm-svn: 199105

show more ...


# 4d7a97ad 10-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Slightly adapt line break in edge case.

Before:
SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]
.insert(ccccccccccccccccccccccc);

After:
SomeMap[std::pair(aaaaaaaaaaaa, bb

clang-format: Slightly adapt line break in edge case.

Before:
SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)]
.insert(ccccccccccccccccccccccc);

After:
SomeMap[std::pair(aaaaaaaaaaaa, bbbbbbbbbbbbbbb)].insert(
ccccccccccccccccccccccc);

This seems to be about 3:1 more common in Google and Chromium style and I found
only a handful of instances inside the LLVM codebase.

llvm-svn: 198924

show more ...


# b1c19f89 10-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand ObjC boxed expressions.

Before:
[dictionary setObject:@(1)forKey:@"number"];
After:
[dictionary setObject:@(1) forKey:@"number"];

llvm-svn: 198920


# 174b0125 09-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Add @s when breaking NSString literals.

While it is allowed to not have an @ on subsequent lines, it seems
general practice to add them. If undesired, the code author can easily
remove

clang-format: Add @s when breaking NSString literals.

While it is allowed to not have an @ on subsequent lines, it seems
general practice to add them. If undesired, the code author can easily
remove them again and clang-format won't re-add them.

llvm-svn: 198871

show more ...


# dc32c1bf 09-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand #pragma mark

Before:
#pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
#pragma mark Any non-hyphenated or hyphenated string (includin

clang-format: Understand #pragma mark

Before:
#pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
#pragma mark Any non-hyphenated or hyphenated string (including parentheses).

llvm-svn: 198870

show more ...


# 0160347b 09-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Some tweaks to braces list formatting:

- Format a braced list with one element per line if it has nested
braced lists.
- Use a column layout only when the list has 6+ elements (inste

clang-format: Some tweaks to braces list formatting:

- Format a braced list with one element per line if it has nested
braced lists.
- Use a column layout only when the list has 6+ elements (instead of the
current 4+ elements).

llvm-svn: 198869

show more ...


# e21cb742 08-Jan-2014 Benjamin Kramer <benny.kra@googlemail.com>

clang-format: Don't hang forever when encountering a stray "}" in an @implementation block.

PR18406.

llvm-svn: 198770


# 7620b662 08-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix spacing in Cpp11 braced lists:

Before:
vector<int> foo{ ::SomeFunction()};

After:
vector<int> foo{::SomeFunction()};

llvm-svn: 198769


# 5553d0d4 07-Jan-2014 Chandler Carruth <chandlerc@gmail.com>

Sort all the #include lines with LLVM's utils/sort_includes.py which
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

Sort all the #include lines with LLVM's utils/sort_includes.py which
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

show more ...


# 1a148b49 05-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Spacing inside enum braces.

Before (in Google style):
enum ShortEnum {A, B, C};

After:
enum ShortEnum { A, B, C };

llvm-svn: 198559


# 9697281e 05-Jan-2014 Daniel Jasper <djasper@google.com>

clang-format: Allow formatting short enums on a single line.

Before:
enum ShortEnum {
A,
B,
C
};

After:
enum ShortEnum { A, B, C };

This seems to be the predominant choice in LLV

clang-format: Allow formatting short enums on a single line.

Before:
enum ShortEnum {
A,
B,
C
};

After:
enum ShortEnum { A, B, C };

This seems to be the predominant choice in LLVM/Clang as well as in
Google style.

llvm-svn: 198558

show more ...


1...<<51525354555657585960>>...82