Adapt to current Clang trunk towards 3.7

Change-Id: Ibb2c641d49a1773be789c9259f53a040db6f605f
This commit is contained in:
Stephan Bergmann
2015-08-04 09:36:32 +02:00
parent f17f89aadc
commit c15b4cf39a
7 changed files with 77 additions and 12 deletions

View File

@@ -65,6 +65,18 @@ inline bool isInExternCContext(clang::FunctionDecl const & decl) {
#endif
}
inline bool forallBases(
clang::CXXRecordDecl const & decl,
clang::CXXRecordDecl::ForallBasesCallback BaseMatches,
bool AllowShortCircuit)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
return decl.forallBases(BaseMatches, AllowShortCircuit);
#else
return decl.forallBases(BaseMatches, nullptr, AllowShortCircuit);
#endif
}
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
typedef clang::LinkageInfo LinkageInfo;
#else
@@ -129,6 +141,26 @@ inline clang::QualType getParamType(
#endif
}
inline clang::Stmt::const_child_iterator begin(
clang::Stmt::const_child_range const & range)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
return range.begin();
#else
return range.first;
#endif
}
inline clang::Stmt::const_child_iterator end(
clang::Stmt::const_child_range const & range)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
return range.end();
#else
return range.second;
#endif
}
inline unsigned getBuiltinCallee(clang::CallExpr const & expr) {
#if (__clang_major__ == 3 && __clang_minor__ >= 5) || __clang_major__ > 3
return expr.getBuiltinCallee();