HomePhabricator

[clang-format] Refactor WhitespaceManager and friends

Description

[clang-format] Refactor WhitespaceManager and friends

The main motivation behind this is to cleanup the WhitespaceManager and
make it more extensible for future alignment etc. features.
Specifically, WhitespaceManager has started to copy more and more code
that is already present in FormatToken. Instead, I think it makes more
sense to actually store a reference to each FormatToken for each change.

This has as a consequence led to a change in the calculation of indent
levels. Now, we actually compute them for each Token ahead of time,
which should be more efficient as it removes an unsigned value for the
ParenState, which is used during the combinatorial exploration of the
solution space.

No functional changes intended.

Review: https://reviews.llvm.org/D29300

Details

Committed
djasperJan 31 2017, 3:25 AM
Parents
rL293615: [LoopUnroll] Use addClonedBlockToLoopInfo to clone the top level loop (NFC)
Branches
Unknown
Tags
Unknown