diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-06-29 08:55:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-06-29 08:55:27 +0200 |
commit | 1ce7176ba1b39f02ab45056023f8e7622f48cc74 (patch) | |
tree | b891c603eac63fe4520ff51100a3d822160b719f /compilerplugins/clang/unreffun.cxx | |
parent | 6439d93cbe64bacba1bcb858dd7cbb6a33fca60b (diff) |
Remove support for Clang < 3.3
Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
Diffstat (limited to 'compilerplugins/clang/unreffun.cxx')
-rw-r--r-- | compilerplugins/clang/unreffun.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/compilerplugins/clang/unreffun.cxx b/compilerplugins/clang/unreffun.cxx index 36e181640d6b..73c74dbffc1f 100644 --- a/compilerplugins/clang/unreffun.cxx +++ b/compilerplugins/clang/unreffun.cxx @@ -33,15 +33,9 @@ bool hasCLanguageLinkageType(FunctionDecl const * decl) { if (decl->isExternC()) { return true; } -#if CLANG_VERSION >= 30300 if (decl->isInExternCContext()) { return true; } -#else - if (decl->getCanonicalDecl()->getDeclContext()->isExternCContext()) { - return true; - } -#endif return false; } @@ -134,13 +128,13 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) { { return true; } - compat::LinkageInfo info(canon->getLinkageAndVisibility()); - if (compat::getLinkage(info) == ExternalLinkage + LinkageInfo info(canon->getLinkageAndVisibility()); + if (info.getLinkage() == ExternalLinkage && hasCLanguageLinkageType(canon) && canon->isDefined() - && ((decl == canon && compat::getVisibility(info) == DefaultVisibility) + && ((decl == canon && info.getVisibility() == DefaultVisibility) || ((canon->hasAttr<ConstructorAttr>() || canon->hasAttr<DestructorAttr>()) - && compat::getVisibility(info) == HiddenVisibility))) + && info.getVisibility() == HiddenVisibility))) { return true; } |