[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-02-03 Thread Björn Schäpers via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. HazardyKnusperkeks marked an inline comment as done. Closed by commit rG3d0b61926139: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter (authored by

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-20 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:215 +const auto = *I[1]; +const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr; +if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore)

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:215 +const auto = *I[1]; +const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr; +if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore)

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-17 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 3 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:215 +const auto = *I[1]; +const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr; +if

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-17 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:215 +const auto = *I[1]; +const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr; +if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore)

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-16 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 400449. HazardyKnusperkeks marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 Files: clang/lib/Format/UnwrappedLineFormatter.cpp Index:

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-16 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks marked 5 inline comments as done. HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:215 +const auto = *I[1]; +const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr; +if

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-16 Thread Owen Pan via Phabricator via cfe-commits
owenpan added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:215 +const auto = *I[1]; +const auto *PreviousLine = I != AnnotatedLines.begin() ? I[-1] : nullptr; +if (NextLine.Type == LT_Invalid || NextLine.First->MustBreakBefore)

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-16 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:288 +// Try to merge a control statement block with left brace unwrapped. +if (TheLine->Last->is(tok::l_brace) && TheLine->First->isOneOf(tok::kw_if, tok::kw_while,

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-16 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 400400. HazardyKnusperkeks marked 2 inline comments as done. HazardyKnusperkeks added a comment. This revision is now accepted and ready to land. Updated, now using a pointer (potential null) for PreviousLine. CHANGES SINCE LAST ACTION

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-07 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks planned changes to this revision. HazardyKnusperkeks marked 2 inline comments as done. HazardyKnusperkeks added a comment. In D115060#3227120 , @owenpan wrote: > Maybe option 4 for now So I can get it through. > and the refactoring

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-07 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. Moving the handling of empty record blocks might be NFC? Maybe option 4 for now and the refactoring in another patch? Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:288 +// Try to merge a control statement block with left brace unwrapped.

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-07 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D115060#3224176 , @owenpan wrote: >> But I suspect it is the Assignment of the `PreviousLine` since this is not >> existent every time. > > Yep! > >> So I see the following solutions: >> >> 1. Only name `NextLine`,

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-05 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. > But I suspect it is the Assignment of the `PreviousLine` since this is not > existent every time. Yep! > So I see the following solutions: > > 1. Only name `NextLine`, and use `I[-1]`. > 2. `const auto HasPreviousLine = I != AnnotatedLines.begin(); const auto > =

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-05 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. That's look good. And it's a nice clean up with all those repeated checks removed. Don't forget to reformat before landing. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-05 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 397531. HazardyKnusperkeks added a comment. Option 3 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 Files: clang/lib/Format/UnwrappedLineFormatter.cpp Index:

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-05 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks reopened this revision. HazardyKnusperkeks added a comment. This revision is now accepted and ready to land. In D115060#3219116 , @curdeius wrote: > @HazardyKnusperkeks, it *seems* as if this commit (or one of others indicated > on

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-04 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. @HazardyKnusperkeks, it *seems* as if this commit (or one of others indicated on Changes tab of the link below) provoked failures in ASan. But it could be something else. https://lab.llvm.org/buildbot/#/builders/5/builds/16734 Could you have a look? Repository: rG

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2022-01-03 Thread Björn Schäpers via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf014ab933f35: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter (authored by HazardyKnusperkeks). Changed prior to commit: https://reviews.llvm.org/D115060?vs=391853=397135#toc Repository:

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-04 Thread Owen Pan via Phabricator via cfe-commits
owenpan accepted this revision. owenpan added a comment. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-04 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks updated this revision to Diff 391853. HazardyKnusperkeks edited the summary of this revision. HazardyKnusperkeks added a comment. Fixed formatting and added a name for I[-1]. I[i + 1] is used in the loop condition, which also checks if i + 1 is valid, so do not give a name

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-03 Thread Owen Pan via Phabricator via cfe-commits
owenpan added a comment. How about naming `I[-1]` as well? And maybe `I[i + 1]` too? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060 ___ cfe-commits mailing

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-03 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Don't forget to reformat please. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115060/new/ https://reviews.llvm.org/D115060

[PATCH] D115060: [clang-format][NFC] Code Tidies in UnwrappedLineFormatter

2021-12-03 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks created this revision. HazardyKnusperkeks added reviewers: owenpan, MyDeveloperDay, curdeius. HazardyKnusperkeks added a project: clang-format. HazardyKnusperkeks requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. - Give