summaryrefslogtreecommitdiff
path: root/clang/lib/Format/DefinitionBlockSeparator.cpp
AgeCommit message (Collapse)Author
2025-10-19[clang-format][NFC] Annotate attribute squares more effectively (#164052)owenca
Annotate left/right attribute squares distinctively and only annotate the outer pair of C++ attribute squares.
2025-05-31[Format] Remove unused includes (NFC) (#142296)Kazu Hirata
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
2025-05-08[clang-format] Handle C# where clause in SeparateDefinitionBlocks (#139034)Owen Pan
Fix #61956
2024-03-19Revert "[clang-format][NFC] Delete 100+ redundant #include lines in .cpp files"Owen Pan
This reverts commit b92d6dd704d789240685a336ad8b25a9f381b4cc. See github.com/llvm/llvm-project/commit/b92d6dd704d7#commitcomment-139992444 We should use a tool like Visual Studio to clean up the headers.
2024-03-16[clang-format][NFC] Delete 100+ redundant #include lines in .cpp filesOwen Pan
2023-08-24[clang-format][NFC] Replace !is() with isNot()Owen Pan
Differential Revision: https://reviews.llvm.org/D158571
2023-08-05[clang-format] Handle "// clang-format on" for SeparateDefinitionBlocksOwen Pan
Fixes 63393. Differential Revision: https://reviews.llvm.org/D156971
2023-07-11[clang-format][NFC] Remove redundant parentheses in the source codeOwen Pan
Reformat the source code with RemoveParentheses set to ReturnStatement.
2023-01-13[clang-format] Replace DeriveLineEnding and UseCRLF with LineEndingOwen Pan
Below is the mapping: LineEnding DeriveLineEnding UseCRLF LF false false CRLF false true DeriveLF true false DeriveCRLF true true Differential Revision: https://reviews.llvm.org/D141654
2022-05-24[clang-format][NFC] Insert/remove braces in clang/lib/Format/owenca
Differential Revision: https://reviews.llvm.org/D126157
2022-02-07[clang-format] Fix DefSeparator empty line issuesksyx
- Add or remove empty lines surrounding union blocks. - Fixes https://github.com/llvm/llvm-project/issues/53229, in which keywords like class and struct in a line ending with left brace or whose next line is left brace only, will be falsely recognized as definition line, causing extra empty lines inserted surrounding blocks with no need to be formatted. Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D119067
2022-02-02[clang-format] Elide unnecessary braces. NFC.Marek Kurdej
2022-01-24[clang-format] Fix SeparateDefinitionBlocks issuesksyx
- Fixes https://github.com/llvm/llvm-project/issues/53227 that wrongly indents multiline comments - Fixes wrong detection of single-line opening braces when used along with those only opening scopes, causing crashes due to duplicated replacements on the same token: void foo() { { int x; } } - Fixes wrong recognition of first line of definition when the line starts with block comment, causing crashes due to duplicated replacements on the same token for this leads toward skipping the line starting with inline block comment: /* Some descriptions about function */ /*inline*/ void bar() { } - Fixes wrong recognition of enum when used as a type name rather than starting definition block, causing crashes due to duplicated replacements on the same token since both actions for enum and for definition blocks were taken place: void foobar(const enum EnumType e) { } - Change to use function keyword for JavaScript instead of comparing strings - Resolves formatting conflict with options EmptyLineAfterAccessModifier and EmptyLineBeforeAccessModifier (prompts with --dry-run (-n) or --output-replacement-xml but no observable change) - Recognize long (len>=5) uppercased name taking a single line as return type and fix the problem of adding newline below it, with adding new token type FunctionLikeOrFreestandingMacro and marking tokens in UnwrappedLineParser: void afunc(int x) { return; } TYPENAME func(int x, int y) { // ... } - Remove redundant and repeated initialization - Do no change to newlines before EOF Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks Differential Revision: https://reviews.llvm.org/D117520
2022-01-12[clang-format] Fix comment. NFC.Marek Kurdej
2022-01-11[clang-format] Fix SeparateDefinitionBlocks issuesksyx
Fixes https://github.com/llvm/llvm-project/issues/52976. - Make no formatting for macros - Attach comment with definition headers - Make no change on use of empty lines at block start/end - Fix misrecognition of keyword namespace Differential Revision: https://reviews.llvm.org/D116663 Reviewed By: MyDeveloperDay, HazardyKnusperkeks, curdeius
2022-01-09[clang] Use true/false instead of 1/0 (NFC)Kazu Hirata
Identified with modernize-use-bool-literals.
2022-01-07[clang-format] Use prefix increment and decrement. NFC.Marek Kurdej
2022-01-03[clang-format] Style to separate definition blocksksyx
This commit resolves GitHub issue #45895 (Bugzilla #46550), to add or remove empty line between definition blocks including namespaces, classes, structs, enums and functions. Reviewed By: MyDeveloperDay, curdeius, HazardyKnusperkeks Differential Revision: https://reviews.llvm.org/D116314