From 305058753c6d01bf18a1860d2e86a3946f1cc3bf Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 25 Sep 2019 19:43:37 +0000 Subject: [OPENMP50]Parsing/sema support for 'implementation/vendor' context selector. Added basic parsing/semantic support for 'implementation={vendor()}' context selector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372917 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaOpenMP.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/Sema/SemaOpenMP.cpp') diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index 34ce66c4e3..0403f11f6b 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -5101,11 +5101,14 @@ Sema::checkOpenMPDeclareVariantFunction(Sema::DeclGroupPtrTy DG, return std::make_pair(FD, cast(DRE)); } -void Sema::ActOnOpenMPDeclareVariantDirective(FunctionDecl *FD, - Expr *VariantRef, - SourceRange SR) { - auto *NewAttr = - OMPDeclareVariantAttr::CreateImplicit(Context, VariantRef, SR); +void Sema::ActOnOpenMPDeclareVariantDirective( + FunctionDecl *FD, Expr *VariantRef, SourceRange SR, + const Sema::OpenMPDeclareVariantCtsSelectorData &Data) { + if (Data.CtxSet == OMPDeclareVariantAttr::CtxSetUnknown || + Data.Ctx == OMPDeclareVariantAttr::CtxUnknown) + return; + auto *NewAttr = OMPDeclareVariantAttr::CreateImplicit( + Context, VariantRef, Data.CtxSet, Data.Ctx, Data.ImplVendor, SR); FD->addAttr(NewAttr); } -- cgit v1.2.1