diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-03-08 12:54:50 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-03-08 12:54:50 +0000 |
commit | bc05ebaa5a906b8f6b0d79a5335c35cba27abee5 (patch) | |
tree | d6925da47ceed187111c106fa640307eb60ba97b /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | f82d68ff533e50e27129d6a8905fb716f9f79937 (diff) | |
download | bcm5719-llvm-bc05ebaa5a906b8f6b0d79a5335c35cba27abee5.tar.gz bcm5719-llvm-bc05ebaa5a906b8f6b0d79a5335c35cba27abee5.zip |
[clang-format] Look at NoLineBreak and NoLineBreakInOperand before breakProtrudingToken
Summary:
This patch makes ContinuationIndenter call breakProtrudingToken only if
NoLineBreak and NoLineBreakInOperand is false.
Previously, clang-format required two runs to converge on the following example with 24 columns:
Note that the second operand shouldn't be splitted according to NoLineBreakInOperand, but the
token breaker doesn't take that into account:
```
func(a, "long long long long", c);
```
After first run:
```
func(a, "long long "
"long long",
c);
```
After second run, where NoLineBreakInOperand is taken into account:
```
func(a,
"long long "
"long long",
c);
```
With the patch, clang-format now obtains in one run:
```
func(a,
"long long long"
"long",
c);
```
which is a better token split overall.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D30575
llvm-svn: 297274
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions