diff options
author | Reuben Thomas <reuben.thomas@me.com> | 2019-03-30 12:32:35 +0000 |
---|---|---|
committer | Reuben Thomas <reuben.thomas@me.com> | 2019-03-30 12:32:35 +0000 |
commit | 08a940d629fa218670caaa949095bc5026f019b3 (patch) | |
tree | 5f6f2644cc3aaebdad6d6c92daa967f247b482ec /clang/lib/Format/Format.cpp | |
parent | c4ac74fb4987c083fa8e7e10f0f978ecee9402c0 (diff) | |
download | bcm5719-llvm-08a940d629fa218670caaa949095bc5026f019b3.tar.gz bcm5719-llvm-08a940d629fa218670caaa949095bc5026f019b3.zip |
[clang-format]: Add NonEmptyParentheses spacing option
This patch aims to add support for the following rules from the JUCE coding standards:
- Always put a space before an open parenthesis that contains text - e.g. foo (123);
- Never put a space before an empty pair of open/close parenthesis - e.g. foo();
Patch by Reuben Thomas
Differential Revision: https://reviews.llvm.org/D55170
llvm-svn: 357344
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 39651ab74d6..da852399761 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -285,6 +285,8 @@ struct ScalarEnumerationTraits<FormatStyle::SpaceBeforeParensOptions> { IO.enumCase(Value, "Never", FormatStyle::SBPO_Never); IO.enumCase(Value, "ControlStatements", FormatStyle::SBPO_ControlStatements); + IO.enumCase(Value, "NonEmptyParentheses", + FormatStyle::SBPO_NonEmptyParentheses); IO.enumCase(Value, "Always", FormatStyle::SBPO_Always); // For backward compatibility. |