History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1701 – 1725 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 399d1ee5 22-Mar-2013 Daniel Jasper <djasper@google.com>

More precisely recognize ObjC method declarations.

Otherwise, +/- and the beginning of constants can be recognized
incorrectly.

Before: #define A - 1
After: #define A -1
llvm-svn: 177725


# 55213652 22-Mar-2013 Daniel Jasper <djasper@google.com>

Make clang-format understand more line comments.

Apparently one needs to set LangOptions.LineComment.

Before "//* */" got reformatted to "/ /* */" as the lexer was returning
the token sequence (sla

Make clang-format understand more line comments.

Apparently one needs to set LangOptions.LineComment.

Before "//* */" got reformatted to "/ /* */" as the lexer was returning
the token sequence (slash, comment). This could also lead to weird other
stuff, e.g. for people that like to using comments like:
//****************

llvm-svn: 177720

show more ...


# 547a9f52 21-Mar-2013 Alexander Kornienko <alexfh@google.com>

Better block comment formatting.

Summary:
1. When splitting one-line block comment, use indentation and *s.
2. Remove trailing whitespace from all lines of a comment, not only the ones being splitte

Better block comment formatting.

Summary:
1. When splitting one-line block comment, use indentation and *s.
2. Remove trailing whitespace from all lines of a comment, not only the ones being splitted.
3. Add backslashes for all lines if a comment is used insed a preprocessor directive.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 177635

show more ...


# 674be0a3 20-Mar-2013 Alexander Kornienko <alexfh@google.com>

Support for pointers-to-members usage via .*

Summary: Added support for pointers-to-members usage via .* and a few tests.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differen

Support for pointers-to-members usage via .*

Summary: Added support for pointers-to-members usage via .* and a few tests.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 177537

show more ...


# 291f9363 20-Mar-2013 Daniel Jasper <djasper@google.com>

Remove assertion that can be triggered on bad input.

clang-format can't do anything useful, so it should leave the remainder
of the line unchanged, but it should not assert/segfault.

llvm-svn: 1775

Remove assertion that can be triggered on bad input.

clang-format can't do anything useful, so it should leave the remainder
of the line unchanged, but it should not assert/segfault.

llvm-svn: 177530

show more ...


# 1a32a61a 20-Mar-2013 Daniel Jasper <djasper@google.com>

Fix infinite-loop in unwrapped line parser.

Discovered when accidentally formatting a python file :-).

llvm-svn: 177527


# 66dc2ec3 20-Mar-2013 Daniel Jasper <djasper@google.com>

Do not consider comments when adjusting to local indent style.

Before (when only reformatting "int b"):
int a; // comment
// comment
int b;

After:
int a; // comment
// comment

Do not consider comments when adjusting to local indent style.

Before (when only reformatting "int b"):
int a; // comment
// comment
int b;

After:
int a; // comment
// comment
int b;

This also fixes llvm.org/PR15433.

llvm-svn: 177524

show more ...


# aab220f3 20-Mar-2013 Daniel Jasper <djasper@google.com>

Reduce penalty for breaks after "(" for functions with parameters.

Before:
aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,

Reduce penalty for breaks after "(" for functions with parameters.

Before:
aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
After:
aaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 177521

show more ...


# d1ae3588 20-Mar-2013 Daniel Jasper <djasper@google.com>

Add extra indentation for multiline comparisons.

This seems to be generally more desired.

Before:
if (aaaaaaaa &&
bbbbbbbb >
cccccccc) {}
After:
if (aaaaaaaa &&
bbbbbbbb >
ccccc

Add extra indentation for multiline comparisons.

This seems to be generally more desired.

Before:
if (aaaaaaaa &&
bbbbbbbb >
cccccccc) {}
After:
if (aaaaaaaa &&
bbbbbbbb >
cccccccc) {}

Also: Some formatting cleanup on clang-format's files.
llvm-svn: 177514

show more ...


# a127512c 20-Mar-2013 Daniel Jasper <djasper@google.com>

Don't remove all indentation when in #defines.

Otherwise, this can become hard to read.

Before: #define A \
case 1:
After: #define A \
case 1:
llvm-svn: 177509


# b8914dd4 20-Mar-2013 Daniel Jasper <djasper@google.com>

Improve formatting of function types in template parameters.

Before: A<int * (int)>;
After: A<int *(int)>;
llvm-svn: 177505


# 2bd32ca9 19-Mar-2013 Daniel Jasper <djasper@google.com>

Fix indentation for case: // comment.

Before:
switch (x) {
case 1:
// Do amazing stuff
{
g();
f();
}
}

After:
switch (x) {
case 1:
// Do amazing stuff
{
g();
f();
}
}

llv

Fix indentation for case: // comment.

Before:
switch (x) {
case 1:
// Do amazing stuff
{
g();
f();
}
}

After:
switch (x) {
case 1:
// Do amazing stuff
{
g();
f();
}
}

llvm-svn: 177420

show more ...


# afcef33d 19-Mar-2013 Alexander Kornienko <alexfh@google.com>

Split long lines in multi-line comments.

Summary: This is implementation for /* */ comments only.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://ll

Split long lines in multi-line comments.

Summary: This is implementation for /* */ comments only.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 177415

show more ...


# 850677d9 18-Mar-2013 Daniel Jasper <djasper@google.com>

Fix clang-format segfault.

When annotating "lines" starting with ":", clang-format would segfault.
This could actually happen in valid code, e.g.
#define A :

llvm-svn: 177283


# 9b33424d 15-Mar-2013 Daniel Jasper <djasper@google.com>

Improve formatting of chained calls.

clang-format already prevented sequences like:
...
SomeParameter).someFunction(
...

as those are quite confusing. This failed on:
...
SomeParameter).s

