aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/FormatToken.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Format/FormatToken.cpp')
-rw-r--r--clang/lib/Format/FormatToken.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp
index cd94a9d..99405fb 100644
--- a/clang/lib/Format/FormatToken.cpp
+++ b/clang/lib/Format/FormatToken.cpp
@@ -18,8 +18,6 @@
namespace clang {
namespace format {
-bool IsCpp = false;
-
const char *getTokenTypeName(TokenType Type) {
static const char *const TokNames[] = {
#define TYPE(X) #X,
@@ -77,15 +75,15 @@ static SmallVector<StringRef> CppNonKeywordTypes = {
"uint32_t", "uint64_t", "uint8_t", "uintptr_t",
};
-bool FormatToken::isTypeName() const {
+bool FormatToken::isTypeName(bool IsCpp) const {
return is(TT_TypeName) || isSimpleTypeSpecifier() ||
(IsCpp && is(tok::identifier) &&
std::binary_search(CppNonKeywordTypes.begin(),
CppNonKeywordTypes.end(), TokenText));
}
-bool FormatToken::isTypeOrIdentifier() const {
- return isTypeName() || isOneOf(tok::kw_auto, tok::identifier);
+bool FormatToken::isTypeOrIdentifier(bool IsCpp) const {
+ return isTypeName(IsCpp) || isOneOf(tok::kw_auto, tok::identifier);
}
bool FormatToken::isBlockIndentedInitRBrace(const FormatStyle &Style) const {