diff options
| author | Daniel Jasper <djasper@google.com> | 2013-05-08 14:12:04 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-05-08 14:12:04 +0000 |
| commit | 11e13801d8a25cea011c2a154380c371b6ddaaf6 (patch) | |
| tree | 5ca7f813ecf6b62ae2e4cad24b76bad9ab8351bc /lib/CodeGen/CodeGenFunction.cpp | |
| parent | 3190ca922d3743137e15fe0c525c04b177b9983b (diff) | |
| download | clang-11e13801d8a25cea011c2a154380c371b6ddaaf6.tar.gz clang-11e13801d8a25cea011c2a154380c371b6ddaaf6.tar.bz2 clang-11e13801d8a25cea011c2a154380c371b6ddaaf6.tar.xz | |
Improve line breaking in binary expressions.
If the LHS of a binary expression is broken, clang-format should also
break after the operator as otherwise:
- The RHS can be easy to miss
- It can look as if clang-format doesn't understand operator precedence
Before:
bool aaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !=
bbbbbbbbbbbbbbbbbb && ccccccccc == ddddddddddd;
After:
bool aaaaaaaaaaaaaaaaaaaaa =
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbb &&
ccccccccc == ddddddddddd;
As an additional note, clang-format would also be ok with the following
formatting, it just has a higher penalty (IMO correctly so).
bool aaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !=
bbbbbbbbbbbbbbbbbb &&
ccccccccc == ddddddddddd;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions
