History log of /llvm-project/clang/lib/Format/Format.cpp (Results 526 – 550 of 1154)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.7.1-rc1
# da446770 16-Nov-2015 Daniel Jasper <djasper@google.com>

clang-format: Enable #include sorting by default.

This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command lin

clang-format: Enable #include sorting by default.

This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command line flag can from now on be used to override whatever is set
in the style.

llvm-svn: 253202

show more ...


# 49dbbdb3 04-Nov-2015 Daniel Jasper <djasper@google.com>

clang-format: Turn on wrapping before "else" for WebKit style.

llvm-svn: 252089


# 6501f7e8 27-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.

Summary:
If this option is set, clang-format will always insert a line wrap, e.g.
before the first parameter of a functio

clang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.

Summary:
If this option is set, clang-format will always insert a line wrap, e.g.
before the first parameter of a function call unless all parameters fit
on the same line. This obviates the need to make a decision on the
alignment itself.

Use this style for Google's JavaScript style and add some minor tweaks
to correctly handle nested blocks etc. with it. Don't use this option
for for/while loops.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 251405

show more ...


# ff06370e 21-Oct-2015 Nico Weber <nicolasweber@gmx.de>

clang-format: Teach --sort-includes to interleave #include and #import.

clang accepts both #include and #import for includes (the latter having an
implicit header guard). Let clang-format interleav

clang-format: Teach --sort-includes to interleave #include and #import.

clang accepts both #include and #import for includes (the latter having an
implicit header guard). Let clang-format interleave both types if
--sort-includes is passed. #import is used frequently in Objective-C code.

http://reviews.llvm.org/D13853

llvm-svn: 250909

show more ...


# afa62fae 19-Oct-2015 Nico Weber <nicolasweber@gmx.de>

clang-format: Extend main header include sorting heuristic to Objective-C files.

llvm-svn: 250675


# 265309e3 18-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Handle string literals spanning character classes.

