aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-09 08:36:49 +0000
committerDaniel Jasper <djasper@google.com>2013-01-09 08:36:49 +0000
commit886568dc24eb0a1ccf73bf32d1eafa8fd4008cc6 (patch)
tree7707b332270a9fb01ea6c2602c9fc11f385928c2 /lib/Format/Format.cpp
parent9c837d05c9e6d6971900d36b1e462ed3666b7487 (diff)
Fix ObjC block declarations.
Before: int ( ^ Block1) (int, int) = ^ (int i, int j) After: int (^Block1) (int, int) = ^(int i, int j) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index e8c6210fae..16e8c2d6c5 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -846,8 +846,9 @@ private:
if (Current.Type == TT_Unknown) {
if (Current.is(tok::star) || Current.is(tok::amp)) {
Current.Type = determineStarAmpUsage(Current, IsRHS);
- } else if (Current.is(tok::minus) || Current.is(tok::plus)) {
- Current.Type = determinePlusMinusUsage(Current);
+ } else if (Current.is(tok::minus) || Current.is(tok::plus) ||
+ Current.is(tok::caret)) {
+ Current.Type = determinePlusMinusCaretUsage(Current);
} else if (Current.is(tok::minusminus) || Current.is(tok::plusplus)) {
Current.Type = determineIncrementUsage(Current);
} else if (Current.is(tok::exclaim)) {
@@ -905,7 +906,7 @@ private:
return TT_PointerOrReference;
}
- TokenType determinePlusMinusUsage(const AnnotatedToken &Tok) {
+ TokenType determinePlusMinusCaretUsage(const AnnotatedToken &Tok) {
// At the start of the line, +/- specific ObjectiveC method declarations.
if (Tok.Parent == NULL)
return TT_ObjCMethodSpecifier;