[clang] c2257fe - [clang-format] Fix SeparateDefinitionBlocks docs and ...
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 5 03:32:14 PST 2022
Author: Björn Schäpers
Date: 2022-01-05T12:31:34+01:00
New Revision: c2257fe236726ed46f1ec3d68633f1b6663d2513
URL: https://github.com/llvm/llvm-project/commit/c2257fe236726ed46f1ec3d68633f1b6663d2513
DIFF: https://github.com/llvm/llvm-project/commit/c2257fe236726ed46f1ec3d68633f1b6663d2513.diff
LOG: [clang-format] Fix SeparateDefinitionBlocks docs and ...
the Style's equality operator.
This amends 6f6f88ffdae1e12e5f950ef418827a77a55c09c7
Differential Revision: https://reviews.llvm.org/D116557
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 5a52916acc559..9bc62587c8fb1 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3192,15 +3192,15 @@ the configuration (without a prefix: ``Auto``).
**PenaltyBreakFirstLessLess** (``Unsigned``) :versionbadge:`clang-format 3.7`
The penalty for breaking before the first ``<<``.
+**PenaltyBreakOpenParenthesis** (``Unsigned``) :versionbadge:`clang-format 14`
+ The penalty for breaking after ``(``.
+
**PenaltyBreakString** (``Unsigned``) :versionbadge:`clang-format 3.7`
The penalty for each line break introduced inside a string literal.
**PenaltyBreakTemplateDeclaration** (``Unsigned``) :versionbadge:`clang-format 7`
The penalty for breaking after template declaration.
-**PenaltyBreakOpenParenthesis** (``Unsigned``) :versionbadge:`clang-format 14`
- The penalty for breaking after ``(``.
-
**PenaltyExcessCharacter** (``Unsigned``) :versionbadge:`clang-format 3.7`
The penalty for each character outside of the column limit.
@@ -3403,19 +3403,8 @@ the configuration (without a prefix: ``Auto``).
* information */
**SeparateDefinitionBlocks** (``SeparateDefinitionStyle``) :versionbadge:`clang-format 14`
- Specifies the use of empty lines to separate definition blocks, including classes,
- structs, enums, and functions.
-
- Possible values:
-
- * ``SDS_Leave`` (in configuration: ``Leave``)
- Leave definition blocks as they are.
-
- * ``SDS_Always`` (in configuration: ``Always``)
- Insert an empty line between definition blocks.
-
- * ``SDS_Never`` (in configuration: ``Never``)
- Remove any empty line between definition blocks.
+ Specifies the use of empty lines to separate definition blocks, including
+ classes, structs, enums, and functions.
.. code-block:: c++
@@ -3461,6 +3450,19 @@ the configuration (without a prefix: ``Auto``).
class C {};
}
+ Possible values:
+
+ * ``SDS_Leave`` (in configuration: ``Leave``)
+ Leave definition blocks as they are.
+
+ * ``SDS_Always`` (in configuration: ``Always``)
+ Insert an empty line between definition blocks.
+
+ * ``SDS_Never`` (in configuration: ``Never``)
+ Remove any empty line between definition blocks.
+
+
+
**ShortNamespaceLines** (``Unsigned``) :versionbadge:`clang-format 14`
The maximal number of unwrapped lines that a short namespace spans.
Defaults to 1.
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index d3113a5fdba41..2ee6e26bde55e 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -3054,6 +3054,7 @@ struct FormatStyle {
bool ReflowComments;
// clang-format on
+ /// \brief The style if definition blocks should be separated.
enum SeparateDefinitionStyle {
/// Leave definition blocks as they are.
SDS_Leave,
@@ -3862,6 +3863,7 @@ struct FormatStyle {
QualifierOrder == R.QualifierOrder &&
RawStringFormats == R.RawStringFormats &&
ReferenceAlignment == R.ReferenceAlignment &&
+ SeparateDefinitionBlocks == R.SeparateDefinitionBlocks &&
ShortNamespaceLines == R.ShortNamespaceLines &&
SortIncludes == R.SortIncludes &&
SortJavaStaticImport == R.SortJavaStaticImport &&
More information about the cfe-commits
mailing list