summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-10-21 10:58:14 +0000
committerDaniel Jasper <djasper@google.com>2014-10-21 10:58:14 +0000
commitfd68191db4ae3ec5b2626cc5414fc6772efc1d7c (patch)
tree5898abe58fc3eb6988043be0d5260028d8c9d4f9 /clang/lib/Format
parent171eb8dbeb41681b00290053fb3b44cb3222977d (diff)
downloadbcm5719-llvm-fd68191db4ae3ec5b2626cc5414fc6772efc1d7c.tar.gz
bcm5719-llvm-fd68191db4ae3ec5b2626cc5414fc6772efc1d7c.zip
clang-format: [Java] Improve annotation handling.
Before: @SuppressWarnings( value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii; After: @SuppressWarnings(value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii; llvm-svn: 220284
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 ba08ace1e8b..9adec611f28 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1817,6 +1817,8 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
return false;
if (Left.Tok.getObjCKeywordID() == tok::objc_interface)
return false;
+ if (Left.Type == TT_JavaAnnotation)
+ return true;
if (Right.Type == TT_StartOfName ||
Right.Type == TT_FunctionDeclarationName || Right.is(tok::kw_operator))
return true;
OpenPOWER on IntegriCloud