History log of /llvm-project/clang/lib/Format/Format.cpp (Results 426 – 450 of 1154)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1dbc2105 31-Mar-2017 Daniel Jasper <djasper@google.com>

clang-format: Fix post-commit review comment of r299204, use Style.isCpp().

Also, while at it, s/IsCpp/isCpp/ so that it follows LLVM style.

llvm-svn: 299214


# b4cdb65e 13-Mar-2017 Martin Probst <martin@probst.io>

clang-format: [JS] do not wrap @see tags.

Summary:
@see is special among JSDoc tags in that it is commonly followed by URLs. The JSDoc spec suggests that users should wrap URLs in an additional {@li

clang-format: [JS] do not wrap @see tags.

Summary:
@see is special among JSDoc tags in that it is commonly followed by URLs. The JSDoc spec suggests that users should wrap URLs in an additional {@link url...} tag (@see http://usejsdoc.org/tags-see.html), but this is very commonly violated, with @see being followed by a "naked" URL.

This change special cases all JSDoc lines that contain an @see not to be wrapped to account for that.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 297607

show more ...


# 0ef8ee19 10-Mar-2017 Andi-Bogdan Postelnicu <andi@mozilla.com>

[clang-format] Add option to break before inheritance separation operator in class declaration.

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

llvm-svn: 297467


# 317c539e 08-Mar-2017 Krasimir Georgiev <krasimir@google.com>

[clang-format] Fixed a typo in Format.cpp and a clang-tidy nit about std::function copying; NFC

llvm-svn: 297265


Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3
# 3ffedcdf 02-Mar-2017 Nico Weber <nicolasweber@gmx.de>

Don't write to LLVMStyle.JavaScriptQuotes twice. No behavior change.

llvm-svn: 296749


# 32eaa864 01-Mar-2017 Krasimir Georgiev <krasimir@google.com>

[clang-format] Add a new flag FixNamespaceComments to FormatStyle

Summary:
This patch enables namespace end comments under a new flag FixNamespaceComments,
which is enabled for the LLVM and Google s

[clang-format] Add a new flag FixNamespaceComments to FormatStyle

Summary:
This patch enables namespace end comments under a new flag FixNamespaceComments,
which is enabled for the LLVM and Google styles.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 296632

show more ...


# bb46a7dd 28-Feb-2017 Martin Probst <martin@probst.io>

Blacklist arbitrary @\\w+ JSDoc tags from wrapping.

Summary:
Also limits the blacklisting to only apply when the tag is actually
followed by a parameter in curly braces.

/** @mods {long.type.mu

Blacklist arbitrary @\\w+ JSDoc tags from wrapping.

Summary:
Also limits the blacklisting to only apply when the tag is actually
followed by a parameter in curly braces.

/** @mods {long.type.must.not.wrap} */

vs

/** @const this is a long description that may wrap. */

Reviewers: djasper

Subscribers: klimek, krasimir, cfe-commits

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

llvm-svn: 296467

show more ...


# 7cb267af 27-Feb-2017 Krasimir Georgiev <krasimir@google.com>

[clang-format] Add a NamespaceEndCommentsFixer

Summary:
This patch adds a NamespaceEndCommentsFixer TokenAnalyzer for clang-format,
which fixes end namespace comments.
It currently supports insertin

[clang-format] Add a NamespaceEndCommentsFixer

Summary:
This patch adds a NamespaceEndCommentsFixer TokenAnalyzer for clang-format,
which fixes end namespace comments.
It currently supports inserting and updating existing wrong comments.

Example source:
```
namespace A {
int i;
}

namespace B {
int j;
} // namespace A
```

after formatting:
```
namespace A {
int i;
} // namespace A

namespace B {
int j;
} // namespace B
```

Reviewers: klimek, djasper

Reviewed By: djasper

Subscribers: klimek, mgorny

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

llvm-svn: 296341

show more ...


# 004d5245 24-Feb-2017 Nico Weber <nicolasweber@gmx.de>

clang-format: Enable include sorting for style=Chromium

llvm-svn: 296161


# d96ae867 24-Feb-2017 Nico Weber <nicolasweber@gmx.de>

clang-format: Fix many Objective-C formatting regressions from r289428

r289428 added a separate language kind for Objective-C, but kept many
"Language == LK_Cpp" checks untouched. This introduced a

clang-format: Fix many Objective-C formatting regressions from r289428

r289428 added a separate language kind for Objective-C, but kept many
"Language == LK_Cpp" checks untouched. This introduced a "IsCpp()"
method that returns true for both C++ and Objective-C++, and replaces
all comparisons of Language with LK_Cpp with calls to this new method.

Also add a lot more test coverge for formatting things in LK_ObjC mode,
by having FormatTest's verifyFormat() test for LK_ObjC everything that's
being tested for LK_Cpp at the moment.

Fixes PR32060 and many other things.

llvm-svn: 296160

show more ...


Revision tags: llvmorg-4.0.0-rc2
# 9e2bc306 31-Jan-2017 Nico Weber <nicolasweber@gmx.de>

Keep Chromium ObjC column limit at 80 for consistency with C++

https://reviews.llvm.org/D29337
Patch from Dan Beam <dbeam@chromium.org>!

llvm-svn: 293675


# fa37b18f 27-Jan-2017 Martin Probst <martin@probst.io>

clang-format: [JS] do not format MPEG transport streams.

Summary:
The MPEG transport stream file format also uses ".ts" as its file extension.
This change detects its specific framing format (0x47 e

clang-format: [JS] do not format MPEG transport streams.

Summary:
The MPEG transport stream file format also uses ".ts" as its file extension.
This change detects its specific framing format (0x47 every 189 bytes) and
simply ignores MPEG TS files.

Reviewers: djasper, sammccall

Subscribers: klimek, cfe-commits

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

llvm-svn: 293270

show more ...


# 7eb7507a 20-Jan-2017 Antonio Maiorano <amaiorano@gmail.com>

clang-format: fix fallback style set to "none" not always formatting

This fixes clang-format not formatting if fallback-style is explicitly set to
"none", and either a config file is found or YAML i

clang-format: fix fallback style set to "none" not always formatting

This fixes clang-format not formatting if fallback-style is explicitly set to
"none", and either a config file is found or YAML is passed in without a
"BasedOnStyle". With this change, passing "none" in these cases will have no
affect, and LLVM style will be used as the base style.

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

llvm-svn: 292562

show more ...


Revision tags: llvmorg-4.0.0-rc1
# 3adfb6a3 17-Jan-2017 Antonio Maiorano <amaiorano@gmail.com>

clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle

Change the contract of GetStyle so that it returns an error when an error occurs
(i.e. when it writes to stderr), and

clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle

Change the contract of GetStyle so that it returns an error when an error occurs
(i.e. when it writes to stderr), and only returns the fallback style when it
can't find a configuration file.

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

llvm-svn: 292174

show more ...


# ea649697 04-Jan-2017 Nico Weber <nicolasweber@gmx.de>

Change clang-format's Chromium JavaScript defaults

Chromium is starting to use clang-format on more JavaScript.

In doing this, we discovered that our defaults were not doing a good job
differentiat

Change clang-format's Chromium JavaScript defaults

Chromium is starting to use clang-format on more JavaScript.

In doing this, we discovered that our defaults were not doing a good job
differentiating between JS and C++.

This change moves some defaults to only apply to C++.
https://reviews.llvm.org/D28165

Patch from Dan Beam <dbeam@chromium.org>!

llvm-svn: 290930

show more ...


# 1ec383c7 23-Dec-2016 Piotr Padlewski <piotr.padlewski@gmail.com>

Use after move bug fixes

Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy.

Reviewers: rsmith, mboehme

Subscribers: cfe-commits, klimek

Differential Revision:

Use after move bug fixes

Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy.

Reviewers: rsmith, mboehme

Subscribers: cfe-commits, klimek

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

llvm-svn: 290424

show more ...


# 34c03764 22-Dec-2016 Antonio Maiorano <amaiorano@gmail.com>

Make FormatStyle.GetStyleOfFile test work on MSVC

Modify getStyle to use vfs::FileSystem::makeAbsolute just like FS.addFile does,
rather than sys::fs::make_absolute. The latter gets the CWD from the

Make FormatStyle.GetStyleOfFile test work on MSVC

Modify getStyle to use vfs::FileSystem::makeAbsolute just like FS.addFile does,
rather than sys::fs::make_absolute. The latter gets the CWD from the platform,
while the former expects it to be set by the client, causing a mismatch when
converting relative paths to absolute.

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

llvm-svn: 290319

show more ...


# 93459d31 19-Dec-2016 Eric Liu <ioeric@google.com>

[clang-format] revert an unintended change in r288493 and add a test case.

llvm-svn: 290093


# dcb038d4 14-Dec-2016 Sylvestre Ledru <sylvestre@debian.org>

Update the default of the Mozilla coding style

Summary:
I also proposed the change in Firefox .clang-format file:
https://bugzilla.mozilla.org/show_bug.cgi?id=1322321

Reviewers: klimek

Subscribers

Update the default of the Mozilla coding style

Summary:
I also proposed the change in Firefox .clang-format file:
https://bugzilla.mozilla.org/show_bug.cgi?id=1322321

Reviewers: klimek

Subscribers: cfe-commits

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

llvm-svn: 289660

show more ...


# 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 ...


# 21d10328 09-Dec-2016 Eric Liu <ioeric@google.com>

[clang-format] calculate MaxInsertOffset in the original code correctly.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 289203


Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3
# 964782ad 02-Dec-2016 Eric Liu <ioeric@google.com>

[ClangFormat] Only insert #include into the #include block in the beginning of the file.

Summary:
This avoid inserting #include into:
- raw string literals containing #include.
- #if block.
- Specia

[ClangFormat] Only insert #include into the #include block in the beginning of the file.

Summary:
This avoid inserting #include into:
- raw string literals containing #include.
- #if block.
- Special #include among declarations (e.g. functions).

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 288493

show more ...


Revision tags: llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1
# ebac56eb 24-Nov-2016 Benjamin Kramer <benny.kra@googlemail.com>

[Format] Avoid copying std::sets and simplify code a bit.

No functional change.

llvm-svn: 287892


# 528d682f 08-Nov-2016 Daniel Jasper <djasper@google.com>

[clang-format] Remove (SourceManager, FileID) variants

In Format, remove the reformat() and clean() functions taking a SourceManager
and a FileID. Keep the versions taking StringRef Code.

- there w

[clang-format] Remove (SourceManager, FileID) variants

In Format, remove the reformat() and clean() functions taking a SourceManager
and a FileID. Keep the versions taking StringRef Code.

- there was duplicated functionality
- the FileID versions were harder to use
- the clean() version is dead code anyways

Patch by Krasimir Georgiev. Thank you.

llvm-svn: 286243

show more ...


# 5d8cdb83 20-Oct-2016 Malcolm Parsons <malcolm.parsons@gmail.com>

[Format] Cleanup after replacing constructor body with = default

Summary:
Remove colon and commas after replacing constructor body with = default.
Fix annotation of TT_CtorInitializerColon when prec

[Format] Cleanup after replacing constructor body with = default

Summary:
Remove colon and commas after replacing constructor body with = default.
Fix annotation of TT_CtorInitializerColon when preceded by a comment.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 284732

show more ...


1...<<11121314151617181920>>...47