History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1076 – 1100 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# d6a1cab1 12-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Improve format of lambdas in ctor initializers.

Before:
Constructor()
: Constructor([] { // comment
int i;
}) {}

After:
Constructor()
: Constructor([] {

clang-format: Improve format of lambdas in ctor initializers.

Before:
Constructor()
: Constructor([] { // comment
int i;
}) {}

After:
Constructor()
: Constructor([] { // comment
int i;
}) {}

llvm-svn: 225625

show more ...


# 2337f280 12-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix formatting of inline asm.

Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.

This fixes llvm.org/PR22190.

llvm-svn: 225

clang-format: Fix formatting of inline asm.

Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.

This fixes llvm.org/PR22190.

llvm-svn: 225623

show more ...


# d05d3a89 08-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Force line break between "endl" and "<<".

This makes piped output easier to read in many instances.

Before:
llvm::errs() << aaaa << std::endl << bbbb << std::endl;

After:
llvm::e

clang-format: Force line break between "endl" and "<<".

This makes piped output easier to read in many instances.

Before:
llvm::errs() << aaaa << std::endl << bbbb << std::endl;

After:
llvm::errs() << aaaa << std::endl
<< bbbb << std::endl;

Also fix a few instance of "don't use else after return" as per the
coding standards.

llvm-svn: 225444

show more ...


# b13135bc 08-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Improve template parameter detection.

Before:
struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>;

After:
struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>;

llvm

clang-format: Improve template parameter detection.

Before:
struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>;

After:
struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>;

llvm-svn: 225435

show more ...


# 49532104 07-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Understand single-line comments at the end of blocks.

This prevents clang-format from moving/aligning the comment in the
snippet:
void f() {
int i; // some comment
// some un

clang-format: Understand single-line comments at the end of blocks.

This prevents clang-format from moving/aligning the comment in the
snippet:
void f() {
int i; // some comment
// some unrelated comment
}

llvm-svn: 225352

show more ...


# 6a968203 07-Jan-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix unary operator detection.

Before:
** outparam = 1;

After:
**outparam = 1;

llvm-svn: 225349


# 3a623dbd 18-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect detection of ObjC "in" keyword.

Before:
for (auto v : in [1]) { ..

After:
for (auto v : in[1]) { ..

llvm-svn: 224513


Revision tags: llvmorg-3.5.1, llvmorg-3.5.1-rc2
# 732b6bd4 14-Dec-2014 Alexander Kornienko <alexfh@google.com>

Don't break single-line raw string literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 224223


# 11a0ac66 12-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Revamp nested block formatting.

This fixed llvm.org/PR21804 and hopefully a few other strange cases.

Before:
if (blah_blah(whatever, whatever, [] {
doo_dah();
doo_dah(

clang-format: Revamp nested block formatting.

This fixed llvm.org/PR21804 and hopefully a few other strange cases.

Before:
if (blah_blah(whatever, whatever, [] {
doo_dah();
doo_dah();
})) {
}
}

After:
if (blah_blah(whatever, whatever, [] {
doo_dah();
doo_dah();
})) {
}
}

llvm-svn: 224112

show more ...


# 23846262 09-Dec-2014 Nico Weber <nicolasweber@gmx.de>

clang-format: Add a test for PR19603 which seems fixed (maybe by r221338?).

llvm-svn: 223850


Revision tags: llvmorg-3.5.1-rc1
# 3431b750 08-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Support commas in lambda return types.

Before:
auto next_pair = [](A * a) -> pair<A*, A*>{};

After:
auto next_pair = [](A* a) -> pair<A*, A*>{};

llvm-svn: 223652


# 55aed677 07-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Don't merge lines with comments.

Before:
int f() { // comment return 42; }

After:
int f() { // comment
return 42;
}

This fixes llvm.org/PR21769.

llvm-svn: 223609


# 31f6c547 05-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.

This fixes llvm.org/PR21756.

llvm-svn: 223458


# 86ee0b6d 04-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: More restrictively classify import declarations.

Before:
import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
import::SomeFunction(aaaaaaaaaaaa

clang-format: More restrictively classify import declarations.

Before:
import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 223345

show more ...


# c095663e 03-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix fake parentheses placement with comments.

Before:
return (a > b
// comment1
// comment2
|| c);

After:
return (a > b
// comment1
// comment2

clang-format: Fix fake parentheses placement with comments.

Before:
return (a > b
// comment1
// comment2
|| c);

After:
return (a > b
// comment1
// comment2
|| c);

llvm-svn: 223234

show more ...


# 3219e43c 02-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: Add option to suppress operator alignment.

With alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;

clang-format: Add option to suppress operator alignment.

With alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;

Without alignment:
int aaaaaa = aa
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
* cccccccccccccccccccccccccccccccc;

This fixes llvm.org/PR21666.

llvm-svn: 223117

show more ...


# 8c6e9ef6 02-Dec-2014 Daniel Jasper <djasper@google.com>

clang-format: precedence-based indentation when breaking before operators.

Before:
bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

clang-format: precedence-based indentation when breaking before operators.

Before:
bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
== aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
&& aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> ccccccccccccccccccccccccccccccccccccccccc;

After:
bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
== aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
&& aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> ccccccccccccccccccccccccccccccccccccccccc;

Not particularly pretty, but can probably help to uncover bugs. And if this
bugs somebody, parentheses can help.

llvm-svn: 223111

show more ...


# 9e709351 26-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Add SFS_Empty to only empty functions on a single line.

Activated for and tested by Google's Java style.

This fixes llvm.org/PR21667.

llvm-svn: 222819


# 79f226e7 23-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Make short case labels work with #ifs

Before:
switch (a) {
#if FOO
case 0: return 0; #endif
}

After:
switch (a) {
#if FOO
case 0: return 0;
#endif
}

This fixed llvm

clang-format: Make short case labels work with #ifs

Before:
switch (a) {
#if FOO
case 0: return 0; #endif
}

After:
switch (a) {
#if FOO
case 0: return 0;
#endif
}

This fixed llvm.org/PR21544.

llvm-svn: 222642

show more ...


# bb86d847 23-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve ObjC blocks with return type.

Before:
Block b = ^int * (A * a, B * b) {}

After:
Block b = ^int *(A *a, B *b) {}

This fixed llvm.org/PR21619.

llvm-svn: 222639


# bcb55eec 21-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Understand more lambda return types.

Before:
auto a = [&b, c ](D * d) -> D * {}

After:
auto a = [&b, c](D* d) -> D* {}

llvm-svn: 222534


# 4b444495 21-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Use nested block special case for all languages.

Previously this was only used for JavaScript.

Before:
functionCall({
int i;
int j;

clang-format: Use nested block special case for all languages.

Previously this was only used for JavaScript.

Before:
functionCall({
int i;
int j;
},
aaaa, bbbb, cccc);

After:
functionCall({
int i;
int j;
}, aaaa, bbbb, cccc);

llvm-svn: 222531

show more ...


# d081e88e 21-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Handle comments in short case labels.

With AllowShortCaseLabelsOnASingleLine set to true:
This gets now left unchanged:
case 1:
// comment
return;

Whereas before it was chan

clang-format: Handle comments in short case labels.

With AllowShortCaseLabelsOnASingleLine set to true:
This gets now left unchanged:
case 1:
// comment
return;

Whereas before it was changed into:
case 1: // comment return;

This fixes llvm.org/PR21630.

llvm-svn: 222529

show more ...


# 3aa9a6a1 18-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Add option to disable alignment after opening brackets

Before:
SomeFunction(parameter,
parameter);

After:
SomeFunction(parameter,
parameter);

Patch by Harry

clang-format: Add option to disable alignment after opening brackets

Before:
SomeFunction(parameter,
parameter);

After:
SomeFunction(parameter,
parameter);

Patch by Harry Terkelsen, thank you!

llvm-svn: 222284

show more ...


# e1e348b8 17-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix more incorrect pointer detection.

Before:
Constructor() : a(a), b(c, d *e) {}

After:
Constructor() : a(a), b(c, d * e) {}

llvm-svn: 222158


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