Skip to content

Commit 6475c9d

Browse files
committed
[clang-format] Rename ExportBlockIndentation -> IndentExportBlock
1 parent 30e517c commit 6475c9d

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3946,21 +3946,6 @@ the configuration (without a prefix: ``Auto``).
39463946
This is an experimental flag, that might go away or be renamed. Do
39473947
not use this in config files, etc. Use at your own risk.
39483948

3949-
.. _ExportBlockIndentation:
3950-
3951-
**ExportBlockIndentation** (``Boolean``) :versionbadge:`clang-format 20` :ref:`<ExportBlockIndentation>`
3952-
If ``true``, clang-format will indent the body of an ``export { ... }``
3953-
block. This doesn't affect the formatting of anything else related to
3954-
exported declarations.
3955-
3956-
.. code-block:: c++
3957-
3958-
true: false:
3959-
export { vs. export {
3960-
void foo(); void foo();
3961-
void bar(); void bar();
3962-
} }
3963-
39643949
.. _FixNamespaceComments:
39653950

39663951
**FixNamespaceComments** (``Boolean``) :versionbadge:`clang-format 5` :ref:`<FixNamespaceComments>`
@@ -4228,6 +4213,21 @@ the configuration (without a prefix: ``Auto``).
42284213
plop(); plop();
42294214
} }
42304215

4216+
.. _IndentExportBlock:
4217+
4218+
**IndentExportBlock** (``Boolean``) :versionbadge:`clang-format 20` :ref:`<IndentExportBlock>`
4219+
If ``true``, clang-format will indent the body of an ``export { ... }``
4220+
block. This doesn't affect the formatting of anything else related to
4221+
exported declarations.
4222+
4223+
.. code-block:: c++
4224+
4225+
true: false:
4226+
export { vs. export {
4227+
void foo(); void foo();
4228+
void bar(); void bar();
4229+
} }
4230+
42314231
.. _IndentExternBlock:
42324232

42334233
**IndentExternBlock** (``IndentExternBlockStyle``) :versionbadge:`clang-format 11` :ref:`<IndentExternBlock>`

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ clang-format
12241224
- Adds ``VariableTemplates`` option.
12251225
- Adds support for bash globstar in ``.clang-format-ignore``.
12261226
- Adds ``WrapNamespaceBodyWithEmptyLines`` option.
1227-
- Adds the ``ExportBlockIndentation`` option.
1227+
- Adds the ``IndentExportBlock`` option.
12281228

12291229
libclang
12301230
--------

clang/include/clang/Format/Format.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,7 +2687,7 @@ struct FormatStyle {
26872687
/// } }
26882688
/// \endcode
26892689
/// \version 20
2690-
bool ExportBlockIndentation;
2690+
bool IndentExportBlock;
26912691

26922692
/// If ``true``, clang-format adds missing namespace end comments for
26932693
/// namespaces and fixes invalid existing ones. This doesn't affect short
@@ -5267,7 +5267,7 @@ struct FormatStyle {
52675267
EmptyLineBeforeAccessModifier == R.EmptyLineBeforeAccessModifier &&
52685268
ExperimentalAutoDetectBinPacking ==
52695269
R.ExperimentalAutoDetectBinPacking &&
5270-
ExportBlockIndentation == R.ExportBlockIndentation &&
5270+
IndentExportBlock == R.IndentExportBlock &&
52715271
FixNamespaceComments == R.FixNamespaceComments &&
52725272
ForEachMacros == R.ForEachMacros &&
52735273
IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&

clang/lib/Format/Format.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ template <> struct MappingTraits<FormatStyle> {
10401040
Style.EmptyLineBeforeAccessModifier);
10411041
IO.mapOptional("ExperimentalAutoDetectBinPacking",
10421042
Style.ExperimentalAutoDetectBinPacking);
1043-
IO.mapOptional("ExportBlockIndentation", Style.ExportBlockIndentation);
1043+
IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
10441044
IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments);
10451045
IO.mapOptional("ForEachMacros", Style.ForEachMacros);
10461046
IO.mapOptional("IfMacros", Style.IfMacros);
@@ -1551,7 +1551,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
15511551
LLVMStyle.EmptyLineAfterAccessModifier = FormatStyle::ELAAMS_Never;
15521552
LLVMStyle.EmptyLineBeforeAccessModifier = FormatStyle::ELBAMS_LogicalBlock;
15531553
LLVMStyle.ExperimentalAutoDetectBinPacking = false;
1554-
LLVMStyle.ExportBlockIndentation = true;
1554+
LLVMStyle.IndentExportBlock = true;
15551555
LLVMStyle.FixNamespaceComments = true;
15561556
LLVMStyle.ForEachMacros.push_back("foreach");
15571557
LLVMStyle.ForEachMacros.push_back("Q_FOREACH");

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,7 @@ void UnwrappedLineParser::parseNamespace() {
31673167
}
31683168

31693169
void UnwrappedLineParser::parseCppExportBlock() {
3170-
parseNamespaceOrExportBlock(/*AddLevels=*/Style.ExportBlockIndentation ? 1
3171-
: 0);
3170+
parseNamespaceOrExportBlock(/*AddLevels=*/Style.IndentExportBlock ? 1 : 0);
31723171
}
31733172

31743173
void UnwrappedLineParser::parseNew() {

clang/unittests/Format/ConfigParseTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
176176
CHECK_PARSE_BOOL(IndentAccessModifiers);
177177
CHECK_PARSE_BOOL(IndentCaseBlocks);
178178
CHECK_PARSE_BOOL(IndentCaseLabels);
179+
CHECK_PARSE_BOOL(IndentExportBlock);
179180
CHECK_PARSE_BOOL(IndentGotoLabels);
180181
CHECK_PARSE_BOOL(IndentRequiresClause);
181182
CHECK_PARSE_BOOL_FIELD(IndentRequiresClause, "IndentRequires");

clang/unittests/Format/FormatTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9059,9 +9059,9 @@ TEST_F(FormatTest, AdaptiveOnePerLineFormatting) {
90599059
Style);
90609060
}
90619061

9062-
TEST_F(FormatTest, ExportBlockIndentation) {
9062+
TEST_F(FormatTest, IndentExportBlock) {
90639063
FormatStyle Style = getLLVMStyleWithColumns(80);
9064-
Style.ExportBlockIndentation = true;
9064+
Style.IndentExportBlock = true;
90659065
verifyFormat("export {\n"
90669066
" int x;\n"
90679067
" int y;\n"
@@ -9072,7 +9072,7 @@ TEST_F(FormatTest, ExportBlockIndentation) {
90729072
"}",
90739073
Style);
90749074

9075-
Style.ExportBlockIndentation = false;
9075+
Style.IndentExportBlock = false;
90769076
verifyFormat("export {\n"
90779077
"int x;\n"
90789078
"int y;\n"
@@ -9086,7 +9086,7 @@ TEST_F(FormatTest, ExportBlockIndentation) {
90869086

90879087
TEST_F(FormatTest, ShortExportBlocks) {
90889088
FormatStyle Style = getLLVMStyleWithColumns(80);
9089-
Style.ExportBlockIndentation = false;
9089+
Style.IndentExportBlock = false;
90909090

90919091
Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
90929092
verifyFormat("export {\n"

0 commit comments

Comments
 (0)