summaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-18 08:26:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-18 08:26:59 +0000
commit5a4cb1eb0c4e2560397c009da45d57bb1ebb6135 (patch)
tree4b0e7bd16ff6d9639594693aca2d6931a71b1dec /lib/AST/ASTContext.cpp
parent46faa67da1d7e9450e8fa363f6633e2c68e33ff1 (diff)
Vendor import of clang release_70 branch r339999:vendor/clang/clang-release_70-r339999
Notes
svn path=/vendor/clang/dist-release_70/; revision=338002 svn path=/vendor/clang/clang-release_70-r339999/; revision=338003; tag=vendor/clang/clang-release_70-r339999
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index d50f4493788a..c085f52cae31 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -9798,20 +9798,16 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
return true;
// If the decl is marked as `declare target`, it should be emitted.
- for (const auto *Decl : D->redecls()) {
- if (!Decl->hasAttrs())
- continue;
- if (const auto *Attr = Decl->getAttr<OMPDeclareTargetDeclAttr>())
- if (Attr->getMapType() != OMPDeclareTargetDeclAttr::MT_Link)
- return true;
- }
+ if (const llvm::Optional<OMPDeclareTargetDeclAttr::MapTypeTy> Res =
+ OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD))
+ return *Res != OMPDeclareTargetDeclAttr::MT_Link;
return false;
}
void ASTContext::forEachMultiversionedFunctionVersion(
const FunctionDecl *FD,
- llvm::function_ref<void(const FunctionDecl *)> Pred) const {
+ llvm::function_ref<void(FunctionDecl *)> Pred) const {
assert(FD->isMultiVersion() && "Only valid for multiversioned functions");
llvm::SmallDenseSet<const FunctionDecl*, 4> SeenDecls;
FD = FD->getCanonicalDecl();