From 921f738f27d8c2e6718372a36872784386c6360d Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 28 Jun 2015 14:52:34 +0000 Subject: [PATCH] clang-format: Stop old options from overriding new options Summary: Depends on D10785. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D10786 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240909 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/Format.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 36ede0c7c7..6a8a848082 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -169,6 +169,16 @@ template <> struct MappingTraits { } } + // For backward compatibility. + if (!IO.outputting()) { + IO.mapOptional("DerivePointerBinding", Style.DerivePointerAlignment); + IO.mapOptional("IndentFunctionDeclarationAfterType", + Style.IndentWrappedFunctionNames); + IO.mapOptional("PointerBindsToType", Style.PointerAlignment); + IO.mapOptional("SpaceAfterControlStatementKeyword", + Style.SpaceBeforeParens); + } + IO.mapOptional("AccessModifierOffset", Style.AccessModifierOffset); IO.mapOptional("AlignAfterOpenBracket", Style.AlignAfterOpenBracket); IO.mapOptional("AlignConsecutiveAssignments", @@ -217,8 +227,6 @@ template <> struct MappingTraits { Style.ExperimentalAutoDetectBinPacking); IO.mapOptional("ForEachMacros", Style.ForEachMacros); IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels); - IO.mapOptional("IndentFunctionDeclarationAfterType", - Style.IndentWrappedFunctionNames); IO.mapOptional("IndentWidth", Style.IndentWidth); IO.mapOptional("IndentWrappedFunctionNames", Style.IndentWrappedFunctionNames); @@ -257,14 +265,6 @@ template <> struct MappingTraits { IO.mapOptional("Standard", Style.Standard); IO.mapOptional("TabWidth", Style.TabWidth); IO.mapOptional("UseTab", Style.UseTab); - - // For backward compatibility. - if (!IO.outputting()) { - IO.mapOptional("DerivePointerBinding", Style.DerivePointerAlignment); - IO.mapOptional("PointerBindsToType", Style.PointerAlignment); - IO.mapOptional("SpaceAfterControlStatementKeyword", - Style.SpaceBeforeParens); - } } }; -- 2.40.0