History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1851 – 1875 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# d053c5b4 23-Jan-2013 Manuel Klimek <klimek@google.com>

Fix handling of macro definitions.

Now correctly formats:
#define A (1)

llvm-svn: 173264


# c1237a8b 23-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes layouting regression and invalid-read.

Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.

Also fixes an invalid-read found by the valgrind bot.

ll

Fixes layouting regression and invalid-read.

Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.

Also fixes an invalid-read found by the valgrind bot.

llvm-svn: 173262

show more ...


# 420d7d33 23-Jan-2013 Daniel Jasper <djasper@google.com>

Fix the formatting of pointer/reference types in range-based for loops.

Before: for (int & a : Values) {}
After: for (int &a : Values) {}
llvm-svn: 173259


# 43b6548c 23-Jan-2013 Daniel Jasper <djasper@google.com>

Removing the penalty for breaking after "=".

Having seen more cases, this actually was not a good thing to do in the
first place. We can still improve on what we do now, but breaking after
the "=" i

Removing the penalty for breaking after "=".

Having seen more cases, this actually was not a good thing to do in the
first place. We can still improve on what we do now, but breaking after
the "=" is good in many cases.

Before:
aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaa =
aa->aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

llvm-svn: 173257

show more ...


# 5b49f478 23-Jan-2013 Daniel Jasper <djasper@google.com>

Fix another regression for pointer types.

Before: if (int * a = &b) ...
After: if (int *a = &b) ...

Also changed all the existing tests to test the expressions in question
both in a declaration an

Fix another regression for pointer types.

Before: if (int * a = &b) ...
After: if (int *a = &b) ...

Also changed all the existing tests to test the expressions in question
both in a declaration and in an expression context.

llvm-svn: 173256

show more ...


# b9c0908f 23-Jan-2013 Daniel Jasper <djasper@google.com>

Fix regression in formatting pointer types.

We will need a more principled solution, but we should not leave this
unfixed until we come up with one.

Before: void f() { int * a; }
After: void f() {

Fix regression in formatting pointer types.

We will need a more principled solution, but we should not leave this
unfixed until we come up with one.

Before: void f() { int * a; }
After: void f() { int *a; }
llvm-svn: 173252

show more ...


# 39080573 23-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes incorrect handling of the declaration context stack.

llvm-svn: 173250


# d33516ef 23-Jan-2013 Manuel Klimek <klimek@google.com>

Fix segfaults in the formatter.

Also: expletive deleted.
llvm-svn: 173247


# e941b169 23-Jan-2013 Daniel Jasper <djasper@google.com>

Add option to allow putting all parameters onto the next line.

This only affects styles where BinPackParameters is false.

With AllowAllParametersOnNextLine:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Add option to allow putting all parameters onto the next line.

This only affects styles where BinPackParameters is false.

With AllowAllParametersOnNextLine:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaa);

Without it:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaa,
aaaaaaaaaa,
aaaaaaaaaa,
aaaaaaaaaaa,
aaaaaaaaaaa);

llvm-svn: 173246

show more ...


# 0a3a3c99 23-Jan-2013 Manuel Klimek <klimek@google.com>

Allow us to better guess the context of an unwrapped line.

This gives us the ability to guess better defaults for whether a *
between identifiers is a pointer dereference or binary operator.

Now co

Allow us to better guess the context of an unwrapped line.

This gives us the ability to guess better defaults for whether a *
between identifiers is a pointer dereference or binary operator.

Now correctly formats:
void f(a *b);
void f() { f(a * b); }

llvm-svn: 173243

show more ...


# 6029d4f3 22-Jan-2013 Nico Weber <nicolasweber@gmx.de>

Formatter: Remove a fixme klimek fixed in r173168.

Add a few comments to the ObjC test cases.

llvm-svn: 173169


# f92f7bc5 22-Jan-2013 Manuel Klimek <klimek@google.com>

Implements more principled comment parsing.

Changing nextToken() in the UnwrappedLineParser to get the next
non-comment token. This allows us to correctly layout a whole class of
snippets, like:

if

Implements more principled comment parsing.

Changing nextToken() in the UnwrappedLineParser to get the next
non-comment token. This allows us to correctly layout a whole class of
snippets, like:

if /* */(/* */ a /* */) /* */
f() /* */; /* */
else /* */
g();

