summaryrefslogtreecommitdiff
path: root/clang/lib/Format/AffectedRangeManager.cpp
AgeCommit message (Collapse)Author
2025-01-04[clang-format][NFC] Replace SmallVectorImpl with ArrayRef (#121621)Owen Pan
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-02-21[clang-format][NFC] Clean up nullptr comparison styleOwen Pan
For example, use 'Next' instead of 'Next != nullptr', and '!Next' instead of 'Next == nullptr'. Differential Revision: https://reviews.llvm.org/D144355
2022-05-24[clang-format][NFC] Insert/remove braces in clang/lib/Format/owenca
Differential Revision: https://reviews.llvm.org/D126157
2022-01-24[clang-format] Assert Line->First. NFC.Marek Kurdej
Cf. scan-build reports: * https://llvm.org/reports/scan-build/report-AffectedRangeManager.cpp-nonPPLineAffected-34-16c04b.html#EndPath * https://llvm.org/reports/scan-build/report-SortJavaScriptImports.cpp-parseModuleReferences-34-96a7f8.html#EndPath * https://llvm.org/reports/scan-build/report-TokenAnnotator.cpp-setCommentLineLevels-26-77bdba.html#EndPath * https://llvm.org/reports/scan-build/report-AffectedRangeManager.cpp-nonPPLineAffected-31-714434.html#EndPath * https://llvm.org/reports/scan-build/report-TokenAnnotator.cpp-setCommentLineLevels-16-bd39d0.html#EndPath * https://llvm.org/reports/scan-build/report-UnwrappedLineFormatter.cpp-format-90-668b2d.html#EndPath
2022-01-07[clang-format] Use range-for loops. NFC.Marek Kurdej
Reviewed By: MyDeveloperDay, owenpan Differential Revision: https://reviews.llvm.org/D116795
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-05-09Remove \brief commands from doxygen comments.Adrian Prantl
This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
2018-04-23Format closing braces when reformatting the line containing the opening brace.Manuel Klimek
This required a couple of yaks to be shaved: 1. MatchingOpeningBlockLineIndex was misused to also store the closing index; instead, use a second variable, as this doesn't work correctly for "} else {". 2. We needed to change the API of AffectedRangeManager to not use iterators; we always passed in begin / end for the whole container before, so there was no mismatch in generality. 3. We need an extra check to discontinue formatting at the top level, as we now sometimes change the indent of the closing brace, but want to bail out immediately afterwards, for example: void f() { if (a) { } void g(); Previously: void f() { if (a) { } void g(); Now: void f() { if (a) { } void g(); Differential Revision: https://reviews.llvm.org/D45726 llvm-svn: 330573
2016-04-25Added Fixer implementation and fix() interface in clang-format for removing ↵Eric Liu
redundant code. Summary: After applying replacements, redundant code like extra commas or empty namespaces might be introduced. Fixer can detect and remove any redundant code introduced by replacements. The current implementation only handles redundant commas. Reviewers: djasper, klimek Subscribers: ioeric, mprobst, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D18551 llvm-svn: 267416