History log of /llvm-project-15.0.7/clang/lib/Format/Format.cpp (Results 1 – 25 of 1006)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 6ab73071 14-Jul-2022 owenca <[email protected]>

[clang-format] Fix invalid-code-generation by RemoveBracesLLVM

When removing an r_brace that is the first token of an annotated line, if the
line above ends with a line comment, clang-format generat

[clang-format] Fix invalid-code-generation by RemoveBracesLLVM

When removing an r_brace that is the first token of an annotated line, if the
line above ends with a line comment, clang-format generates invalid code by
merging the tokens after the r_brace into the line comment.

Fixes #56488.

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

show more ...


# 36229fa3 11-Jul-2022 owenca <[email protected]>

[clang-format][NFC] Replace most of std::vector with SmallVector

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


# b1f0efc0 01-Jul-2022 Nico Weber <[email protected]>

[clang-format] Tweak help text a bit

In particular, make it clear that `--style=file` is the default,
since there's some confusion about this, e.g. here:
https://stackoverflow.com/questions/61455148

[clang-format] Tweak help text a bit

In particular, make it clear that `--style=file` is the default,
since there's some confusion about this, e.g. here:
https://stackoverflow.com/questions/61455148/

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

show more ...


# 9ed2e68c 26-Jun-2022 sstwcw <[email protected]>

[clang-format] Parse Verilog if statements

This patch mainly handles treating `begin` as block openers.

While and for statements will be handled in another patch.

Reviewed By: HazardyKnusperkeks

[clang-format] Parse Verilog if statements

This patch mainly handles treating `begin` as block openers.

While and for statements will be handled in another patch.

Reviewed By: HazardyKnusperkeks

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

show more ...


Revision tags: llvmorg-14.0.6
# 07b3446d 13-Jun-2022 owenca <[email protected]>

[clang-format] Never analyze insert/remove braces in the same pass

Turn off RemoveBracesLLVM while analyzing InsertBraces and vice
versa to avoid potential interference of each other and better the

[clang-format] Never analyze insert/remove braces in the same pass

Turn off RemoveBracesLLVM while analyzing InsertBraces and vice
versa to avoid potential interference of each other and better the
performance.

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

show more ...


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4
# bebf7bdf 22-May-2022 owenca <[email protected]>

[clang-format][NFC] Insert/remove braces in clang/lib/Format/

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


# 6cd9633c 12-May-2022 owenca <[email protected]>

[clang-format] Handle comments below r_brace in RemoveBracesLLVM

If a closing brace is followed by a non-trailing comment, the
newline before the closing brace must also be removed.

Differential Re

[clang-format] Handle comments below r_brace in RemoveBracesLLVM

If a closing brace is followed by a non-trailing comment, the
newline before the closing brace must also be removed.

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

show more ...


Revision tags: llvmorg-14.0.3
# e8cc7490 28-Apr-2022 Krasimir Georgiev <[email protected]>

Revert "[clang-format] SortIncludes should support "@import" lines in Objective-C"

This reverts commit d46fa023caa2db5a9f1e21dd038bcb626261d958.
Regressed include order in some cases with trailing c

Revert "[clang-format] SortIncludes should support "@import" lines in Objective-C"

This reverts commit d46fa023caa2db5a9f1e21dd038bcb626261d958.
Regressed include order in some cases with trailing comments, see the
comments on https://reviews.llvm.org/D121370. Will add a regression test
in a follow-up commit.

show more ...


# db57acff 26-Apr-2022 owenca <[email protected]>

[clang-format] Adjust editor cursor position past #include blocks

Fixes #55027.

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


Revision tags: llvmorg-14.0.2, llvmorg-14.0.1
# d46fa023 11-Apr-2022 Konrad Kleine <[email protected]>

[clang-format] SortIncludes should support "@import" lines in Objective-C

