Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

[clang-format] Respect ColumnLimit 0 line breaks in inline asm

Authored by rymiel on May 18 2023, 12:29 AM.



Previously, using ColumnLimit: 0 with extended inline asm with the
BreakBeforeInlineASMColon: OnlyMultiline option (the default style),
the formatter would act as if in Always mode, meaning a line break was
added before every colon in an extended inline assembly block.

This patch respects the already existing line breaks, and doesn't add
any new ones, if in ColumnLimit 0 mode.

Behaviour with Always stays as expected, with a break before every colon
regardless of any existing line breaks.

Behaviour with Never was broken before, and remains broken with this patch,
it is just never respected in ColumnLimit 0 mode.


Diff Detail

Event Timeline

rymiel created this revision.May 18 2023, 12:29 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 18 2023, 12:29 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rymiel requested review of this revision.May 18 2023, 12:29 AM
This revision is now accepted and ready to land.May 18 2023, 12:54 AM
owenpan accepted this revision.May 24 2023, 10:05 PM
owenpan added inline comments.



FWIW, it's easier to read IMO.

rymiel updated this revision to Diff 530486.Jun 12 2023, 6:19 AM

Apply suggestions from review

rymiel marked 2 inline comments as done.Jun 12 2023, 6:20 AM
rymiel retitled this revision from [clang-format] Respect ColumnLimit 0 lines breaks in inline asm to [clang-format] Respect ColumnLimit 0 line breaks in inline asm.
owenpan accepted this revision.Jun 12 2023, 11:25 AM
This revision was landed with ongoing or failed builds.Jun 23 2023, 7:35 AM
This revision was automatically updated to reflect the committed changes.
owenpan added inline comments.Jun 25 2023, 12:13 AM

We have verifyNoChange now. See D153109.

rymiel marked 2 inline comments as done.Jun 26 2023, 2:20 AM
rymiel added inline comments.

Sorry, this patch was so old and I forgot that refactor happened, thanks for reminding me, i pushed