aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-03-14 09:50:46 +0000
committerDaniel Jasper <djasper@google.com>2013-03-14 09:50:46 +0000
commit8ef19a22956defa392df46c79e2d499ab7b16647 (patch)
treed06c7cce5b97b977e4325909fe554f23a4b1e357 /lib/Format/TokenAnnotator.cpp
parentc3ae583a9a2e0e5c862a94b678c7cdfaab46a981 (diff)
Improve formatting of trailing annotations.
Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__(( unused)); After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((unused)); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/TokenAnnotator.cpp')
-rw-r--r--lib/Format/TokenAnnotator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp
index db5924c8a5..0b8f286ebe 100644
--- a/lib/Format/TokenAnnotator.cpp
+++ b/lib/Format/TokenAnnotator.cpp
@@ -1111,12 +1111,12 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
Left.Parent->is(tok::r_paren))
return !Right.isOneOf(tok::l_brace, tok::semi, tok::equal);
+ if (Right.is(tok::kw___attribute))
+ return true;
+
// We only break before r_brace if there was a corresponding break before
// the l_brace, which is tracked by BreakBeforeClosingBrace.
- if (Right.is(tok::r_brace))
- return false;
-
- if (Right.isOneOf(tok::r_paren, tok::greater))
+ if (Right.isOneOf(tok::r_brace, tok::r_paren, tok::greater))
return false;
if (Left.is(tok::identifier) && Right.is(tok::string_literal))
return true;