[clang] 5733226 - [clang-format] Correct the AfterControlStatement configuration option output style
via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 30 03:05:33 PDT 2020
Author: mydeveloperday
Date: 2020-04-30T11:05:02+01:00
New Revision: 573322694ad332c1cf3e7b27afe002fd46f561f7
URL: https://github.com/llvm/llvm-project/commit/573322694ad332c1cf3e7b27afe002fd46f561f7
DIFF: https://github.com/llvm/llvm-project/commit/573322694ad332c1cf3e7b27afe002fd46f561f7.diff
LOG: [clang-format] Correct the AfterControlStatement configuration option output style
Summary:
Due to the order in which the enum cases were defined the old options which were retained for backwards compatibility were being preferred over the new options when printing with the --dump-config option.
Reviewers: MyDeveloperDay
Reviewed By: MyDeveloperDay
Patch By: duncan-llvm
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D79020
Added:
Modified:
clang/lib/Format/Format.cpp
Removed:
################################################################################
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 737e5028bf0b..872f7009d332 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -195,11 +195,13 @@ struct ScalarEnumerationTraits<
static void
enumeration(IO &IO,
FormatStyle::BraceWrappingAfterControlStatementStyle &Value) {
- IO.enumCase(Value, "false", FormatStyle::BWACS_Never);
- IO.enumCase(Value, "true", FormatStyle::BWACS_Always);
IO.enumCase(Value, "Never", FormatStyle::BWACS_Never);
IO.enumCase(Value, "MultiLine", FormatStyle::BWACS_MultiLine);
IO.enumCase(Value, "Always", FormatStyle::BWACS_Always);
+
+ // For backward compatibility.
+ IO.enumCase(Value, "false", FormatStyle::BWACS_Never);
+ IO.enumCase(Value, "true", FormatStyle::BWACS_Always);
}
};
More information about the cfe-commits
mailing list