diff options
author | Daniel Jasper <djasper@google.com> | 2013-11-08 17:33:27 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-11-08 17:33:27 +0000 |
commit | 98fb6e1b9f1fa88dddfc7fb1278302bb760ea050 (patch) | |
tree | aef50d2d9f4d74b0ba0951641f76cf6a11d9a66f /clang/lib/Format/Format.cpp | |
parent | 4478e5245e208e63d4fe7cdc218f7e9a7aa29978 (diff) | |
download | bcm5719-llvm-98fb6e1b9f1fa88dddfc7fb1278302bb760ea050.tar.gz bcm5719-llvm-98fb6e1b9f1fa88dddfc7fb1278302bb760ea050.zip |
clang-format: Don't auto-break short macros in WebKit style.
This fixes llvm.org/PR17842.
llvm-svn: 194268
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r-- | clang/lib/Format/Format.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index f2899345fbd..a5fc83e84e4 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -391,7 +391,8 @@ public: if (Indent > Style.ColumnLimit) return 0; - unsigned Limit = Style.ColumnLimit - Indent; + unsigned Limit = + Style.ColumnLimit == 0 ? UINT_MAX : Style.ColumnLimit - Indent; // If we already exceed the column limit, we set 'Limit' to 0. The different // tryMerge..() functions can then decide whether to still do merging. Limit = TheLine->Last->TotalLength > Limit @@ -757,6 +758,7 @@ private: assert(!B.First->Previous); A.Last->Next = B.First; B.First->Previous = A.Last; + B.First->CanBreakBefore = true; unsigned LengthA = A.Last->TotalLength + B.First->SpacesRequiredBefore; for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { Tok->TotalLength += LengthA; |