diff options
author | Daniel Jasper <djasper@google.com> | 2013-04-11 14:29:13 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-04-11 14:29:13 +0000 |
commit | 1407bee187d7b964d5293ac8bf4f7a490c78cec6 (patch) | |
tree | 98953a2e6b0057cfa12cb6c8851a66041c57051d /lib/Format/Format.cpp | |
parent | a8262981683c4768f43e8b8bc507ab77fff0b216 (diff) |
Change clang-format's affinity for breaking after return types.
Function declarations are now broken with the following preferences:
1) break amongst arguments.
2) break after return type.
3) break after (.
4) break before after nested name specifiers.
Options #2 or #3 are preferred over #1 only if a substantial number of
lines can be saved by that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 98ae0bdbf9..e956f69875 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -48,7 +48,7 @@ FormatStyle getLLVMStyle() { LLVMStyle.AllowShortIfStatementsOnASingleLine = false; LLVMStyle.ObjCSpaceBeforeProtocolList = true; LLVMStyle.PenaltyExcessCharacter = 1000000; - LLVMStyle.PenaltyReturnTypeOnItsOwnLine = 5; + LLVMStyle.PenaltyReturnTypeOnItsOwnLine = 75; return LLVMStyle; } @@ -68,7 +68,7 @@ FormatStyle getGoogleStyle() { GoogleStyle.AllowShortIfStatementsOnASingleLine = false; GoogleStyle.ObjCSpaceBeforeProtocolList = false; GoogleStyle.PenaltyExcessCharacter = 1000000; - GoogleStyle.PenaltyReturnTypeOnItsOwnLine = 100; + GoogleStyle.PenaltyReturnTypeOnItsOwnLine = 200; return GoogleStyle; } @@ -1395,7 +1395,7 @@ public: // Adapt level to the next line if this is a comment. // FIXME: Can/should this be done in the UnwrappedLineParser? - const AnnotatedLine* NextNoneCommentLine = NULL; + const AnnotatedLine *NextNoneCommentLine = NULL; for (unsigned i = AnnotatedLines.size() - 1; i > 0; --i) { if (NextNoneCommentLine && AnnotatedLines[i].First.is(tok::comment) && AnnotatedLines[i].First.Children.empty()) |