summaryrefslogtreecommitdiffstats
path: root/clang/docs
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-09-10 13:11:45 +0000
committerDaniel Jasper <djasper@google.com>2014-09-10 13:11:45 +0000
commitb87899b567b95fa695c943e2d9b760966d38c2c9 (patch)
treec7ed5ec9b23f0ef91500de23e998f85bf8f5bd5c /clang/docs
parente7b92f0e8109877b073ff28c61c79ebbada07565 (diff)
downloadbcm5719-llvm-b87899b567b95fa695c943e2d9b760966d38c2c9.tar.gz
bcm5719-llvm-b87899b567b95fa695c943e2d9b760966d38c2c9.zip
clang-format: Add option to allow short case labels on a single line.
On a single line: switch (a) { case 1: x = 1; return; case 2: x = 2; return; default: break; } Not on a single line: switch (a) { case 1: x = 1; return; case 2: x = 2; return; default: break; } This partly addresses llvm.org/PR16535. In the long run, we probably want to lay these out in columns. llvm-svn: 217501
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/ClangFormatStyleOptions.rst14
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 332fe3becda..c7981cfcdf1 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -148,6 +148,9 @@ the configuration (without a prefix: ``Auto``).
E.g., this allows ``if (a) { return; }`` to be put on a single line.
+**AllowShortCaseLabelsOnASingleLine** (``bool``)
+ If ``true``, short case labels will be contracted to a single line.
+
**AllowShortFunctionsOnASingleLine** (``ShortFunctionStyle``)
Dependent on the value, ``int f() { return 0; }`` can be put
on a single line.
@@ -257,7 +260,7 @@ the configuration (without a prefix: ``Auto``).
**DerivePointerAlignment** (``bool``)
If ``true``, analyze the formatted file for the most common
- alignment of ``&`` and ``*``. ``PointerAlignment`` is then used only as fallback.
+ alignment of & and *. ``PointerAlignment`` is then used only as fallback.
**DisableFormat** (``bool``)
Disables formatting at all.
@@ -374,6 +377,9 @@ the configuration (without a prefix: ``Auto``).
Align pointer in the middle.
+**SpaceAfterCStyleCast** (``bool``)
+ If ``true``, a space may be inserted after C style casts.
+
**SpaceBeforeAssignmentOperators** (``bool``)
If ``false``, spaces will be removed before assignment operators.
@@ -411,9 +417,6 @@ the configuration (without a prefix: ``Auto``).
**SpacesInCStyleCastParentheses** (``bool``)
If ``true``, spaces may be inserted into C style casts.
-**SpaceAfterCStyleCast** (``bool``)
- If ``true``, a space may be inserted after C style casts.
-
**SpacesInContainerLiterals** (``bool``)
If ``true``, spaces are inserted inside container literals (e.g.
ObjC and Javascript array and dict literals).
@@ -422,8 +425,7 @@ the configuration (without a prefix: ``Auto``).
If ``true``, spaces will be inserted after '(' and before ')'.
**SpacesInSquareBrackets** (``bool``)
- If ``true``, spaces will be inserted after '[' and before ']' in array
- declarations and element access expressions, but not in lambdas.
+ If ``true``, spaces will be inserted after '[' and before ']'.
**Standard** (``LanguageStandard``)
Format compatible with this standard, e.g. use
OpenPOWER on IntegriCloud