This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Inherit RightAlign options across scopes
ClosedPublic

Authored by rymiel on Jan 9 2023, 7:49 AM.

Details

Summary

D119599 added the ability to align compound assignments, right aligning
them in order to line up at the equals sign.
However, that patch didn't account for AlignTokens being called
recursively across scopes, which reset the right justification to be
false in any scope besides the top scope. This meant the compound
assignments were aligned, just not at the right place.
(No tests also ever introduced any scopes)

This patch makes sure to inherit the right justification value, just as
every other parameter is passed on.

Fixes https://github.com/llvm/llvm-project/issues/58029

Diff Detail

Event Timeline

rymiel created this revision.Jan 9 2023, 7:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 7:49 AM
rymiel requested review of this revision.Jan 9 2023, 7:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 7:49 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
owenpan accepted this revision.Jan 9 2023, 8:52 PM

LGTM

This revision is now accepted and ready to land.Jan 9 2023, 8:52 PM
This revision was landed with ongoing or failed builds.Jan 10 2023, 8:02 PM
This revision was automatically updated to reflect the committed changes.