diff options
| author | Manuel Klimek <klimek@google.com> | 2017-12-01 13:28:08 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2017-12-01 13:28:08 +0000 |
| commit | 0b58c328d4344329f71c7e3de7e280fbbdbb8ff8 (patch) | |
| tree | 3bce0f3f09db4e8def182ceaab250409614249ed /llvm/lib/Linker | |
| parent | 2dc4ff1cdeba110ed7f823c58af88ffe71a723e4 (diff) | |
| download | bcm5719-llvm-0b58c328d4344329f71c7e3de7e280fbbdbb8ff8.tar.gz bcm5719-llvm-0b58c328d4344329f71c7e3de7e280fbbdbb8ff8.zip | |
Better trade-off for excess characters vs. staying within the column limits.
When we break a long line like:
Column limit: 21
|
// foo foo foo foo foo foo foo foo foo foo foo foo
The local decision when to allow protruding vs. breaking can lead to this
outcome (2 excess characters, 2 breaks):
// foo foo foo foo foo
// foo foo foo foo foo
// foo foo
While strictly staying within the column limit leads to this strictly better
outcome (fully below the column limit, 2 breaks):
// foo foo foo foo
// foo foo foo foo
// foo foo foo foo
To get an optimal solution, we would need to consider all combinations of excess
characters vs. breaking for all lines, but that would lead to a significant
increase in the search space of the algorithm for little gain.
Instead, we blindly try both approches and·select the one that leads to the
overall lower penalty.
Differential Revision: https://reviews.llvm.org/D40605
llvm-svn: 319541
Diffstat (limited to 'llvm/lib/Linker')
0 files changed, 0 insertions, 0 deletions

