diff options
author | Roman Kashitsyn <romankashicin@gmail.com> | 2015-08-10 13:43:19 +0000 |
---|---|---|
committer | Roman Kashitsyn <romankashicin@gmail.com> | 2015-08-10 13:43:19 +0000 |
commit | 291f64fd03a8057d4b260a3b74a7d109c017111a (patch) | |
tree | 3a305ba88a77de87d6a79d9fbf4554cb71394e61 /clang/lib/Format/Format.cpp | |
parent | 7d21eb3506fb64092aacb140b83b0fc59373661c (diff) | |
download | bcm5719-llvm-291f64fd03a8057d4b260a3b74a7d109c017111a.tar.gz bcm5719-llvm-291f64fd03a8057d4b260a3b74a7d109c017111a.zip |
Add WebKit brace style configuration option.
Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:
* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.
Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.
Reviewers: djasper, klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D11837
llvm-svn: 244446
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 5c239069c07..55f90801ee7 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -98,6 +98,7 @@ template <> struct ScalarEnumerationTraits<FormatStyle::BraceBreakingStyle> { IO.enumCase(Value, "Stroustrup", FormatStyle::BS_Stroustrup); IO.enumCase(Value, "Allman", FormatStyle::BS_Allman); IO.enumCase(Value, "GNU", FormatStyle::BS_GNU); + IO.enumCase(Value, "WebKit", FormatStyle::BS_WebKit); } }; @@ -504,7 +505,7 @@ FormatStyle getWebKitStyle() { Style.AlignOperands = false; Style.AlignTrailingComments = false; Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All; - Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup; + Style.BreakBeforeBraces = FormatStyle::BS_WebKit; Style.BreakConstructorInitializersBeforeComma = true; Style.Cpp11BracedListStyle = false; Style.ColumnLimit = 0; |