summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineFormatter.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-4/+4
| | | | | | | | | | | | | | | | | | | 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
* [clang-format] Don't remove empty lines before namespace endingsKrasimir Georgiev2018-04-191-2/+3
| | | | | | | | | | | | | | Summary: This implements an alternative to r327861, namely preserving empty lines before namespace endings. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45373 llvm-svn: 330324
* [clang-format] Format raw string literalsKrasimir Georgiev2017-10-301-2/+6
| | | | | | | | | | | | | | | Summary: This patch adds raw string literal formatting. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, mgorny Differential Revision: https://reviews.llvm.org/D35943 llvm-svn: 316903
* clang-format clang-format.Manuel Klimek2017-09-201-2/+1
| | | | llvm-svn: 313744
* [clang-format] Replace IncompleteFormat by a struct with LineKrasimir Georgiev2017-04-211-3/+6
| | | | | | | | | | | | | | Summary: This patch replaces the boolean IncompleteFormat that is used to notify the client if an unrecoverable syntax error occurred by a struct that also contains a line number. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32298 llvm-svn: 300985
* [clang-format] Refactor WhitespaceManager and friendsDaniel Jasper2017-01-311-4/+4
| | | | | | | | | | | | | | | | | | | The main motivation behind this is to cleanup the WhitespaceManager and make it more extensible for future alignment etc. features. Specifically, WhitespaceManager has started to copy more and more code that is already present in FormatToken. Instead, I think it makes more sense to actually store a reference to each FormatToken for each change. This has as a consequence led to a change in the calculation of indent levels. Now, we actually compute them for each Token ahead of time, which should be more efficient as it removes an unsigned value for the ParenState, which is used during the combinatorial exploration of the solution space. No functional changes intended. Review: https://reviews.llvm.org/D29300 llvm-svn: 293616
* [NFC] Header cleanupMehdi Amini2016-07-181-2/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* clang-format: clang-format (NFC)Daniel Jasper2015-06-171-1/+2
| | | | llvm-svn: 239903
* Refactor clang-format's formatter.Manuel Klimek2015-05-121-29/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: a) Pull out a class LevelIndentTracker whose responsibility is to keep track of the indent of levels across multiple annotated lines. b) Put all responsibility for merging lines into the LineJoiner; make the LineJoiner iterate over the lines so we never operate on a line that might be merged later; this makes the interface safer to use. c) Move formatting of the end-of-file whitespace into formatFirstToken. Fix bugs that became obvious after the refactoring: 1. We would not format lines with offsets correctly inside nested blocks if only the outer expression was affected: int x = s({ // clang-format only this line class X { public: // ^ this starts at the non-modified indnent level; previously we would // not fix this, now we correctly outdent it. void f(); }; }); 2. We would incorrectly align comments across lines that do not have comments for lines with nested blocks: int expression; // with comment int x = s({ int y; // comment int z; // we would incorrectly align this comment with the comment on // 'expression' }); llvm-svn: 237104
* Refactor the formatter of clang-format.Manuel Klimek2015-05-111-89/+8
| | | | | | | | | | | | Pull various parts of the UnwrappedLineFormatter into their own abstractions. NFC. There are two things left for subsequent changes (to keep this reasonably small) - the UnwrappedLineFormatter now has a bad name - the UnwrappedLineFormatter::format function is still too large llvm-svn: 236974
* Implements a way to retrieve information about whether some lines were not ↵Manuel Klimek2015-05-071-2/+5
| | | | | | formatted due to syntax errors. llvm-svn: 236722
* clang-format: Don't indent 'signals' as access specifier if it isn't oneDaniel Jasper2015-05-061-1/+3
| | | | | | | | | | | | | | Before: { signals.set(0); } After: { signals.set(0); } llvm-svn: 236630
* clang-format: Support nested block formatting with ColumnLimit=0.Daniel Jasper2015-04-231-23/+24
| | | | llvm-svn: 235580
* clang-format: Fix regression formatting QT's "signals:" from r234318.Daniel Jasper2015-04-071-1/+2
| | | | llvm-svn: 234320
* clang-format: [JS] Support classes.Daniel Jasper2015-02-181-1/+2
| | | | | | | | | | This adds support for JavaScript class definitions (again following TypeScript & AtScript style). This only required support for visibility modifiers in JS, everything else was already working. Patch by Martin Probst, thank you. llvm-svn: 229701
* clang-format: Add support for SEH __try / __except / __finally blocks.Nico Weber2015-02-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | This lets clang-format format __try { } __except(0) { } and __try { } __finally { } correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set, so this turns this on. This also enables a few other keywords, but it shouldn't overly perturb regular clang-format operation. __except is a context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to a few more places. Fixes PR22321. llvm-svn: 228148
* clang-format: Factor out UnwrappedLineFormatter into a separate file.Daniel Jasper2014-12-101-0/+168
No functional changes intended. llvm-svn: 223936
OpenPOWER on IntegriCloud