History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1151 – 1175 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.5.0-rc4
# 168c8aa6 27-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix regression in formatting of braced initializers.

Before:
Node n{1, Node{1000}, //
2};

After:
Node n{1, Node{1000}, //
2};

llvm-svn: 216540


# 8f463654 26-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Don't butcher __asm blocks.

Instead completely cop out of formatting them for now.

This fixes llvm.org/PR20618.

llvm-svn: 216501


# ad981f88 26-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: New option SpacesInSquareBrackets.

Before:
int a[5];
a[3] += 42;

After:
int a[ 5 ];
a[ 3 ] += 42;

Fixes LLVM bug #17887 (http://llvm.org/bugs/show_bug.cgi?id=17887).

Patch b

clang-format: New option SpacesInSquareBrackets.

Before:
int a[5];
a[3] += 42;

After:
int a[ 5 ];
a[ 3 ] += 42;

Fixes LLVM bug #17887 (http://llvm.org/bugs/show_bug.cgi?id=17887).

Patch by Marek Kurdej, thank you!

llvm-svn: 216449

show more ...


# 610381ff 26-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve handling of block comments in braced lists.

Before:
std::vector<int> v = {
1, 0 /* comment */
};

After:
std::vector<int> v = {1, 0 /* comment */};

llvm-svn: 216445


# 4b3ba214 25-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand sequenced casts.

This fixed llvm.org/PR20712.

Before:
int i = (int)(int) -2;

After:
int i = (int)(int)-2;

llvm-svn: 216378


# 7189fb2c 25-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve formatting of nested builder-type calls.

Before:
f(FirstToken->WhitespaceRange.getBegin().getLocWithOffset(
First->LastNewlineOffset));

After:
f(FirstToken->Whitespa

clang-format: Improve formatting of nested builder-type calls.

Before:
f(FirstToken->WhitespaceRange.getBegin().getLocWithOffset(
First->LastNewlineOffset));

After:
f(FirstToken->WhitespaceRange.getBegin()
.getLocWithOffset(First->LastNewlineOffset));

llvm-svn: 216377

show more ...


Revision tags: llvmorg-3.5.0-rc3
# ea79ea16 15-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Prefer breaking after return type over template param

Before:
typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<
aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaa

clang-format: Prefer breaking after return type over template param

Before:
typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<
aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaaaaaaaaaa,
bool *aa) {}

After:
typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa
aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}

llvm-svn: 215693

show more ...


# c6221a58 14-Aug-2014 Alexander Kornienko <alexfh@google.com>

Split a large unit-test, so that it doesn't exceed stack frame size in certain test environments

llvm-svn: 215639


# db76479d 14-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix AlwaysBreakAfterDefinitionReturnType in Stroutrup style

Before:
template <class T>
T *f(T &c) // Problem here: no line break before f
{
return NULL;
}

After:
templa

clang-format: Fix AlwaysBreakAfterDefinitionReturnType in Stroutrup style

Before:
template <class T>
T *f(T &c) // Problem here: no line break before f
{
return NULL;
}

After:
template <class T>
T *
f(T &c)
{
return NULL;
}

Patch by Marek Kurdej, thank you!

llvm-svn: 215633

show more ...


# 1904e9b9 14-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Support chained dereferenced assignments.

Before:
x = * a(x) = *a(y);

After:
x = *a(x) = *a(y);

llvm-svn: 215632


# 78b4533a 14-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Support breaking arguments of function type typedefs.

Before:
typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa

clang-format: Support breaking arguments of function type typedefs.

