diff options
Diffstat (limited to 'include/clang/Basic/Attr.td')
-rw-r--r-- | include/clang/Basic/Attr.td | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index fea8e129d7da6..1f17819dba74d 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -2938,9 +2938,10 @@ def OMPDeclareSimdDecl : Attr { }]; } -def OMPDeclareTargetDecl : Attr { +def OMPDeclareTargetDecl : InheritableAttr { let Spellings = [Pragma<"omp", "declare target">]; let SemaHandler = 0; + let Subjects = SubjectList<[Function, SharedVar]>; let Documentation = [OMPDeclareTargetDocs]; let Args = [ EnumArgument<"MapType", "MapTypeTy", @@ -2953,6 +2954,15 @@ def OMPDeclareTargetDecl : Attr { if (getMapType() != MT_To) OS << ' ' << ConvertMapTypeTyToStr(getMapType()); } + static llvm::Optional<MapTypeTy> + isDeclareTargetDeclaration(const ValueDecl *VD) { + if (!VD->hasAttrs()) + return llvm::None; + if (const auto *Attr = VD->getAttr<OMPDeclareTargetDeclAttr>()) + return Attr->getMapType(); + + return llvm::None; + } }]; } |