History log of /llvm-project/clang/lib/Format/Format.cpp (Results 126 – 150 of 1154)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 0e89f1cc 14-Dec-2022 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Don't run any passes if Environment::make fails

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


# 7d3178d7 10-Dec-2022 Kazu Hirata <kazu@google.com>

[Format] Use std::optional in Format.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-

[Format] Use std::optional in Format.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# fc46d6e6 02-Dec-2022 David Goldman <davg@google.com>

[clang][Tooling] Add support for generating #import edits

And make use of this from clangd's CodeComplete and IncludeFixer, although currently they are both restricted only to #include symbols.

Dif

[clang][Tooling] Add support for generating #import edits

And make use of this from clangd's CodeComplete and IncludeFixer, although currently they are both restricted only to #include symbols.

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

show more ...


# 5891420e 03-Dec-2022 Kazu Hirata <kazu@google.com>

[clang] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of m

[clang] Use std::nullopt instead of None (NFC)

This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

show more ...


# 1a8dd742 30-Nov-2022 Sam McCall <sam.mccall@gmail.com>

[include-cleaner] clang-include-cleaner can print/apply edits

This adds command-line flags to the tool:
+ -print: prints changed source code
+ -print=changes: prints headers added/removed
+ -edit: r

[include-cleaner] clang-include-cleaner can print/apply edits

This adds command-line flags to the tool:
+ -print: prints changed source code
+ -print=changes: prints headers added/removed
+ -edit: rewrites code in place
+ -insert=0/-remove=0: disables additions/deletions for the above

These are supported by a couple of new functions dumped into Analysis:
analyze() sits on top of walkUsed and makes used/unused decisions for
Includes. fixIncludes() applies those results to source code.

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

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5
# 316e2599 10-Nov-2022 Björn Schäpers <bjoern@hazardy.de>

[clang-format][NFC] More sorting in getLLVMStyle()

Seems I've missed that.

Amends 41a09a07ce4ddd1e97ce0430d1debe1dcc853890


# f6b25297 10-Nov-2022 Anastasiia Lukianenko <vicooodin@gmail.com>

[clang-format] Add BreakBeforeInlineASMColon configuration

If true, colons in ASM parameters will be placed after line breaks.