Fixes [[ https://github.com/llvm/llvm-project/issues/38995 | #38995 ]]

This is an attempt to modify the regular expression

[clang-format] SortIncludes should support "@import" lines in Objective-C

Fixes [[ https://github.com/llvm/llvm-project/issues/38995 | #38995 ]]

This is an attempt to modify the regular expression to identify
`@import` and `import` alongside the regular `#include`. The challenging
part was not to support `@` in addition to `#` but how to handle
everything that comes after the `include|import` keywords. Previously
everything that wasn't `"` or `<` was consumed. But as you can see in
this example from the issue #38995, there is no `"` or `<` following the
keyword:

```
@import Foundation;
```

I experimented with a lot of fancy and useful expressions in [this
online regex tool](https://regex101.com) only to find out that some
things are simply not supported by the regex implementation in LLVM.

* For example the beginning `[\t\ ]*` should be replacable by the
horizontal whitespace character `\h*` but this will break the
`SortIncludesTest.LeadingWhitespace` test.

That's why I've chosen to come back to the basic building blocks.

The essential change in this patch is the change from this regular
expression:

```
^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][^">]*[">])
~ ~~~~~~~~~~~~~~
^ ^
| |
only support # prefix not @ |
only support "" and <> as
delimiters
no support for C++ modules and ;
ending. Also this allows for ">
or <" or "" or <> which all seems
either off or wrong.
```

to this:

```
^[\t\ ]*[@#][\t\ ]*(import|include)([^"]*("[^"]+")|[^<]*(<[^>]+>)|[\t\
]*([^;]+;))
~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
~~~~~~~~~~~~~~
^ ^ ^ ^ ^
| | | | |
Now support @ and #. Clearly support "" and <> as
well as an
include name without enclosing
characters.
Allows for no mixture of "> or
<" or
empty include names.

```

Here is how I've tested this patch:

```
ninja clang-Format
ninja FormatTests
./tools/clang/unittests/Format/FormatTests
--gtest_filter=SortIncludesTest*
```

And if that worked I doubled checked that nothing else broke by running
all format checks:

```
./tools/clang/unittests/Format/FormatTests
```

One side effect of this change is it should partially support
[C++20 Module](https://en.cppreference.com/w/cpp/language/modules)
`import` lines without the optional `export` in front. Adding
this can be a change on its own that shouldn't be too hard. I say
partially because the `@` or `#` are currently *NOT* optional in the
regular expression.

I see an opportunity to optimized the matching to exclude `@include` for
example. But eventually these should be caught by the compiler, so...

With my change, the matching group is not at a fixed position any
longer. I decided to
choose the last match (group) that is not empty.

Reviewed By: HazardyKnusperkeks

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

show more ...


# 0cb9c6ea 13-Apr-2022 owenca <[email protected]>

[clang-format] Allow empty .clang-format file

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


# 0cde8bdb 12-Apr-2022 owenca <[email protected]>

Revert "[clang-format] Allow empty .clang-format file"

This reverts commit 4e814a6f2db90046914734fac4f9e3110c7e0424.


# 4e814a6f 12-Apr-2022 owenca <[email protected]>

[clang-format] Allow empty .clang-format file

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


# c80eaa91 12-Apr-2022 owenca <[email protected]>

Revert "[clang-format] Allow empty .clang-format file"

This reverts commit 6eafda0ef0543cad4b190002e9dae93b036a4ded.


# 6eafda0e 11-Apr-2022 owenca <[email protected]>

[clang-format] Allow empty .clang-format file

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


Revision tags: llvmorg-14.0.0
# c24b3db4 14-Mar-2022 sstwcw <[email protected]>

[clang-format] Add option to align compound assignments like `+=`

Reviewed By: curdeius, HazardyKnusperkeks, MyDeveloperDay

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


Revision tags: llvmorg-14.0.0-rc4
# 9f616a46 11-Mar-2022 owenca <[email protected]>

[clang-format][NFC] Group QualifierAlignment with other C++ passes

Also increases the initial size of Passes to 8 and move the
definition of BracesInserter up.

Differential Revision: https://review

[clang-format][NFC] Group QualifierAlignment with other C++ passes

Also increases the initial size of Passes to 8 and move the
definition of BracesInserter up.

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

show more ...


# 0be56c87 10-Mar-2022 owenca <[email protected]>

[clang-format][NFC] Group all C++ passes under isCpp()

Also removes a not very helpful comment.


Revision tags: llvmorg-14.0.0-rc3
# e2b219bd 10-Mar-2022 owenca <[email protected]>

[clang-format] Handle "// clang-format off" for RemoveBracesLLVM

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


# e6a8b92b 07-Mar-2022 Nico Weber <[email protected]>

[clang-format] Fix namespace end comments in ObjC++ files too

See also d96ae867351ec.

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


# 1aa608a0 03-Mar-2022 owenca <[email protected]>

[clang-format] Handle wrapped else for RemoveBracesLLVM

Removes the newline before the right brace that's followed by an
else on the next line.

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

[clang-format] Handle wrapped else for RemoveBracesLLVM

Removes the newline before the right brace that's followed by an
else on the next line.

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

show more ...


Revision tags: llvmorg-14.0.0-rc2
# c05da55b 24-Feb-2022 owenca <[email protected]>

[clang-format] Handle trailing comment for InsertBraces

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


Revision tags: llvmorg-14.0.0-rc1
# 77e60bc4 08-Feb-2022 owenca <[email protected]>

[clang-format] Add option to insert braces after control statements

Adds a new option InsertBraces to insert the optional braces after
if, else, for, while, and do in C++.

Differential Revision: ht

[clang-format] Add option to insert braces after control statements

Adds a new option InsertBraces to insert the optional braces after
if, else, for, while, and do in C++.

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

show more ...


# aacc110b 21-Feb-2022 Krystian Kuzniarek <[email protected]>

[clang-format][NFC] Fix typos and inconsistencies

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


Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1
# b786a4ae 07-Nov-2021 Björn Schäpers <[email protected]>

[clang-format] Extend SpaceBeforeParens for requires

We can now configure the space between requires and the following paren,
seperate for clauses and expressions.

Differential Revision: https://re

[clang-format] Extend SpaceBeforeParens for requires

We can now configure the space between requires and the following paren,
seperate for clauses and expressions.

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

show more ...


12345678910>>...41