This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][NFC] Don't call mightFitOnOneLine() unnecessarily
ClosedPublic

Authored by owenpan on May 15 2022, 2:05 AM.

Details

Summary

Clean up UnwrappedLineParser for RemoveBracesLLVM to avoid calling mightFitOnOneLine() as much as possible.

Diff Detail

Event Timeline

owenpan created this revision.May 15 2022, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2022, 2:05 AM
owenpan requested review of this revision.May 15 2022, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2022, 2:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sstwcw added inline comments.May 15 2022, 5:47 AM
clang/lib/Format/UnwrappedLineParser.cpp
2730
curdeius accepted this revision.May 15 2022, 6:27 AM

LGTM. I like it! Thanks!

clang/lib/Format/UnwrappedLineParser.cpp
523
2830
This revision is now accepted and ready to land.May 15 2022, 6:27 AM
owenpan updated this revision to Diff 429560.May 15 2022, 2:23 PM
owenpan added a reviewer: sstwcw.
owenpan removed a subscriber: sstwcw.

Fixes typos and makes KeepElseBraces depend on KeepIfBraces.

owenpan marked 3 inline comments as done.May 15 2022, 2:24 PM