Fixes a bug in the formatter where we would assume there is a previous
non-comment token.
Also adds the indent level of an unwrapped line to the debug output in
the parser.

llvm-svn: 173168

show more ...


# 50e7ab71 22-Jan-2013 Daniel Jasper <djasper@google.com>

Let the formatter be more restrictive for breaking around . and ->

Before:
aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa)
.aaaaaaaaaaaaaaaaaa();

After:
aaaaaaaaaaaaaaa(aaaaaaaaa

Let the formatter be more restrictive for breaking around . and ->

Before:
aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa)
.aaaaaaaaaaaaaaaaaa();

After:
aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa();

llvm-svn: 173160

show more ...


# 0b820602 22-Jan-2013 Daniel Jasper <djasper@google.com>

Fix "*" formatting when creating arrays of pointers.

Before: A = new int * [10]();
After: A = new int *[10]();
llvm-svn: 173150


# 304a986a 21-Jan-2013 Daniel Jasper <djasper@google.com>

Remove "incorrect" aligning of trailing comments.

We used to align trailing comments belong to different things.
Before:
void f() { // some function..
}
int a; // some variable..

After:
void f(

Remove "incorrect" aligning of trailing comments.

We used to align trailing comments belong to different things.
Before:
void f() { // some function..
}
int a; // some variable..

After:
void f() { // some function..
}
int a; // some variable..

llvm-svn: 173100

show more ...


# 2cec0191 21-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes various problems around enum parsing.

Very similar to what we do for record definitions:
- tighten down what is an enum definition, so that we don't mistake a
function for an enum
- allow co

Fixes various problems around enum parsing.

Very similar to what we do for record definitions:
- tighten down what is an enum definition, so that we don't mistake a
function for an enum
- allow common idioms around declarations (we'll want to handle that
more centrally in the future)

We now correctly format:
enum X f() {
a();
return 42;
}

llvm-svn: 173075

show more ...


# a4fe1c13 21-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes formatting of empty blocks.

We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement

N

Fixes formatting of empty blocks.

We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement

Note that we usually don't put record definitions into a single line, as
there's usually at least one more token (the semicolon) after the
closing brace. This doesn't hold when we are in a context where there is
no semicolon, like "enum E {}".

There were some missing tests around joining lines around the corner
cases of the allowed number of columns, so this patch adds some.

llvm-svn: 173055

show more ...


# c228619b 21-Jan-2013 Daniel Jasper <djasper@google.com>

Fix parsing of templated declarations.

Before: template <template <typename T>, typename P > class X;
After: template <template <typename T>, typename P> class X;

More importantly, the token annot

Fix parsing of templated declarations.

Before: template <template <typename T>, typename P > class X;
After: template <template <typename T>, typename P> class X;

More importantly, the token annotations for the second ">" are now computed
correctly.

llvm-svn: 173047

show more ...


# ae610d17 21-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes indent in linkage specification blocks.

We now indent:
extern "C" {
int a;
}

without additional indent inside the extern "C" block.

llvm-svn: 173045


# d5e782b0 21-Jan-2013 Manuel Klimek <klimek@google.com>

Add regression test.

llvm-svn: 173042


# cdee74db 21-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes detection of class template specializations.

Now correctly formats:
template <> class A<int> {} a;

llvm-svn: 173038


# 3c6b7c7d 21-Jan-2013 Manuel Klimek <klimek@google.com>

Allow for nested name specifiers in record declarations.

Now correctly formats:
class A::B {} n;

llvm-svn: 173019


# 762dd189 21-Jan-2013 Manuel Klimek <klimek@google.com>

Fix parsing of return statements.

Previously, we would not detect brace initializer lists in return
statements, thus:
return (a)(b) { 1, 2, 3 };
would put the semicolon onto the next line.

llvm-sv

Fix parsing of return statements.

Previously, we would not detect brace initializer lists in return
statements, thus:
return (a)(b) { 1, 2, 3 };
would put the semicolon onto the next line.

llvm-svn: 173017

show more ...


# 4b41745e 19-Jan-2013 Chandler Carruth <chandlerc@gmail.com>

Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncove

Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

llvm-svn: 172892

show more ...


# da08761b 18-Jan-2013 Manuel Klimek <klimek@google.com>

Fixes issues around pulling in the next line in simple if statements.

llvm-svn: 172822


1...<<71727374757677787980>>...82