diff options
author | Daniel Jasper <djasper@google.com> | 2014-04-08 12:46:38 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-04-08 12:46:38 +0000 |
commit | d74cf40386ac321fca0aed6404647667d2ef00f7 (patch) | |
tree | 34c11655e5f4982bc936312ef7122a1a81e80f8e /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 9eb8c92b526b13491565585b0d33159d624bf811 (diff) | |
download | bcm5719-llvm-d74cf40386ac321fca0aed6404647667d2ef00f7.tar.gz bcm5719-llvm-d74cf40386ac321fca0aed6404647667d2ef00f7.zip |
clang-format: Extend AllowShortFunctions.. to only merge inline functions.
Before AllowShortFunctionsOnASingleLine could either be true, merging
all functions, or false, merging no functions. This patch adds a third
value "Inline", which can be used to only merge short functions defined
inline in a class, i.e.:
void f() {
return 42;
}
class C {
void f() { return 42; }
};
llvm-svn: 205760
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 5a3dee63870..5317fb33ffb 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -145,7 +145,7 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { getLengthToMatchingParen(Previous) + State.Column > getColumnLimit(State)) return true; if (Current.Type == TT_CtorInitializerColon && - (!Style.AllowShortFunctionsOnASingleLine || + ((Style.AllowShortFunctionsOnASingleLine != FormatStyle::SFS_All) || Style.BreakConstructorInitializersBeforeComma || Style.ColumnLimit != 0)) return true; |