diff options
Diffstat (limited to 'compilerplugins/clang/compat.hxx')
-rw-r--r-- | compilerplugins/clang/compat.hxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index df4052ef108a..d122933eeaaf 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -82,6 +82,24 @@ constexpr clang::ExprValueKind VK_PRValue = clang::VK_PRValue; constexpr clang::ExprValueKind VK_PRValue = clang::VK_RValue; #endif +namespace CXXConstructionKind +{ +#if CLANG_VERSION >= 180000 +constexpr clang::CXXConstructionKind Complete = clang::CXXConstructionKind::Complete; +#else +constexpr clang::CXXConstructExpr::ConstructionKind Complete = clang::CXXConstructExpr::CK_Complete; +#endif +} + +namespace CharacterLiteralKind +{ +#if CLANG_VERSION >= 180000 +constexpr clang::CharacterLiteralKind Ascii = clang::CharacterLiteralKind::Ascii; +#else +constexpr clang::CharacterLiteral::CharacterKind Ascii = clang::CharacterLiteral::Ascii; +#endif +} + namespace ElaboratedTypeKeyword { #if CLANG_VERSION >= 180000 @@ -102,6 +120,28 @@ constexpr clang::Linkage Module = clang::ModuleLinkage; #endif } +namespace StringLiteralKind +{ +#if CLANG_VERSION >= 180000 +constexpr clang::StringLiteralKind UTF8 = clang::StringLiteralKind::UTF8; +#else +constexpr clang::StringLiteral::StringKind UTF8 = clang::StringLiteral::UTF8; +#endif +} + +namespace TagTypeKind +{ +#if CLANG_VERSION >= 180000 +constexpr clang::TagTypeKind Class = clang::TagTypeKind::Class; +constexpr clang::TagTypeKind Struct = clang::TagTypeKind::Struct; +constexpr clang::TagTypeKind Union = clang::TagTypeKind::Union; +#else +constexpr clang::TagTypeKind Class = clang::TTK_Class; +constexpr clang::TagTypeKind Struct = clang::TTK_Struct; +constexpr clang::TagTypeKind Union = clang::TTK_Union; +#endif +} + inline bool EvaluateAsInt(clang::Expr const * expr, llvm::APSInt& intRes, const clang::ASTContext& ctx) { clang::Expr::EvalResult res; bool b = expr->EvaluateAsInt(res, ctx); |