#
69209e30 |
| 25-Oct-2023 |
Backl1ght <backlight.zzk@gmail.com> |
[clang-format] AllowShortCompoundRequirementOnASingleLine
clang-format brace wrapping did not take requires into consideration, compound requirements will be affected by BraceWrapping.AfterFunction.
[clang-format] AllowShortCompoundRequirementOnASingleLine
clang-format brace wrapping did not take requires into consideration, compound requirements will be affected by BraceWrapping.AfterFunction.
Closes #59412.
Differential Revision: https://reviews.llvm.org/D139834
show more ...
|
#
0374bbba |
| 23-Oct-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format] Add a new style for the clang-format source code (#69814)
|
#
7c15dd60 |
| 20-Oct-2023 |
Omar Ahmed <omarpiratee2010@gmail.com> |
[clang-format] Add space in placement new expression
Add AfterPlacementNew option to SpaceBeforeParensOptions to have more control on placement new expressions.
Fixes #41501 Relates to #54703
Diff
[clang-format] Add space in placement new expression
Add AfterPlacementNew option to SpaceBeforeParensOptions to have more control on placement new expressions.
Fixes #41501 Relates to #54703
Differential Revision: https://reviews.llvm.org/D127270
show more ...
|
Revision tags: llvmorg-17.0.3 |
|
#
84cbd9f4 |
| 06-Oct-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format] Fix an error message
|
Revision tags: llvmorg-17.0.2 |
|
#
7db211bd |
| 25-Sep-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format][NFC] Remove the unused separateDefinitionBlocks()
Also, fixed a formatting error introduced in 84e3fdfc6523.
|
Revision tags: llvmorg-17.0.1, llvmorg-17.0.0 |
|
#
84e3fdfc |
| 09-Sep-2023 |
Björn Schäpers <bjoern@hazardy.de> |
[clang-format] BreakBeforeNoexceptSpecifier option added (#65808)
It really bugs me that it breaks to
``` c++
...) noexcept(
noexcept(condition)...
```
This is a fix for people like me.
|
Revision tags: llvmorg-17.0.0-rc4 |
|
#
91c4db00 |
| 24-Aug-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format][NFC] Replace !is() with isNot()
Differential Revision: https://reviews.llvm.org/D158571
|
Revision tags: llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1 |
|
#
f274ffc3 |
| 26-Jul-2023 |
Björn Schäpers <bjoern@hazardy.de> |
[clang-format][NFC] Resort IO Mapping
|
Revision tags: llvmorg-18-init |
|
#
c669541c |
| 25-Jul-2023 |
Gedare Bloom <gedare@rtems.org> |
[clang-format] Add SpacesInParens with SpacesInParensOptions
This is a refactoring of: - SpacesInConditionalStatement - SpacesInCStyleCastParentheses - SpaceInEmptyParentheses - SpacesInParentheses
[clang-format] Add SpacesInParens with SpacesInParensOptions
This is a refactoring of: - SpacesInConditionalStatement - SpacesInCStyleCastParentheses - SpaceInEmptyParentheses - SpacesInParentheses
These are now options under the new Style Option: SpacesInParens. The existing options are maintained for backward compatibility.
Within SpacesInParens, there are currently options for: - Never - Custom
The currently available options for Custom are: - InConditionalStatements - InCStyleCasts - InEmptyParentheses - Other
Setting InConditionalStatements and Other to true enables the same space additions as SpacesInParentheses.
This refactoring does not add or remove any existing features, but it makes it possible to more easily extend and maintain the addition of spaces within parentheses.
Related to #55428.
Differential Revision: https://reviews.llvm.org/D155239
show more ...
|
#
74720d1b |
| 25-Jul-2023 |
Galen Elias <galenelias@gmail.com> |
[clang-format] Add AlignConsecutiveShortCaseStatements
This adds a new AlignConsecutiveShortCaseStatements option in line with the existing AlignConsecutive* options , which when AllowShortCaseLabel
[clang-format] Add AlignConsecutiveShortCaseStatements
This adds a new AlignConsecutiveShortCaseStatements option in line with the existing AlignConsecutive* options , which when AllowShortCaseLabelsOnASingleLine is enabled will align the tokens after the case statement's colon. This also adds a AlignCaseColons option to allow aligning the case label colon itself rather than the token after it.
Fixes #55475.
Differential Revision: https://reviews.llvm.org/D151761
show more ...
|
#
87ad34ff |
| 25-Jul-2023 |
Owen Pan <owenpiano@gmail.com> |
Revert "[clang-format] Add AlignConsecutiveShortCaseStatements"
This reverts commit 4ba00844174db562d2bd8b15dab6aac605eddf57.
|
#
ac6e5514 |
| 25-Jul-2023 |
Owen Pan <owenpiano@gmail.com> |
Revert "Revert "[clang-format] Add AlignConsecutiveShortCaseStatements""
This reverts commit 4f093b31669a4f8e417259583141159586a05b28.
|
#
4f093b31 |
| 25-Jul-2023 |
Owen Pan <owenpiano@gmail.com> |
Revert "[clang-format] Add AlignConsecutiveShortCaseStatements"
This reverts commit 4ba00844174db562d2bd8b15dab6aac605eddf57 due to missing authorship.
|
#
4ba00844 |
| 25-Jul-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format] Add AlignConsecutiveShortCaseStatements
This adds a new AlignConsecutiveShortCaseStatements option in line with the existing AlignConsecutive* options , which when AllowShortCaseLabel
[clang-format] Add AlignConsecutiveShortCaseStatements
This adds a new AlignConsecutiveShortCaseStatements option in line with the existing AlignConsecutive* options , which when AllowShortCaseLabelsOnASingleLine is enabled will align the tokens after the case statement's colon. This also adds a AlignCaseColons option to allow aligning the case label colon itself rather than the token after it.
Fixes #55475.
Differential Revision: https://reviews.llvm.org/D151761
show more ...
|
#
5c106f7b |
| 14-Jul-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format] Add TypeNames option to disambiguate types/objects
If a non-keyword identifier is found in TypeNames, then a *, &, or && that follows it is annotated as TT_PointerOrReference.
Differ
[clang-format] Add TypeNames option to disambiguate types/objects
If a non-keyword identifier is found in TypeNames, then a *, &, or && that follows it is annotated as TT_PointerOrReference.
Differential Revision: https://reviews.llvm.org/D155273
show more ...
|
#
3a6a0702 |
| 05-Jul-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format] Add an option to remove redundant parentheses
Differential Revision: https://reviews.llvm.org/D154484
|
#
899c8677 |
| 03-Jul-2023 |
Sedenion <39583823+Sedeniono@users.noreply.github.com> |
[clang-format] Fixed bad performance with enabled qualifier fixer.
This fixes github issue #57117: If the "QualifierAlignment" option of clang-format is set to anything else but "Leave", the "Qualif
[clang-format] Fixed bad performance with enabled qualifier fixer.
This fixes github issue #57117: If the "QualifierAlignment" option of clang-format is set to anything else but "Leave", the "QualifierAlignmentFixer" pass gets enabled. This pass scales quadratically with the number of preprocessor branches, i.e. with the number of elements in TokenAnalyzer::UnwrappedLines. The reason is that QualifierAlignmentFixer::process() generates the UnwrappedLines, but then QualifierAlignmentFixer::analyze() calls LeftRightQualifierAlignmentFixer::process() several times (once for each qualifier) which again each time generates the UnwrappedLines.
This commit gets rid of this double loop by registering the individual LeftRightQualifierAlignmentFixer passes directly in the top most container of passes (local variable "Passes" in reformat()). With this change, the original example in the github issue #57117 now takes only around 3s instead of >300s to format.
Since QualifierAlignmentFixer::analyze() got deleted, we also no longer have the code with the NonNoOpFixes. This causes replacements that end up not changing anything to appear in the list of final replacements. There is a unit test to check that this does not happen: QualifierFixerTest.NoOpQualifierReplacements. However, it got broken at some point in time. So this commit fixes the test. To keep the behavior that no no-op replacements should appear from the qualifier fixer, the corresponding code from QualifierAlignmentFixer::analyze() was moved to the top reformat() function. Thus, is now done for **every** replacement of every formatting pass. If no-op replacements are a problem for the qualifier fixer, then it seems to be a good idea to filter them out always.
See https://github.com/llvm/llvm-project/issues/57117#issuecomment-1546716934 for some more details.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D153228
show more ...
|
#
829ed96b |
| 13-Jun-2023 |
Owen Pan <owenpiano@gmail.com> |
Reland [clang-format] Add the KeepEmptyLinesAtEOF option
|
Revision tags: llvmorg-16.0.6 |
|
#
b6a71801 |
| 08-Jun-2023 |
Paul Kirth <paulkirth@google.com> |
[clang-format] Add test case for issue 63170
After https://reviews.llvm.org/D151954 we've noticed some issues w/ clang-format behavior, as outlined in https://github.com/llvm/llvm-project/issues/631
[clang-format] Add test case for issue 63170
After https://reviews.llvm.org/D151954 we've noticed some issues w/ clang-format behavior, as outlined in https://github.com/llvm/llvm-project/issues/63170.
Valid C/C++ files, that were previously accepted, are now rejected by clang-format, emitting the message:
"The new replacement overlaps with an existing replacement."
This reverts commit 4b9764959dc4b8783e18747c1742ab164e4bc4ee and d2627cf88d2553a4c2e850430bdb908a4b7d2e52, which depends on it.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D152473
show more ...
|
#
d2627cf8 |
| 06-Jun-2023 |
Owen Pan <owenpiano@gmail.com> |
[clang-format] Add the KeepEmptyLinesAtEOF option
Adds an option KeepEmptyLinesAtEOF to keep empty lines (up to MaxEmptyLinesToKeep) before EOF. This remedies the probably unintentional change in be
[clang-format] Add the KeepEmptyLinesAtEOF option
Adds an option KeepEmptyLinesAtEOF to keep empty lines (up to MaxEmptyLinesToKeep) before EOF. This remedies the probably unintentional change in behavior introduced in 3d3ea84a4f8f, which started to always remove empty lines before EOF.
Fixes #56054. Fixes #63150.
Differential Revision: https://reviews.llvm.org/D152305
show more ...
|
#
24231df9 |
| 02-Jun-2023 |
sstwcw <su3e8a96kzlver@posteo.net> |
[clang-format] Parse the Verilog language option in configuration
Reviewed By: HazardyKnusperkeks, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D151632
|
Revision tags: llvmorg-16.0.5 |
|
#
85670ac8 |
| 26-May-2023 |
Ben Hamilton <benhamilton@google.com> |
[Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser
This adds to the ObjC language guesser a few more common macros used in ObjC headers. These can help dist
[Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser
This adds to the ObjC language guesser a few more common macros used in ObjC headers. These can help distinguish ObjC headers which otherwise lack ObjC types from C++ headers.
Contributed by danblakemore.
Tested: New tests included. Ran unit tests with: ``` % cmake -S llvm -B build -G Ninja && \ ninja -C build FormatTests && \ ./build/tools/clang/unittests/Format/FormatTests --gtest_filter="*FormatTestObjC*"
(snip) [----------] 24 tests from FormatTestObjC (265 ms total)
[----------] Global test environment tear-down [==========] 26 tests from 2 test suites ran. (270 ms total) [ PASSED ] 26 tests. ```
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D151578
show more ...
|
Revision tags: llvmorg-16.0.4 |
|
#
ed1539c6 |
| 16-May-2023 |
Kazu Hirata <kazu@google.com> |
Migrate {starts,ends}with_insensitive to {starts,ends}_with_insensitive (NFC)
This patch migrates uses of StringRef::{starts,ends}with_insensitive to StringRef::{starts,ends}_with_insensitive so tha
Migrate {starts,ends}with_insensitive to {starts,ends}_with_insensitive (NFC)
This patch migrates uses of StringRef::{starts,ends}with_insensitive to StringRef::{starts,ends}_with_insensitive so that we can use names similar to those used in std::string_view.
Note that the llvm/ directory has migrated in commit 6c3ea866e93003e16fc55d3b5cedd3bc371d1fde.
I'll post a separate patch to deprecate StringRef::{starts,ends}with_insensitive.
Differential Revision: https://reviews.llvm.org/D150506
show more ...
|
#
babe8629 |
| 06-May-2023 |
Manna, Soumi <soumi.manna@intel.com> |
[NFC][Clang] Fix static analyzer tool remarks about large copies by values in Format.cpp file
Reported by Static Analyzer Tool, Coverity:
Inside "Format.cpp" file, in clang::format::internal::refor
[NFC][Clang] Fix static analyzer tool remarks about large copies by values in Format.cpp file
Reported by Static Analyzer Tool, Coverity:
Inside "Format.cpp" file, in clang::format::internal::reformat(clang::format::FormatStyle const &, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus *)::[lambda(clang::format::Environment const &) (instance 4)]::operator ()(clang::format::Environment const &): A very large function call parameter exceeding the high threshold is passed by value.
pass_by_value: Capturing variable S of type clang::format::FormatStyle (size 808 bytes) by value, which exceeds the high threshold of 512 bytes
This patch uses original code but with an init capture that does a move instead of a copy.
Reviewed By: tahonermann, erichkeane, MyDeveloperDay, owenpan, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D149647
show more ...
|
Revision tags: llvmorg-16.0.3 |
|
#
c12aa69a |
| 29-Apr-2023 |
Jon Phillips <jonap2811@gmail.com> |
[clang-format] Add BracedInitializerIndentWidth option
The option allows users to specify how many columns to use to indent the contents of initializer lists.
Closes #51070.
Differential Revision:
[clang-format] Add BracedInitializerIndentWidth option
The option allows users to specify how many columns to use to indent the contents of initializer lists.
Closes #51070.
Differential Revision: https://reviews.llvm.org/D146101
show more ...
|