History log of /llvm-project/clang/lib/Format/Format.cpp (Results 1 – 25 of 1154)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# d50ebd47 28-Jan-2025 Gedare Bloom <gedare@rtems.org>

[clang-format] Add style option `PenaltyBreakBeforeMemberAccess` (#118409)

The penalty for breaking before a member access is hard-coded to 150.
Add a configuration option to allow setting it.

-

[clang-format] Add style option `PenaltyBreakBeforeMemberAccess` (#118409)

The penalty for breaking before a member access is hard-coded to 150.
Add a configuration option to allow setting it.

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>

show more ...


# 33656932 21-Jan-2025 Sirraide <aeternalmail@gmail.com>

[clang-format] Rename ExportBlockIndentation -> IndentExportBlock (#123493)

This renames the `ExportBlockIndentation` option and adds a config parse
test, as requested in #110381.


# 106c483a 18-Jan-2025 Sirraide <aeternalmail@gmail.com>

[clang-format] Improve brace wrapping and add an option to control indentation of `export { ... }` (#110381)

`export { ... }` blocks can get a bit long, so I thought it would make
sense to have an o

[clang-format] Improve brace wrapping and add an option to control indentation of `export { ... }` (#110381)

`export { ... }` blocks can get a bit long, so I thought it would make
sense to have an option that makes it so their contents are not indented
(basically the same argument as for namespaces).

This is based on the `NamespaceIndentation` option, except that there is
no option to control the behaviour of `export` blocks when nested because
nesting them doesn’t really make sense.

Additionally, brace wrapping of short `export { ... }` blocks is now controlled by the
`AllowShortBlocksOnASingleLine` option. There is no separate option just for `export`
blocks because you can just write e.g. `export int x;` instead of `export { int x; }`.

This closes #121723.

show more ...


Revision tags: llvmorg-19.1.7
# 04610b90 05-Jan-2025 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Replace SmallVectorImpl with ArrayRef (#121621)


# 1c997fef 03-Jan-2025 dmasloff <74042473+dmasloff@users.noreply.github.com>

[clang-format] Add option WrapNamespaceBodyWithNewlines (#106145)

It wraps the body of namespace with additional newlines, turning this code:
```
namespace N {
int function();
}
```
into the f

[clang-format] Add option WrapNamespaceBodyWithNewlines (#106145)

It wraps the body of namespace with additional newlines, turning this code:
```
namespace N {
int function();
}
```
into the following:
```
namespace N {

int function();

}
```

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>

show more ...


# 1a0d0ae2 02-Jan-2025 Owen Pan <owenpiano@gmail.com>

[clang-format] Add `VariableTemplates` option (#121318)

Closes #120148.


# 486ec4bd 30-Dec-2024 Galen Elias <gelias@gmail.com>

[clang-format] Add `AllowShortNamespacesOnASingleLine` option (#105597)

This fixes #101363 which is a resurrection of a previously opened but
never completed review: https://reviews.llvm.org/D11851

[clang-format] Add `AllowShortNamespacesOnASingleLine` option (#105597)

This fixes #101363 which is a resurrection of a previously opened but
never completed review: https://reviews.llvm.org/D11851

The feature is to allow code like the following not to be broken across
multiple lines:

```
namespace foo { class bar; }
namespace foo { namespace bar { class baz; } }
```

Code like this is commonly used for forward declarations, which are
ideally kept compact. This is also apparently the format that
include-what-you-use will insert for forward declarations.

Also, fix an off-by-one error in `CompactNamespaces` code. For nested
namespaces with 3 or more namespaces, it was incorrectly compacting
lines which were 1 or two spaces over the `ColumnLimit`, leading to
incorrect formatting results.

show more ...


# 141c544c 25-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Skip line splices when sorting C++ includes (#120680)

Fixes #109864.


Revision tags: llvmorg-19.1.6
# 56ab56c8 03-Dec-2024 Jim B <d3x0r@users.noreply.github.com>

[clang-format] Add support for `.cjs` as JavaScript file extension (#118188)

Node uses `.cjs` as an extension for 'common javascript' modules.


Revision tags: llvmorg-19.1.5
# 6e57186c 26-Nov-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Clean up RemoveBraces, RemoveSemi, etc.


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3
# 786db636 24-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Add KeepFormFeed option (#113268)

Closes #113170.


# b69ac31a 23-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Use RemoveEmptyLinesInUnwrappedLines in clang-format s… (#113260)

…tyle


# d989c241 18-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Add RemoveEmptyLinesInUnwrappedLines option (#112325)

Fixes #111340.


Revision tags: llvmorg-19.1.2
# 0fba8381 12-Oct-2024 Iuri Chaer <ichaer@splunk.com>

[clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (#96804)

* Convert `ReflowComments` from boolean into a new `enum` wh

[clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (#96804)

* Convert `ReflowComments` from boolean into a new `enum` which can take
on the value `RCS_Never`, `RCS_IndentOnly`, or `RCS_Always`. The first
one is equivalent to the old `false`, the third one is `true`, and the
middle one means that multiline comments should only have their
indentation corrected, which is what Doxygen users will want.
* Preserve backward compatibility while parsing `ReflowComments`.

show more ...


# 65688274 08-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Clean up AlignConsecutiveStyle (#111285)

- Add a `CHECK_PARSE` for `AcrossComments`.
- Add a `CHECK_PARSE_NESTED_BOOL` for `AlignFunctionPointers`.
- Remove redundant statement

[clang-format][NFC] Clean up AlignConsecutiveStyle (#111285)

- Add a `CHECK_PARSE` for `AcrossComments`.
- Add a `CHECK_PARSE_NESTED_BOOL` for `AlignFunctionPointers`.
- Remove redundant statements.
- Clean up documentation.

show more ...


# f0bd62d8 07-Oct-2024 Brad House <brad@brad-house.com>

[clang-format] Add AlignFunctionDeclarations to AlignConsecutiveDeclarations (#108241)

Enabling AlignConsecutiveDeclarations also aligns function prototypes
or declarations. This is often unexpect

[clang-format] Add AlignFunctionDeclarations to AlignConsecutiveDeclarations (#108241)

Enabling AlignConsecutiveDeclarations also aligns function prototypes
or declarations. This is often unexpected as typically function
prototypes, especially in public headers, don't use any padding.

Setting AlignFunctionDeclarations to false will skip this alignment.
It is by default set to true to keep compatibility with prior
versions to not make unexpected changes.

Fixes #74320

show more ...


# 688bc958 03-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Add TemplateNames option to help parse C++ angles (#109916)

Closes #109912.


Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 7c3237d7 23-Aug-2024 Tom <pottagetom@gmail.com>

[clang-format] Change BinPackParameters to enum and add AlwaysOnePerLine (#101882)

Related issues that have requested this feature:
#51833
#23796
#53190 Partially solves - this issue requests is

[clang-format] Change BinPackParameters to enum and add AlwaysOnePerLine (#101882)

Related issues that have requested this feature:
#51833
#23796
#53190 Partially solves - this issue requests is for both arguments and
parameters

show more ...


Revision tags: llvmorg-19.1.0-rc3
# 3496245e 18-Aug-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Change GNU style language standard to LS_Latest (#104669)

Fixes #104655.


# 4cf9a426 17-Aug-2024 Nathan Sidwell <nathan@acm.org>

[clang-format] Adjust requires clause wrapping (#101550) (#102078)

Address #101550 by adding OwnLineWithBrace option for RequiresClausePosition. This permits placing a following '{' on the same line

[clang-format] Adjust requires clause wrapping (#101550) (#102078)

Address #101550 by adding OwnLineWithBrace option for RequiresClausePosition. This permits placing a following '{' on the same line as the requires clause.

Thus, instead of:
```
bool Foo ()
requires(true)
{
return true;
}
```

we have:
```
bool Foo ()
requires(true) {
return true;
}
```

If the function body is empty, we'll get:
```
bool Foo ()
requires(true) {}
```

I attempted to get a line break between the open and close braces, but
failed. Perhaps that's fine -- it's rare and only happens in the empty
body case.

show more ...


# c5a4291f 10-Aug-2024 Ameer J <52414509+ameerj@users.noreply.github.com>

[clang-format] Add BreakBinaryOperations configuration (#95013)

By default, clang-format packs binary operations, but it may be
desirable to have compound operations be on individual lines instead

[clang-format] Add BreakBinaryOperations configuration (#95013)

By default, clang-format packs binary operations, but it may be
desirable to have compound operations be on individual lines instead of
being packed.

This PR adds the option `BreakBinaryOperations` to break up large
compound binary operations to be on one line each.

This applies to all logical and arithmetic/bitwise binary operations

Maybe partially addresses #79487 ?
Closes #58014
Closes #57280

show more ...


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# ceade83a 05-Jul-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Skip block commented out includes when sorting them (#97787)

Fixes #97539.


# 54f040ff 02-Jul-2024 Gedare Bloom <gedare@rtems.org>

[clang-format] Add SpacesInParensOption for filtering repeated parens (#77522)

The __attribute((specifier-list)) currently is formatted based on the
SpacesInParensOptions.Other (previously, SpacesI

[clang-format] Add SpacesInParensOption for filtering repeated parens (#77522)

The __attribute((specifier-list)) currently is formatted based on the
SpacesInParensOptions.Other (previously, SpacesInParentheses). This
change allows finer control over addition of spaces between the
consecutive parens, and between the inner parens and the list of
attribute specifiers.

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

This is migrated from Phabricator, see more discussion there.

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>

show more ...


# 2853a838 30-Jun-2024 sstwcw <su3e8a96kzlver@posteo.net>

[clang-format] Add option to remove leading blank lines (#91221)

The options regarding which blank lines are kept are also aggregated.
The new option is `KeepEmptyLines`.

This patch was initially p

[clang-format] Add option to remove leading blank lines (#91221)

The options regarding which blank lines are kept are also aggregated.
The new option is `KeepEmptyLines`.

This patch was initially part of 9267f8f19a2e502e. I neglected to check
the server builds before I added it. It broke clangd. Jie Fu fixed the
problem in 4c91b49bab0728d4. I was unaware of it. I thought the main
branch was still broken. I reverted the first patch in
70cfece24d6cbb57. It broke his fix. He reverted it in
c69ea04fb9738db2. Now the feature is added again including the fix.

show more ...


# 70cfece2 25-Jun-2024 sstwcw <su3e8a96kzlver@posteo.net>

Revert "[clang-format] Add option to remove leading blank lines (#91221)"

This reverts commit 9267f8f19a2e502ef5a216c0d52b352b3699d399.

I changed a formatter option. I forgot to update other compo

Revert "[clang-format] Add option to remove leading blank lines (#91221)"

This reverts commit 9267f8f19a2e502ef5a216c0d52b352b3699d399.

I changed a formatter option. I forgot to update other components that
depend on the formatter when the option name changed.

show more ...


12345678910>>...47