summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-02-26 17:21:37 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-02-27 11:45:20 +0100
commit005ee4fc396b998a34fb5a9e03e9e6ef4e46cc34 (patch)
treebbb7cf3614be7582eddb38f4e5ac1d593f6cf0f1 /compilerplugins
parentd1057d2fc205dc47d845b3e5738a54c68824e90b (diff)
Adapt compilerplugins to Clang trunk towards 3.7
Change-Id: I5b41039bf63a4c2f313fe7a57c0f6934dcb0752d (cherry picked from commit 193957750ab857dc5e01ee7259964ee92a54ee0d)
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/compat.hxx16
-rw-r--r--compilerplugins/clang/salbool.cxx3
2 files changed, 11 insertions, 8 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index e0e3cbbc7d92..4727d556c4d8 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -168,9 +168,15 @@ inline std::unique_ptr<llvm::raw_fd_ostream> create_raw_fd_ostream(
#endif
}
-inline clang::NamedDecl * const * begin(
- clang::DeclContextLookupConstResult const & result)
-{
+#if (__clang_major__ == 3 && __clang_minor__ >= 7) || __clang_major__ > 3
+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
return result.begin();
#else
@@ -178,9 +184,7 @@ inline clang::NamedDecl * const * begin(
#endif
}
-inline clang::NamedDecl * const * end(
- clang::DeclContextLookupConstResult const & result)
-{
+inline DeclContextLookupIterator end(DeclContextLookupResult const & result) {
#if (__clang_major__ == 3 && __clang_minor__ >= 3) || __clang_major__ > 3
return result.end();
#else
diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx
index b32c0a758b94..f5ee945db673 100644
--- a/compilerplugins/clang/salbool.cxx
+++ b/compilerplugins/clang/salbool.cxx
@@ -85,8 +85,7 @@ OverrideKind getOverrideKind(FunctionDecl const * decl) {
// encounter in practice:
bool hasBoolOverload(FunctionDecl const * decl, bool mustBeDeleted) {
unsigned n = decl->getNumParams();
- DeclContextLookupConstResult res
- = decl->getDeclContext()->lookup(decl->getDeclName());
+ auto res = decl->getDeclContext()->lookup(decl->getDeclName());
for (auto d = compat::begin(res); d != compat::end(res); ++d) {
FunctionDecl const * f = dyn_cast<FunctionDecl>(*d);
if (f != nullptr && (!mustBeDeleted || f->isDeleted())) {