Kaydet (Commit) 19395775 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Adapt compilerplugins to Clang trunk towards 3.7

Change-Id: I5b41039bf63a4c2f313fe7a57c0f6934dcb0752d
üst c5721376
...@@ -176,9 +176,15 @@ inline std::unique_ptr<llvm::raw_fd_ostream> create_raw_fd_ostream( ...@@ -176,9 +176,15 @@ inline std::unique_ptr<llvm::raw_fd_ostream> create_raw_fd_ostream(
#endif #endif
} }
inline clang::NamedDecl * const * begin( #if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
clang::DeclContextLookupConstResult const & result) typedef clang::DeclContext::lookup_result DeclContextLookupResult;
{ typedef clang::DeclContext::lookup_iterator DeclContextLookupIterator;
#else
typedef clang::DeclContext::lookup_const_result DeclContextLookupResult;
typedef clang::DeclContext::lookup_const_iterator DeclContextLookupIterator;
#endif
inline DeclContextLookupIterator begin(DeclContextLookupResult const & result) {
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3 #if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return result.begin(); return result.begin();
#else #else
...@@ -186,9 +192,7 @@ inline clang::NamedDecl * const * begin( ...@@ -186,9 +192,7 @@ inline clang::NamedDecl * const * begin(
#endif #endif
} }
inline clang::NamedDecl * const * end( inline DeclContextLookupIterator end(DeclContextLookupResult const & result) {
clang::DeclContextLookupConstResult const & result)
{
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3 #if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return result.end(); return result.end();
#else #else
......
...@@ -85,8 +85,7 @@ OverrideKind getOverrideKind(FunctionDecl const * decl) { ...@@ -85,8 +85,7 @@ OverrideKind getOverrideKind(FunctionDecl const * decl) {
// encounter in practice: // encounter in practice:
bool hasBoolOverload(FunctionDecl const * decl, bool mustBeDeleted) { bool hasBoolOverload(FunctionDecl const * decl, bool mustBeDeleted) {
unsigned n = decl->getNumParams(); unsigned n = decl->getNumParams();
DeclContextLookupConstResult res auto res = decl->getDeclContext()->lookup(decl->getDeclName());
= decl->getDeclContext()->lookup(decl->getDeclName());
for (auto d = compat::begin(res); d != compat::end(res); ++d) { for (auto d = compat::begin(res); d != compat::end(res); ++d) {
FunctionDecl const * f = dyn_cast<FunctionDecl>(*d); FunctionDecl const * f = dyn_cast<FunctionDecl>(*d);
if (f != nullptr && (!mustBeDeleted || f->isDeleted())) { if (f != nullptr && (!mustBeDeleted || f->isDeleted())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment