summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-03-26 16:40:55 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-03-26 16:40:55 +0000
commit92327c50d39586feeedd046eb73095dd9705cac6 (patch)
tree9b23b6db07b073ea408d41b1a0a872ed4f1ea884 /clang/lib/AST/ASTContext.cpp
parent3f72a6b7a1c616ae4f3c46b2c89a9da53fd24a51 (diff)
downloadbcm5719-llvm-92327c50d39586feeedd046eb73095dd9705cac6.tar.gz
bcm5719-llvm-92327c50d39586feeedd046eb73095dd9705cac6.zip
[OPENMP] Codegen for declare target with link clause.
If the link clause is used on the declare target directive, the object should be linked on target or target data directives, not during the codegen. Patch adds support for this clause. llvm-svn: 328544
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 619af9af0af..1c3495af1fb 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -9494,10 +9494,13 @@ 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->getMostRecentDecl(); Decl;
- Decl = Decl->getPreviousDecl())
- if (Decl->hasAttr<OMPDeclareTargetDeclAttr>())
- return true;
+ 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;
+ }
return false;
}
OpenPOWER on IntegriCloud