summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-08-28 10:03:58 +0000
committerDaniel Jasper <djasper@google.com>2013-08-28 10:03:58 +0000
commit2739af3b9cce00b7bda893162ccb2e7951f7c2e7 (patch)
tree421b10b9954217cb11e8004d616a1658fa7dd74b /clang/lib/Format/Format.cpp
parent2d999ebb84280a50c2547293cfa44d323d66de1f (diff)
downloadbcm5719-llvm-2739af3b9cce00b7bda893162ccb2e7951f7c2e7.tar.gz
bcm5719-llvm-2739af3b9cce00b7bda893162ccb2e7951f7c2e7.zip
clang-format: Improve token breaking behavior.
Two changes: * Don't add an extra penalty on breaking the same token multiple times. Generally, we should prefer not to break, but once we break, the normal line breaking penalties apply. * Slightly increase the penalty for breaking comments. In general, the author has put some thought into how to break the comment and we should not overwrite this unnecessarily. With a 40-column column limit, formatting aaaaaa("aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa"); Leads to: Before: aaaaaa( "aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa " "aaaaaaaaaaaaaaaa"); After: aaaaaa("aaaaaaaaaaaaaaaa " "aaaaaaaaaaaaaaaa " "aaaaaaaaaaaaaaaa"); llvm-svn: 189466
Diffstat (limited to 'clang/lib/Format/Format.cpp')
-rw-r--r--clang/lib/Format/Format.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 1cd55d72973..3982ba6a771 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -152,7 +152,7 @@ namespace clang {
namespace format {
void setDefaultPenalties(FormatStyle &Style) {
- Style.PenaltyBreakComment = 45;
+ Style.PenaltyBreakComment = 60;
Style.PenaltyBreakFirstLessLess = 120;
Style.PenaltyBreakString = 1000;
Style.PenaltyExcessCharacter = 1000000;
OpenPOWER on IntegriCloud