summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-28 15:04:12 +0000
committerDaniel Jasper <djasper@google.com>2013-02-28 15:04:12 +0000
commita400cab43adcc7361433e28a48a38f655e34a632 (patch)
treec1a1ea0e655e8b94ab62cc0e1e85b10e1ae5e097 /clang/lib
parentce17020c973e7b25aac23405b2a7812f40c1bb5b (diff)
downloadbcm5719-llvm-a400cab43adcc7361433e28a48a38f655e34a632.tar.gz
bcm5719-llvm-a400cab43adcc7361433e28a48a38f655e34a632.zip
Reduce penalty for splitting after "{" in static initializers.
This fixes llvm.org/PR15379. Before: const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00 // comment }; After: const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00 // comment }; llvm-svn: 176262
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index e127f4af8e5..b9e35126ec1 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -880,8 +880,6 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
else
return 100;
}
- if (Left.is(tok::l_brace) && Right.isNot(tok::l_brace))
- return 50;
if (Left.is(tok::equal) && Right.is(tok::l_brace))
return 150;
if (Left.is(tok::coloncolon))
@@ -917,7 +915,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
return 20;
if (Left.is(tok::l_paren) || Left.is(tok::l_square) ||
- Left.Type == TT_TemplateOpener)
+ Left.is(tok::l_brace) || Left.Type == TT_TemplateOpener)
return 20;
if (Right.is(tok::lessless)) {
OpenPOWER on IntegriCloud