summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-12 11:19:37 +0000
committerDaniel Jasper <djasper@google.com>2013-07-12 11:19:37 +0000
commit011c35dabb4c8abcb7389d8fbc6316f8f23576ab (patch)
tree13b99cc75cb5aa9f06b91d4b28b8372f47daa335 /lib/CodeGen/CodeGenFunction.cpp
parent7c0a8b560ae78b28d72bff8614b94ac05cb2b469 (diff)
downloadclang-011c35dabb4c8abcb7389d8fbc6316f8f23576ab.tar.gz
clang-011c35dabb4c8abcb7389d8fbc6316f8f23576ab.tar.bz2
clang-011c35dabb4c8abcb7389d8fbc6316f8f23576ab.tar.xz
clang-format: Break before/between array subscript expressions.
clang-format used to treat array subscript expressions much like function call (just replacing () with []). However, this is not really appropriate especially for expressions with multiple subscripts. Although it might seem counter-intuitive, the most consistent solution seems to be to always (if necessary) break before a square bracket, never after it. Also, multiple subscripts of the same expression should be aligned if they are on subsequent lines. Before: aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa][ bbbbbbbbbbbbbbbbbbbbbbbbb] = c; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa][ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc; After: aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa] [bbbbbbbbbbbbbbbbbbbbbbbbb] = c; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] [bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions