summaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-09-25 15:15:02 +0000
committerDaniel Jasper <djasper@google.com>2013-09-25 15:15:02 +0000
commit9b4de85e2f47a01974f451d21fed0276ff912e32 (patch)
tree34d1088d6e6edff3e88d3bc994bc35deb9627515 /lib/Format/Format.cpp
parent74cd65e8dc60fe9e6c397b3393da7303debbc971 (diff)
downloadclang-9b4de85e2f47a01974f451d21fed0276ff912e32.tar.gz
clang-9b4de85e2f47a01974f451d21fed0276ff912e32.tar.bz2
clang-9b4de85e2f47a01974f451d21fed0276ff912e32.tar.xz
clang-format: Option to removing the space before assignment operators.
Patch contributed by Aaron Wishnick. Thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 5271a62e8f..6166ecc1b3 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -147,6 +147,8 @@ template <> struct MappingTraits<clang::format::FormatStyle> {
Style.SpacesInCStyleCastParentheses);
IO.mapOptional("SpaceAfterControlStatementKeyword",
Style.SpaceAfterControlStatementKeyword);
+ IO.mapOptional("SpaceBeforeAssignmentOperators",
+ Style.SpaceBeforeAssignmentOperators);
}
};
}
@@ -197,6 +199,7 @@ FormatStyle getLLVMStyle() {
LLVMStyle.SpaceInEmptyParentheses = false;
LLVMStyle.SpacesInCStyleCastParentheses = false;
LLVMStyle.SpaceAfterControlStatementKeyword = true;
+ LLVMStyle.SpaceBeforeAssignmentOperators = true;
setDefaultPenalties(LLVMStyle);
LLVMStyle.PenaltyReturnTypeOnItsOwnLine = 60;
@@ -239,6 +242,7 @@ FormatStyle getGoogleStyle() {
GoogleStyle.SpaceInEmptyParentheses = false;
GoogleStyle.SpacesInCStyleCastParentheses = false;
GoogleStyle.SpaceAfterControlStatementKeyword = true;
+ GoogleStyle.SpaceBeforeAssignmentOperators = true;
setDefaultPenalties(GoogleStyle);
GoogleStyle.PenaltyReturnTypeOnItsOwnLine = 200;