summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-31 14:56:20 +0000
committerDaniel Jasper <djasper@google.com>2013-05-31 14:56:20 +0000
commit8893b8a28d32359a5c778d9308780200a09402ba (patch)
treeb10ca300b151094b0e237ed7e56106c566c5a507 /lib/CodeGen/CGExpr.cpp
parentc01897c3f6139304ed25e3f673bef77be209617f (diff)
downloadclang-8893b8a28d32359a5c778d9308780200a09402ba.tar.gz
clang-8893b8a28d32359a5c778d9308780200a09402ba.tar.bz2
clang-8893b8a28d32359a5c778d9308780200a09402ba.tar.xz
Make formatting of empty blocks more consistent.
With this patch, the simplified rule is: If the block is part of a declaration (class, namespace, function, enum, ..), merge an empty block onto a single line. Otherwise (specifically for the compound statements of if, for, while, ...), keep the braces on two separate lines. The reasons are: - Mostly the formatting of empty blocks does not matter much. - Empty compound statements are really rare and are usually just inserted while still working on the code. If they are on two lines, inserting code is easier. Also, overlooking the "{}" of an "if (...) {}" can be really bad. - Empty declarations are not uncommon, e.g. empty constructors. Putting them on one line saves vertical space at no loss of readability. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions