History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 801 – 825 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 03a04fe9 12-Dec-2016 Daniel Jasper <djasper@google.com>

clang-format: Separate out a language kind for ObjC.

While C(++) and ObjC are generally formatted the same way and can be
mixed, people might want to choose different styles based on the
language. T

clang-format: Separate out a language kind for ObjC.

While C(++) and ObjC are generally formatted the same way and can be
mixed, people might want to choose different styles based on the
language. This patch recognizes .m and .mm files as ObjC and also
implements a very crude detection of whether or not a .h file contains
ObjC code. This can be improved over time.

Also move most of the ObjC tests into their own test file to keep file
size maintainable.

llvm-svn: 289428

show more ...


Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1
# 22ed262c 29-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Wrap complex binary expressions on the RHS of a comma.

Specifically, if the RHS of a comma is a complex binary expression and
spans multiple lines, insert a line break before it. This

clang-format: Wrap complex binary expressions on the RHS of a comma.

Specifically, if the RHS of a comma is a complex binary expression and
spans multiple lines, insert a line break before it. This usually is
often more readable compared to producing a hanging indent. See changes
in FormatTest.cpp for examples.

llvm-svn: 288120

show more ...


# 35e4122f 29-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix unnnecessary line break.

Before:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa,
aaaaa);

After:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa, aaaaa);

llvm-svn:

clang-format: Fix unnnecessary line break.

Before:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa,
aaaaa);

After:
aaaaaaaaaa(aaaa(aaaa,
aaaa), //
aaaa, aaaaa);

llvm-svn: 288119

show more ...


# 1991e5d6 15-Nov-2016 Cameron Desrochers <cameron@moodycamel.com>

[clang-format] Fixed line merging of more than two lines

Differential Revision: https://reviews.llvm.org/D19063

llvm-svn: 286973


# fd36f0b5 12-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Support ObjC selectors with unnamed parameters.

This fixes llvm.org/PR28063.

llvm-svn: 286715


# b2673a1e 10-Nov-2016 Nico Weber <nicolasweber@gmx.de>

[clang-format] Fix PR30527: Regression when clang-format insert spaces in [] when in template

Actual regression was introduced in r272668. This revision fixes JS script, but
also regress Cpp case. I

[clang-format] Fix PR30527: Regression when clang-format insert spaces in [] when in template

Actual regression was introduced in r272668. This revision fixes JS script, but
also regress Cpp case. It manifests with spaces added when template is followed
with array. Bug 30527 mentions case of array as a nested template type
(foo<bar<baz>[]>). Fix is to detect such case and to prevent treating it as
array initialization, but as a subscript case. However, before r272668, this
case was treated simple because we were detecting it as a StartsObjCMethodExpr.
Same was true for other similar case - array of templates (foo<int>[]). This
patch tries to address two problems: 1) fixing regression 2) making sure both
cases (array as a nested type, array of templates) which were entering
StartsObjCMethodExpr branch are handled now appropriately.

https://reviews.llvm.org/D26163
Patch from Branko Kokanovic <branko@kokanovic.org>!

llvm-svn: 286507

show more ...


# a432208b 05-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Better support for CUDA's triple brackets.

Before:
aaaaaaaaaaaaaaa<
aaaaaaaaa, aaaaaaaaaa,
aaaaaaaaaaaaaa><<<aaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaaaaaaaaa>>>();

After:
aaa

clang-format: Better support for CUDA's triple brackets.

Before:
aaaaaaaaaaaaaaa<
aaaaaaaaa, aaaaaaaaaa,
aaaaaaaaaaaaaa><<<aaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaaaaaaaaa>>>();

After:
aaaaaaaaaaaaaaa<aaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaaaaa>
<<<aaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaaaaaaaaa>>>();

llvm-svn: 286041

show more ...


# 6af3f14e 03-Nov-2016 Malcolm Parsons <malcolm.parsons@gmail.com>

Fixed column shift when formatting line containing bit shift operators

Summary:
During clang-format source lexing >> and << operators are split and
treated as two less/greater operators but column p

Fixed column shift when formatting line containing bit shift operators

Summary:
During clang-format source lexing >> and << operators are split and
treated as two less/greater operators but column position of following
tokens was not adjusted accordingly.

Fixes PR26887

Patch by Paweł Żukowski.

Reviewers: djasper

Subscribers: malcolm.parsons, mprobst, klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D25439

llvm-svn: 285934

show more ...


# 28b4d513 01-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix bug in function reference qualifier detection.

Before:
template <typename T>
void F(T) &&
= delete;

After:
template <typename T>
void F(T) && = delete;

llvm-svn

clang-format: Fix bug in function reference qualifier detection.

Before:
template <typename T>
void F(T) &&
= delete;

After:
template <typename T>
void F(T) && = delete;

llvm-svn: 285674

show more ...


# d0d27aa5 01-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect pointer detection.

Before:
void f() { f(float{1}, a *a); }

After:
void f() { f(float{1}, a * a); }

llvm-svn: 285673


# 3ade3be2 01-Nov-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect binary operator detection.

Before:
int x = f(* + [] {});

After:
int x = f(*+[] {});

llvm-svn: 285671


# fda47cd8 31-Oct-2016 Daniel Jasper <djasper@google.com>

Skip over AnnotatedLines with >50 levels of nesting; don't format them.

Reasoning:
- ExpressionParser uses a lot of stack for these, bad in some environments.
- Our formatting algorithm is N^3 and g

Skip over AnnotatedLines with >50 levels of nesting; don't format them.

Reasoning:
- ExpressionParser uses a lot of stack for these, bad in some environments.
- Our formatting algorithm is N^3 and gets really slow.
- The resulting formatting is unlikely to be any good.
- This is probably generated code we're formatting by accident.

We treat these as unparseable, and signal incomplete formatting. 50 is
an arbitrary number, I've only seen real problems from ~150 levels.

Patch by Sam McCall. Thank you.

llvm-svn: 285570

show more ...


# a9a8fdee 26-Oct-2016 Andi-Bogdan Postelnicu <andi@mozilla.com>

Bug 28065 - clang-format incorrectly aligns backslash.

llvm-svn: 285178


# 85d1f0b6 04-Oct-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix bad multi-variable for-loop formatting.

Before:
for (int*p, *q; p != q; p = p->next) {

After:
for (int *p, *q; p != q; p = p->next) {

llvm-svn: 283246


# e31388ae 26-Sep-2016 Daniel Jasper <djasper@google.com>

[clang-format] Don't allow newline after uppercase Obj-C block return types

Fixes the following:
BOOL (^aaa)(void) = ^BOOL {
};

The first BOOL's token was getting set to TT_FunctionAnnotationRP

[clang-format] Don't allow newline after uppercase Obj-C block return types

Fixes the following:
BOOL (^aaa)(void) = ^BOOL {
};

The first BOOL's token was getting set to TT_FunctionAnnotationRParen
incorrectly, which was causing an unexpected newline after (^aaa). This
was introduced in r245846.

Patch by Kent Sutherland, thank you!

llvm-svn: 282448

show more ...


# 3f2cde91 26-Sep-2016 Daniel Jasper <djasper@google.com>

clang-format: Only special-case top-level */& in multivar-declstmts.

Before (even with PointerAlignment: Left):
vector<int *> a, b;

After:
vector<int*> a, b;

llvm-svn: 282410


Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2
# 83bbd573 09-Aug-2016 Sylvestre Ledru <sylvestre@debian.org>

clang-format: Add SpaceAfterTemplate

Summary:
This is required for compliance with the Mozilla style guide.

This is a rebase+minor change of Birunthan Mohanathas's patch


Reviewers: djasper

Subsc

clang-format: Add SpaceAfterTemplate

Summary:
This is required for compliance with the Mozilla style guide.

This is a rebase+minor change of Birunthan Mohanathas's patch


Reviewers: djasper

Subscribers: klimek, cfe-commits, opilarium

Differential Revision: https://reviews.llvm.org/D23317

llvm-svn: 278121

show more ...


# 40ef2fb3 01-Aug-2016 Eric Liu <ioeric@google.com>

Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
control how replacements for a single file are combined and provid

Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
control how replacements for a single file are combined and provide guarantee
on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
Use std::map<std::string, tooling::Replacements> to represent multi-file
replacements.
- Error handling for the interface change will be improved in followup patches.

Reviewers: djasper, klimek

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D21748

llvm-svn: 277335

show more ...


Revision tags: llvmorg-3.9.0-rc1
# 31343832 27-Jul-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect detection of QT-signals access specifier.

Before:
void f() {
label:
signals
.baz();
}

After:
void f() {
label:
signals.baz();
}

llvm-svn: 276854


# 4f8d9943 11-Jul-2016 Eric Liu <ioeric@google.com>

Make tooling::applyAllReplacements return llvm::Expected<string> instead of empty string to indicate potential error.

Summary:
return llvm::Expected<> to carry error status and error information.
Th

Make tooling::applyAllReplacements return llvm::Expected<string> instead of empty string to indicate potential error.

Summary:
return llvm::Expected<> to carry error status and error information.
This is the first step towards introducing "Error" into tooling::Replacements.

Reviewers: djasper, klimek

Subscribers: ioeric, klimek, cfe-commits

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

llvm-svn: 275062

show more ...


# 1f5d6371 13-Jun-2016 Daniel Jasper <djasper@google.com>

clang-format: Restrict r272537 to function ref qualifiers.

Seems this isn't generally desirable.

Before:
int const * a;

After:
int const* a;

llvm-svn: 272548


# 21561669 13-Jun-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect function type detection.

Before:
returnsFunction (&param1, &param2)(param);

After:
returnsFunction(&param1, &param2)(param);

llvm-svn: 272538


# 43e4d3a0 13-Jun-2016 Daniel Jasper <djasper@google.com>

clang-format: Don't merge const and &, e.g. in function ref qualifiers.

Before (when aligning & to the right):
SomeType MemberFunction(const Deleted &) const&;

After:
SomeType MemberFunction(co

clang-format: Don't merge const and &, e.g. in function ref qualifiers.

Before (when aligning & to the right):
SomeType MemberFunction(const Deleted &) const&;

After:
SomeType MemberFunction(const Deleted &) const &;

This also applies to variable declarations, e.g.:
int const * a;

However, this form is very uncommon (most people would write
"const int* a" instead) and contracting to "const*" might actually send
the wrong signal of what the const binds to.

llvm-svn: 272537

show more ...


# 594be2f0 13-Jun-2016 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect cast detection.

Before:
auto s = sizeof...(Ts)-1;

After:
auto s = sizeof...(Ts) - 1;

llvm-svn: 272536


# 87448c55 13-Jun-2016 Daniel Jasper <djasper@google.com>

clang-format: Don't indent lambda body relative to its return type.

Before:
[]() //
-> int {
return 1; //
};

After:
[]() //
-> int {
return 1; //
};

llvm-sv

clang-format: Don't indent lambda body relative to its return type.

Before:
[]() //
-> int {
return 1; //
};

After:
[]() //
-> int {
return 1; //
};

llvm-svn: 272535

show more ...


1...<<31323334353637383940>>...82