diff options
author | Daniel Jasper <djasper@google.com> | 2013-07-12 15:14:05 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-07-12 15:14:05 +0000 |
commit | 77d5d31320de9b73940adcefd8cf8eeeecb7631f (patch) | |
tree | df0df3e1c1386314977d7b2264e06d2da4202c5b /clang/lib/Format/Format.cpp | |
parent | 764d8d3d6f0c94ba80509da083fe62cdefdab582 (diff) | |
download | bcm5719-llvm-77d5d31320de9b73940adcefd8cf8eeeecb7631f.tar.gz bcm5719-llvm-77d5d31320de9b73940adcefd8cf8eeeecb7631f.zip |
clang-format: Improve <<-formatting.
This fixes a regression caused by r186115.
Before:
Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
bbbbbbbbb) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
After:
Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb)
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<< aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
llvm-svn: 186164
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 224f1d759fb..e1a0874e068 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1174,6 +1174,11 @@ private: State.Stack.back().BreakBeforeParameter) return true; + // Same as above, but for the first "<<" operator. + if (Current.is(tok::lessless) && State.Stack.back().BreakBeforeParameter && + State.Stack.back().FirstLessLess == 0) + return true; + // FIXME: Comparing LongestObjCSelectorName to 0 is a hacky way of finding // out whether it is the first parameter. Clean this up. if (Current.Type == TT_ObjCSelectorName && |