diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-08-14 18:31:20 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-08-14 18:31:20 +0000 |
commit | 97b722121e8559d0e159beef2f3dd830cd837367 (patch) | |
tree | a20eb1f09268367d08d1320ba38a1a1bb00006a9 /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | |
parent | 60a1e4dddc367a35f7ae5018ef7cda06fd8ab3c1 (diff) | |
download | bcm5719-llvm-97b722121e8559d0e159beef2f3dd830cd837367.tar.gz bcm5719-llvm-97b722121e8559d0e159beef2f3dd830cd837367.zip |
[OPENMP] Fix processing of declare target construct.
The attribute marked as inheritable since OpenMP 5.0 supports it +
additional fixes to support new functionality.
llvm-svn: 339704
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index c8d7a23032a..0fd261150f2 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -191,20 +191,10 @@ class CheckVarsEscapingDeclContext final bool AllEscaped = false; bool IsForCombinedParallelRegion = false; - static llvm::Optional<OMPDeclareTargetDeclAttr::MapTypeTy> - isDeclareTargetDeclaration(const ValueDecl *VD) { - for (const Decl *D : VD->redecls()) { - if (!D->hasAttrs()) - continue; - if (const auto *Attr = D->getAttr<OMPDeclareTargetDeclAttr>()) - return Attr->getMapType(); - } - return llvm::None; - } - void markAsEscaped(const ValueDecl *VD) { // Do not globalize declare target variables. - if (!isa<VarDecl>(VD) || isDeclareTargetDeclaration(VD)) + if (!isa<VarDecl>(VD) || + OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD)) return; VD = cast<ValueDecl>(VD->getCanonicalDecl()); // Variables captured by value must be globalized. |