summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-08-13 09:09:09 +0000
committerDaniel Jasper <djasper@google.com>2013-08-13 09:09:09 +0000
commit29a98cfca07228406a000967b8e9291869b07e1f (patch)
treedff12df7b4f76a37521b5eb7e5dfe3be2ab15aa7 /clang/lib/Format/TokenAnnotator.cpp
parent70dc91aaf15ac676101eab5eb3dba1a0eda6bf2d (diff)
downloadbcm5719-llvm-29a98cfca07228406a000967b8e9291869b07e1f.tar.gz
bcm5719-llvm-29a98cfca07228406a000967b8e9291869b07e1f.zip
clang-format: Improve boolean expression formatting in macros.
Before: #define IF(a, b, c) if (a&&(b == c)) After: #define IF(a, b, c) if (a && (b == c)) llvm-svn: 188256
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 4feddfd8d4d..94acbd3e4e7 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -93,7 +93,8 @@ private:
}
}
- if (Left->Previous && Left->Previous->is(tok::kw_static_assert))
+ if (Left->Previous && Left->Previous->isOneOf(tok::kw_static_assert,
+ tok::kw_if, tok::kw_while))
Contexts.back().IsExpression = true;
if (StartsObjCMethodExpr) {
OpenPOWER on IntegriCloud