If a RegExp contains a character group with a quote (/["]/), the
trailing end of it is first tokenized as a string literal, whic

clang-format: [JS] Handle string literals spanning character classes.

If a RegExp contains a character group with a quote (/["]/), the
trailing end of it is first tokenized as a string literal, which leads
to the merging code seeing an unbalanced bracket.

This change parses regex literals from the left hand side. That
simplifies the parsing code and also allows correctly handling escapes
and character classes, hopefully correctly parsing all regex literals.

Patch by Martin Probst, thank you.
Review: http://reviews.llvm.org/D13765

llvm-svn: 250648

show more ...


# 2cd92f1c 15-Oct-2015 Nico Weber <nicolasweber@gmx.de>

clang-format/java: Break after annotations on fields in Chromium style.

Chromium follows the Android style guide for Java code, and that doesn't make
the distinction between fields and non-fields th

clang-format/java: Break after annotations on fields in Chromium style.

Chromium follows the Android style guide for Java code, and that doesn't make
the distinction between fields and non-fields that the Google Java style guide
makes:

https://source.android.com/source/code-style.html#use-standard-java-annotations
https://google.github.io/styleguide/javaguide.html#s4.8.5-annotations

llvm-svn: 250422

show more ...


# 8d0e2234 12-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] handle character classes in regexes.

Slashes in regular expressions do not need to be escaped and do not
terminate the regular expression even without a preceding backslash.

Patc

clang-format: [JS] handle character classes in regexes.

Slashes in regular expressions do not need to be escaped and do not
terminate the regular expression even without a preceding backslash.

Patch by Martin Probst. Thank you.

llvm-svn: 250009

show more ...


# 55bbe664 07-Oct-2015 Daniel Jasper <djasper@google.com>

Make clang-format actually respect custom brace wrapping flags.

This fixes llvm.org/PR25073.

llvm-svn: 249519


# 8ce1b8df 06-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Make IncludeCategories configurable in .clang-format file.

This was made much easier by introducing an IncludeCategory struct to
replace the previously used std::pair.

Also, cleaned u

clang-format: Make IncludeCategories configurable in .clang-format file.

This was made much easier by introducing an IncludeCategory struct to
replace the previously used std::pair.

Also, cleaned up documentation and added examples.

llvm-svn: 249392

show more ...


# 2e2351ad 06-Oct-2015 Benjamin Kramer <benny.kra@googlemail.com>

[VFS] Transition clang-format to use an in-memory FS.

Apart from being cleaner this also means that clang-format no longer has
access to the host file system. This isn't necessary because clang-form

[VFS] Transition clang-format to use an in-memory FS.

Apart from being cleaner this also means that clang-format no longer has
access to the host file system. This isn't necessary because clang-format
never reads includes :)

Includes minor tweaks and bugfixes found in the VFS implementation while
running clang-format tests.

llvm-svn: 249385

show more ...


# d170c4b5 04-Oct-2015 Saleem Abdulrasool <compnerd@compnerd.org>

Add -f[no-]declspec to control recognition of __declspec as a keyword

In versions of clang prior to r238238, __declspec was recognized as a keyword in
all modes. It was then changed to only be enab

Add -f[no-]declspec to control recognition of __declspec as a keyword

In versions of clang prior to r238238, __declspec was recognized as a keyword in
all modes. It was then changed to only be enabled when Microsoft or Borland
extensions were enabled (and for CUDA, as a temporary measure). There is a
desire to support __declspec in Playstation code, and possibly other
environments. This commit adds a command-line switch to allow explicit
enabling/disabling of the recognition of __declspec as a keyword. Recognition
is enabled by default in Microsoft, Borland, CUDA, and PS4 environments, and
disabled in all other environments.

Patch by Warren Ristow!

llvm-svn: 249279

show more ...


# e12597cc 01-Oct-2015 Daniel Jasper <djasper@google.com>

[clang-format] Add support of consecutive declarations alignment

This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code

[clang-format] Add support of consecutive declarations alignment

This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code
in the same way the alignment of assignations is.

The code is a slightly modified version of the consecutive assignment
alignment code. Currently only the identifiers are aligned, and there is
no support of alignment of the pointer star or reference symbol.

The patch also solve the issue of alignments not being possible due to
the ColumnLimit for both the existing AlignConsecutiveAligments and the
new AlignConsecutiveDeclarations.

Patch by Beren Minor, thank you.

Review: http://reviews.llvm.org/D12362
llvm-svn: 248999

show more ...


# c1bc38ed 29-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Add a new brace style "custom" as well as flags to
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expande

clang-format: Add a new brace style "custom" as well as flags to
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expanded upon
calling the reformat function.

All presets have been chose to keep the existing formatting, so there
shouldn't be any difference in formatting behavior.

Also change the dump_format_style.py to properly document the nested
structs that are used to keep these flags discoverable among all the
configuration flags.

llvm-svn: 248802

show more ...


# 85c472dc 29-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Extend #include sorting functionality

Recognize the main module header as well as different #include categories.
This should now mimic the behavior of llvm/utils/sort_includes.py as
we

clang-format: Extend #include sorting functionality

Recognize the main module header as well as different #include categories.
This should now mimic the behavior of llvm/utils/sort_includes.py as
well as clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp very
closely.

llvm-svn: 248782

show more ...


# d89ae9d3 23-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Add initial #include sorting capabilities.

To implement this nicely, add a function that merges two sets of
replacements that are meant to be done in sequence. This functionality
will

clang-format: Add initial #include sorting capabilities.

To implement this nicely, add a function that merges two sets of
replacements that are meant to be done in sequence. This functionality
will also be useful for other applications, e.g. formatting the result
of clang-tidy fixes.

llvm-svn: 248367

show more ...


# d1a9125c 21-Sep-2015 Nico Weber <nicolasweber@gmx.de>

clang-format: Remove ChromiumStyle.MacroBlockBegin.

We prefer setting these in our .clang-format file as the macros change over
time. (Also, the code was setting MacroBlockBegin twice and didn't se

clang-format: Remove ChromiumStyle.MacroBlockBegin.

We prefer setting these in our .clang-format file as the macros change over
time. (Also, the code was setting MacroBlockBegin twice and didn't set
MacroBlockEnd, so it wasn't doing what it tried to do anyways.)

llvm-svn: 248205

show more ...


Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4
# 291f64fd 10-Aug-2015 Roman Kashitsyn <romankashicin@gmail.com>

Add WebKit brace style configuration option.

Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:

* Function definitions: place each brace on its ow

Add WebKit brace style configuration option.

Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:

* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.

Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.

Reviewers: djasper, klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 244446

show more ...


Revision tags: llvmorg-3.7.0-rc2
# 352f0df4 18-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Take nested lines into account when detection C++03
compatibility and variable alignment.

llvm-svn: 242611


Revision tags: llvmorg-3.7.0-rc1
# 305fa9c2 12-Jul-2015 Birunthan Mohanathas <birunthan@mohanathas.com>

clang-format: Add Mozilla brace breaking style

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

llvm-svn: 241986


# b001a0ba 03-Jul-2015 Birunthan Mohanathas <birunthan@mohanathas.com>

clang-format: Add MacroBlock{Begin,End} options

The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.

Mozilla

clang-format: Add MacroBlock{Begin,End} options

The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.

Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:

MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END

Now, using the options

MacroBlockBegin: "^[A-Z_]+_BEGIN$"
MacroBlockEnd: "^[A-Z_]+_END$"

will yield the expected result:

MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END

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

llvm-svn: 241363

show more ...


# f144620c 02-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Treat regex literals like string literals.

Using the token type "unknown" can interfere badly with
WhitespaceManager's way of handling multiline comments.

llvm-svn: 241273


# f7372152 02-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Skip comments when applying the regex-literal heuristic

llvm-svn: 241264


# 55c384e0 02-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Fix bug in regex literal parsing.

The lexer wasn't properly reset leading to unexpected deletions.

llvm-svn: 241262


# c553ae13 02-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: [JS] Support regex literals at the start of a file.

llvm-svn: 241259


1...<<21222324252627282930>>...47