true:
asm volatile("string",
:

[clang-format] Add BreakBeforeInlineASMColon configuration

If true, colons in ASM parameters will be placed after line breaks.

true:
asm volatile("string",
:
: val);

false:
asm volatile("string", : : val);

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

show more ...


# 41a09a07 04-Nov-2022 Björn Schäpers <bjoern@hazardy.de>

[clang-format][NFCish] Alphabetical sort Format.(h|pp)

I've:
- Sorted the members of FormatStyle alphabetical. The enums and structs
are kept close to the member.
- Sorted the yaml io functions, b

[clang-format][NFCish] Alphabetical sort Format.(h|pp)

I've:
- Sorted the members of FormatStyle alphabetical. The enums and structs
are kept close to the member.
- Sorted the yaml io functions, based on the type they operate on.
- Sorted the initializers in getLLVMStyle(), except that penalities are
kept at the end.
- Sorted the io of FormatStyle, this changes the --dump-config behavior.
- Moved the deprecated options into the only input case, this also
changes --dump-config, it does not put the not directly used options
in the .clang-format anymore.
- Sorted the comparisons in operator==.
- Added WhiteSpaceMacros in operator==, I've not actively looked if all
other members are compared.
- This showed flawed tests (or in my opinion a flawed io operation, but
that is another discussion and change).

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

show more ...


Revision tags: llvmorg-15.0.4
# 3edc1210 30-Oct-2022 Yusuke Kadowaki <yusuke.kadowaki.1231@gmail.com>

[clang-format] Adds a formatter for aligning trailing comments over empty lines

This patch addresses https://github.com/llvm/llvm-project/issues/19756

Reviewed By: MyDeveloperDay, HazardyKnusperkek

[clang-format] Adds a formatter for aligning trailing comments over empty lines

This patch addresses https://github.com/llvm/llvm-project/issues/19756

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

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

show more ...


# 37e754e5 23-Oct-2022 owenca <owenpiano@gmail.com>

[clang-format] Insert closing braces after an unaffected line

The token that records the number of closing braces to be inserted
may be on an unaffected line. Extra work is required in order to
actu

[clang-format] Insert closing braces after an unaffected line

The token that records the number of closing braces to be inserted
may be on an unaffected line. Extra work is required in order to
actually insert the closing braces after inserting the matching
opening braces of affected lines.

Fixes #58161.

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

show more ...


Revision tags: llvmorg-15.0.3, working, llvmorg-15.0.2
# 9c422ab7 29-Sep-2022 Danil Sidoruk <patriotrossii2019@mail.ru>

[clang-format] Add option for aligning requires clause body

Adds an option whether requires clause body should be aligned with
the `requires` keyword.
This option is now the default, both without co

[clang-format] Add option for aligning requires clause body

Adds an option whether requires clause body should be aligned with
the `requires` keyword.
This option is now the default, both without configuration and in LLVM
style.

Fixes https://github.com/llvm/llvm-project/issues/56283

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

Co-authored-by: Emilia Dreamer <emilia@rymiel.space>

show more ...


# 69e77276 09-Oct-2022 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] Add support to remove unnecessary semicolons after function definition

Fixes: https://github.com/llvm/llvm-project/issues/58217

This change is to remove extraneous and unnecessary ';

[clang-format] Add support to remove unnecessary semicolons after function definition

Fixes: https://github.com/llvm/llvm-project/issues/58217

This change is to remove extraneous and unnecessary ';' from after a function definition, its off by default and carries the same "code modification" warning as some of our other code manipulating changes.

Reviewed By: HazardyKnusperkeks, owenpan

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

show more ...


# 7cbc9206 29-Sep-2022 owenca <owenpiano@gmail.com>

[clang-format][NFC] Clean up class HeaderIncludes and Format.cpp

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


Revision tags: llvmorg-15.0.1
# 6257832b 19-Sep-2022 owenca <owenpiano@gmail.com>

[clang-format] Wrap inserted braces only if preceded by comments

Fixes #57805.

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


# 7349084e 18-Sep-2022 owenca <owenpiano@gmail.com>

[clang-format] Update removed brace's next token's WhitespaceRange

Fixes #57803.

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


# 95b39471 19-Sep-2022 mydeveloperday <mydeveloperday@gmail.com>

[clang-format] JSON formatting add new option for controlling newlines in json arrays

Working in a mixed environment of both vscode/vim with a team configured prettier configuration, this can leave

[clang-format] JSON formatting add new option for controlling newlines in json arrays

Working in a mixed environment of both vscode/vim with a team configured prettier configuration, this can leave clang-format and prettier fighting each other over the formatting of arrays, both simple arrays of elements.

This review aims to add some "control knobs" to the Json formatting in clang-format to help align the two tools so they can be used interchangeably.

This will allow simply arrays `[1, 2, 3]` to remain on a single line but will break those arrays based on context within that array.

Happy to change the name of the option (this is the third name I tried)

Reviewed By: HazardyKnusperkeks, owenpan

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

show more ...


# 93fcc80d 17-Sep-2022 owenca <owenpiano@gmail.com>

[clang-format] Skip token annotation in passes that don't need it

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


Revision tags: llvmorg-15.0.0
# b7a7aeee 04-Sep-2022 Kazu Hirata <kazu@google.com>

[clang] Qualify auto in range-based for loops (NFC)


# bc10ab8d 30-Aug-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix a bug in inserting braces at trailing comments

If the style wraps control statement braces, the opening braces
should be inserted after the trailing comments if present.

Fixes #5

[clang-format] Fix a bug in inserting braces at trailing comments

If the style wraps control statement braces, the opening braces
should be inserted after the trailing comments if present.

Fixes #57419.

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

show more ...


# 44a06b51 26-Aug-2022 owenca <owenpiano@gmail.com>

[clang-format] Rework removeBraces() in Format.cpp

Fixes #57373.

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


Revision tags: llvmorg-15.0.0-rc3
# 258531b7 21-Aug-2022 Kazu Hirata <kazu@google.com>

Remove redundant initialization of Optional (NFC)


Revision tags: llvmorg-15.0.0-rc2
# 16eaeade 30-Jul-2022 Kazu Hirata <kazu@google.com>

Use is_contained (NFC)


Revision tags: llvmorg-15.0.0-rc1
# c8871948 29-Jul-2022 sstwcw <f0gukp2nk@protonmail.com>

[clang-format] Handle Verilog case statements

These statements are like switch statements in C, but without the 'case'
keyword in labels.

How labels are parsed. In UnwrappedLineParser, the program

[clang-format] Handle Verilog case statements

These statements are like switch statements in C, but without the 'case'
keyword in labels.

How labels are parsed. In UnwrappedLineParser, the program tries to
parse a statement every time it sees a colon. In TokenAnnotator, a
colon that isn't part of an expression is annotated as a label.

The token type `TT_GotoLabelColon` is added. We did not include Verilog
in the name because we thought we would eventually have to fix the
problem that case labels in C can't contain ternary conditional
expressions and we would use that token type.

The style is like below. Labels are on separate lines and indented by
default. The linked style guide also has examples where labels and the
corresponding statements are on the same lines. They are not supported
for now.

https://github.com/lowRISC/style-guides/blob/master/VerilogCodingStyle.md

```
case (state_q)
StIdle:
state_d = StA;
StA: begin
state_d = StB;
end
endcase
```

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

show more ...


Revision tags: llvmorg-16-init
# 6ab73071 14-Jul-2022 owenca <owenpiano@gmail.com>

[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 <owenpiano@gmail.com>

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

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


12345678910>>...47