summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-07-11 12:34:23 +0000
committerDaniel Jasper <djasper@google.com>2013-07-11 12:34:23 +0000
commit40db06af64570f0c4e627d5c0cd6a3e388ca3ccb (patch)
treed32ad7b360c09643b6e6b0112b9ff9d83a57b147 /clang/lib/Format
parent69278e9ac8b7046969bc6576f56c2c9e53fea69c (diff)
downloadbcm5719-llvm-40db06af64570f0c4e627d5c0cd6a3e388ca3ccb.tar.gz
bcm5719-llvm-40db06af64570f0c4e627d5c0cd6a3e388ca3ccb.zip
Keep trailing annotations close to their argument.
Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY( aaaaaaaaaaaa); After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa); llvm-svn: 186077
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index f5b6fbde7c9..1e4de6eb943 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1020,6 +1020,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
if (Right.Type == TT_StartOfName || Right.is(tok::kw_operator)) {
if (Line.First->is(tok::kw_for) && Right.PartOfMultiVariableDeclStmt)
return 3;
+ if (Left.Type == TT_StartOfName)
+ return 20;
else if (Line.MightBeFunctionDecl && Right.BindingStrength == 1)
// FIXME: Clean up hack of using BindingStrength to find top-level names.
return Style.PenaltyReturnTypeOnItsOwnLine;
OpenPOWER on IntegriCloud