Before:
typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
typedef size_t (*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
const aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 215631

show more ...


# 5f594f80 13-Aug-2014 Manuel Klimek <klimek@google.com>

Fix crasher bug in clang-format.

llvm-svn: 215549


# 839922e9 13-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Format long lists in columns if without bin-packing.

After (even with BinPacking = false):
const Aaaaaa aaaaa = {
aaaaa, bbbbb, ccccc, ddddd, eeeee, ffffff, ggggg, hhhhhh,

clang-format: Format long lists in columns if without bin-packing.

After (even with BinPacking = false):
const Aaaaaa aaaaa = {
aaaaa, bbbbb, ccccc, ddddd, eeeee, ffffff, ggggg, hhhhhh,
iiiiii, jjjjjj, kkkkkk, aaaaa, bbbbb, ccccc, ddddd, eeeee,
ffffff, ggggg, hhhhhh, iiiiii, jjjjjj, kkkkkk,
};

Before:
<each element on its own line>

This fixes http://llvm.org/PR20623.

llvm-svn: 215529

show more ...


# 343643b9 13-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand #defines defining system includes.

Before:
#define MY_IMPORT < a / b >

After:
#define MY_IMPORT <a/b>

llvm-svn: 215527


# 598dd330 12-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Avoid bad line break.

Before:
int
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(const
typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);

After:
int aaaaaaaaaaaaaaaa

clang-format: Avoid bad line break.

Before:
int
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(const
typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);

After:
int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa);

llvm-svn: 215442

show more ...


# a043cedf 11-Aug-2014 Roman Kashitsyn <romankashicin@gmail.com>

Fixes bug 20587 - Add K&R break before braces style

Summary:
http://llvm.org/bugs/show_bug.cgi?id=20587

Added K&R style. It could be enabled by the following option:

```
BreakBeforeBraces: Kernigh

Fixes bug 20587 - Add K&R break before braces style

Summary:
http://llvm.org/bugs/show_bug.cgi?id=20587

Added K&R style. It could be enabled by the following option:

```
BreakBeforeBraces: KernighanRitchie
```

This style is like `Attach`, but break *only* before function
declarations.

As I can see, no additional logic required to support this style, any
style different from other styles automagically satisfies K&R.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D4837

llvm-svn: 215354

show more ...


# a5621202 08-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Prefer not to put lambdas on a single line.

Before:
string abc =
SomeFunction(aaaaaaaaaaaaa, aaaaa,
[]() { SomeOtherFunctioooooooooooooooooooooooooon(); });

clang-format: Prefer not to put lambdas on a single line.

Before:
string abc =
SomeFunction(aaaaaaaaaaaaa, aaaaa,
[]() { SomeOtherFunctioooooooooooooooooooooooooon(); });

After:
string abc = SomeFunction(aaaaaaaaaaaaa, aaaaa, []() {
SomeOtherFunctioooooooooooooooooooooooooon();
});

llvm-svn: 215197

show more ...


Revision tags: llvmorg-3.5.0-rc2
# 78b19499 06-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Correct SBPO_Always-behavior after function-like keywords

Before:
auto f (int x) -> decltype(x) { return sizeof(x); }
int g () noexcept(someCall ());
static_assert(sizeof(char) =

clang-format: Correct SBPO_Always-behavior after function-like keywords

Before:
auto f (int x) -> decltype(x) { return sizeof(x); }
int g () noexcept(someCall ());
static_assert(sizeof(char) == 1, "Your compiler is broken");

After:
auto f (int x) -> decltype (x) { return sizeof (x); }
int g () noexcept (someCall ());
static_assert (sizeof (char) == 1, "Your compiler is broken");

This fixes llvm.org/PR20559.
Patch by Roman Kashitsyn, thank you!

llvm-svn: 214969

show more ...


# 47189443 06-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Add special comments to disable formatting.

With this patch:
int ThisWillBeFormatted;
// clang-format off
int ThisWontBeFormatted;
// clang-format on
int Formatted;

This i

clang-format: Add special comments to disable formatting.

With this patch:
int ThisWillBeFormatted;
// clang-format off
int ThisWontBeFormatted;
// clang-format on
int Formatted;

This is for regions where a significantly nicer code layout can be found
knowing the content of the code.

This fixes llvm.org/PR20463.

llvm-svn: 214966

show more ...


# 316ab38e 06-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix indentation in multi-line placement new.

Before:
auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
ty

clang-format: Fix indentation in multi-line placement new.

Before:
auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
typename aaaaaaaaaaaaaaaaaaaaaaaa();

After:
auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
typename aaaaaaaaaaaaaaaaaaaaaaaa();

llvm-svn: 214964

show more ...


# 0a84f178 05-Aug-2014 Chad Rosier <mcrosier@codeaurora.org>

[PR19983] SBPO_Always not covering all the cases.
Patch by "Roman Kashitsyn" <romankashicin@gmail.com>.
Phabricator revision: http://reviews.llvm.org/D4788

llvm-svn: 214904


# ca4ea1ce 05-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Add option to always break after a function's return type.

This is required for GNU coding style, among others.

Also update the configuration documentation.

Modified from an original

clang-format: Add option to always break after a function's return type.

This is required for GNU coding style, among others.

Also update the configuration documentation.

Modified from an original patch by Jarkko Hietaniemi, thank you!

llvm-svn: 214858

show more ...


# d9670878 05-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Break before 'else' in Stroustrup style.

Seems to be the desired thing to do according to:
http://www.stroustrup.com/Programming/PPP-style-rev3.pdf

Patch by Jarkko Hietaniemi, thank

clang-format: Break before 'else' in Stroustrup style.

Seems to be the desired thing to do according to:
http://www.stroustrup.com/Programming/PPP-style-rev3.pdf

Patch by Jarkko Hietaniemi, thank you!

llvm-svn: 214857

show more ...


# 65df5aa9 04-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand parameter pack initialization.

Before:
Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}

After:
Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}

llvm

clang-format: Understand parameter pack initialization.

Before:
Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}

After:
Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}

llvm-svn: 214720

show more ...


# dcf37fbe 01-Aug-2014 Daniel Jasper <djasper@google.com>

clang-format: Add a space in ObjC protocols.

Before:
@interface Foo (HackStuff)<MyProtocol>

After:
@interface Foo (HackStuff) <MyProtocol>

llvm-svn: 214508


1...<<41424344454647484950>>...82