[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 7 11:43:57 PST 2022
HazardyKnusperkeks planned changes to this revision.
HazardyKnusperkeks marked 2 inline comments as done.
HazardyKnusperkeks added a comment.
In D115060#3227120 <https://reviews.llvm.org/D115060#3227120>, @owenpan wrote:
> Maybe option 4 for now
So I can get it through.
> and the refactoring in another patch?
Probably won't do it.
================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:317
+ : 0;
+ }
+ if (TheLine->First->isOneOf(tok::kw_else, tok::kw_catch) &&
----------------
owenpan wrote:
> Ditto.
Same.
================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:335-360
+ // Handle empty record blocks where the brace has already been wrapped.
+ if (TheLine->Last->is(tok::l_brace) && TheLine->First == TheLine->Last) {
+ bool EmptyBlock = NextLine.First->is(tok::r_brace);
+
+ const FormatToken *Tok = PreviousLine.First;
+ if (Tok && Tok->is(tok::comment))
+ Tok = Tok->getNextNonComment();
----------------
owenpan wrote:
> Handling empty record blocks here instead of earlier may have unknown side effects?
Of course it //may// have side effects.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115060/new/
https://reviews.llvm.org/D115060
More information about the cfe-commits
mailing list