From 7980348fcf3a0f1da7352728493f00ff78852afb Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 23 Apr 2011 10:47:20 +0000 Subject: [PATCH] Sort the type traits in a few places where they weren't previously sorted in order to prepare for adding some new ones. llvm-svn: 130056 --- clang/include/clang/Basic/TokenKinds.def | 4 ++-- clang/include/clang/Basic/TypeTraits.h | 4 ++-- clang/lib/Lex/PPMacroExpansion.cpp | 2 +- clang/lib/Parse/ParseExpr.cpp | 10 +++++----- clang/lib/Parse/ParseExprCXX.cpp | 2 +- clang/lib/Parse/ParseTentative.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def index 5d6f26a7da08..6e0dd056a1af 100644 --- a/clang/include/clang/Basic/TokenKinds.def +++ b/clang/include/clang/Basic/TokenKinds.def @@ -336,11 +336,11 @@ KEYWORD(__is_class , KEYCXX) KEYWORD(__is_convertible_to , KEYCXX) KEYWORD(__is_empty , KEYCXX) KEYWORD(__is_enum , KEYCXX) +// Tentative name - there's no implementation of std::is_literal_type yet. +KEYWORD(__is_literal , KEYCXX) KEYWORD(__is_pod , KEYCXX) KEYWORD(__is_polymorphic , KEYCXX) KEYWORD(__is_union , KEYCXX) -// Tentative name - there's no implementation of std::is_literal_type yet. -KEYWORD(__is_literal , KEYCXX) // Apple Extension. KEYWORD(__private_extern__ , KEYALL) diff --git a/clang/include/clang/Basic/TypeTraits.h b/clang/include/clang/Basic/TypeTraits.h index 16a57a54851f..791ed34bc3f0 100644 --- a/clang/include/clang/Basic/TypeTraits.h +++ b/clang/include/clang/Basic/TypeTraits.h @@ -30,10 +30,10 @@ namespace clang { UTT_IsClass, UTT_IsEmpty, UTT_IsEnum, + UTT_IsLiteral, UTT_IsPOD, UTT_IsPolymorphic, - UTT_IsUnion, - UTT_IsLiteral + UTT_IsUnion }; /// BinaryTypeTrait - Names for the binary type traits. diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index f0b0fad488f5..64b0baf38329 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -587,10 +587,10 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("is_convertible_to", LangOpts.CPlusPlus) .Case("is_empty", LangOpts.CPlusPlus) .Case("is_enum", LangOpts.CPlusPlus) + .Case("is_literal", LangOpts.CPlusPlus) .Case("is_pod", LangOpts.CPlusPlus) .Case("is_polymorphic", LangOpts.CPlusPlus) .Case("is_union", LangOpts.CPlusPlus) - .Case("is_literal", LangOpts.CPlusPlus) .Case("tls", PP.getTargetInfo().isTLSSupported()) .Default(false); } diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index cf852f82e5c7..1a3290a43dbb 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -983,14 +983,14 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, return move(Result); } - case tok::kw___is_pod: // [GNU] unary-type-trait + case tok::kw___is_abstract: // [GNU] unary-type-trait case tok::kw___is_class: - case tok::kw___is_enum: - case tok::kw___is_union: case tok::kw___is_empty: - case tok::kw___is_polymorphic: - case tok::kw___is_abstract: + case tok::kw___is_enum: case tok::kw___is_literal: + case tok::kw___is_pod: + case tok::kw___is_polymorphic: + case tok::kw___is_union: case tok::kw___has_trivial_constructor: case tok::kw___has_trivial_copy: case tok::kw___has_trivial_assign: diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index ccc75125ad45..3c9ebc388bcb 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -1926,10 +1926,10 @@ static UnaryTypeTrait UnaryTypeTraitFromTokKind(tok::TokenKind kind) { case tok::kw___is_class: return UTT_IsClass; case tok::kw___is_empty: return UTT_IsEmpty; case tok::kw___is_enum: return UTT_IsEnum; + case tok::kw___is_literal: return UTT_IsLiteral; case tok::kw___is_pod: return UTT_IsPOD; case tok::kw___is_polymorphic: return UTT_IsPolymorphic; case tok::kw___is_union: return UTT_IsUnion; - case tok::kw___is_literal: return UTT_IsLiteral; } } diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp index 9522691b642f..cdfe8875d4cf 100644 --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -659,10 +659,10 @@ Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) { case tok::kw___is_convertible_to: case tok::kw___is_empty: case tok::kw___is_enum: + case tok::kw___is_literal: case tok::kw___is_pod: case tok::kw___is_polymorphic: case tok::kw___is_union: - case tok::kw___is_literal: case tok::kw___uuidof: return TPResult::True();