Improve formatting of chained calls.

clang-format already prevented sequences like:
...
SomeParameter).someFunction(
...

as those are quite confusing. This failed on:
...
SomeParameter).someFunction(otherFunction(
...

Fixed in this patch.

llvm-svn: 177157

show more ...


# 79d6c72e 15-Mar-2013 Alexander Kornienko <alexfh@google.com>

Indent all lines in a multi-line comment by the same amount.

Summary:
Do this to avoid spoling nicely formatted multi-line comments (e.g.
with code examples or similar stuff).

Reviewers: djasper

R

Indent all lines in a multi-line comment by the same amount.

Summary:
Do this to avoid spoling nicely formatted multi-line comments (e.g.
with code examples or similar stuff).

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 177153

show more ...


# dd8ed854 14-Mar-2013 Alexander Kornienko <alexfh@google.com>

Multi-line comment alignment

Summary:
Aligns continuation lines of multi-line comments to the base
indentation level +1:
class A {
/*
* test
*/
void f() {}
};

The first revision is work i

Multi-line comment alignment

Summary:
Aligns continuation lines of multi-line comments to the base
indentation level +1:
class A {
/*
* test
*/
void f() {}
};

The first revision is work in progress. The implementation is not yet complete.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 177080

show more ...


# f38a0ace 14-Mar-2013 Daniel Jasper <djasper@google.com>

Slightly improve formatting of longer pipe statements.

The stronger binding of a string ending in :/= does not really make
sense if it is the only character.

Before:
llvm::outs() << aaaaaaaaaaaaaaa

Slightly improve formatting of longer pipe statements.

The stronger binding of a string ending in :/= does not really make
sense if it is the only character.

Before:
llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa
<< "=" << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

After:
llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa << "="
<< bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

llvm-svn: 177075

show more ...


# 40aacf48 14-Mar-2013 Daniel Jasper <djasper@google.com>

Basic support for formatting asm() statments.

llvm-svn: 177073


# ae907645 14-Mar-2013 Daniel Jasper <djasper@google.com>

Fix dereference formatting in for-loops.

Before: for (char **a = b; * a; ++a) {}
After: for (char **a = b; *a; ++a) {}
llvm-svn: 177037


# bf4755bb 14-Mar-2013 Daniel Jasper <djasper@google.com>

Improve formatting of trailing annotations.

Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((
unused));

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Improve formatting of trailing annotations.

Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((
unused));

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
__attribute__((unused));

llvm-svn: 177034

show more ...


# 8a68b95d 13-Mar-2013 Daniel Jasper <djasper@google.com>

Fix incorrect cast identification.

Before: int a = sizeof(int *)+ b;"
After: int a = sizeof(int *) + b;
llvm-svn: 176957


# 0f8ed9e4 13-Mar-2013 Daniel Jasper <djasper@google.com>

Fix comment indentation before labels.

Before:
switch (x) {
// if 1, do f()
case 1:
f();
}

After:
switch (x) {
// if 1, do f()
case 1:
f();
}

llvm-svn: 176953


# 8f6ae191 13-Mar-2013 Daniel Jasper <djasper@google.com>

Fix formatting issue with builder-type calls.

Before:
->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() - aaaaaaaaa()->aaaaaa()
->aaa

Fix formatting issue with builder-type calls.

Before:
->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() - aaaaaaaaa()->aaaaaa()
->aaaaa());

After:
a->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() -
aaaaaaaaa()->aaaaaa()->aaaaa());

llvm-svn: 176952

show more ...


# 97b89484 13-Mar-2013 Daniel Jasper <djasper@google.com>

Fix formatting of new arrays of pointers.

Before:
A = new SomeType * [Length];
A = new SomeType *[Length]();

After:
A = new SomeType *[Length];
A = new SomeType *[Length]();

Small formatting clean

Fix formatting of new arrays of pointers.

Before:
A = new SomeType * [Length];
A = new SomeType *[Length]();

After:
A = new SomeType *[Length];
A = new SomeType *[Length]();

Small formatting cleanups with clang-format.

llvm-svn: 176936

show more ...


1...<<61626364656667686970>>...82