diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-15 15:47:20 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-03-15 15:47:20 +0000 |
commit | 4f4bf7c3482598c02bea7fbe9bbcca56ac720313 (patch) | |
tree | 9d22d71fca84678cbb814b489d172fb2d714b35d /clang/lib/Parse/ParseOpenMP.cpp | |
parent | 1110c4d33675f4351c080e621dbf8ee298ef13ae (diff) | |
download | bcm5719-llvm-4f4bf7c3482598c02bea7fbe9bbcca56ac720313.tar.gz bcm5719-llvm-4f4bf7c3482598c02bea7fbe9bbcca56ac720313.zip |
[OPENMP] Codegen for `omp declare target` construct.
Added initial codegen for device side of declarations inside `omp
declare target` construct + codegen for implicit `declare target`
functions, which are used in the target regions.
llvm-svn: 327636
Diffstat (limited to 'clang/lib/Parse/ParseOpenMP.cpp')
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index d34fad8fad2..77c5d23b14a 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -758,6 +758,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( if (!Actions.ActOnStartOpenMPDeclareTargetDirective(DTLoc)) return DeclGroupPtrTy(); + llvm::SmallVector<Decl *, 4> Decls; DKind = ParseOpenMPDirectiveKind(*this); while (DKind != OMPD_end_declare_target && DKind != OMPD_declare_target && Tok.isNot(tok::eof) && Tok.isNot(tok::r_brace)) { @@ -772,6 +773,10 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( Ptr = ParseCXXClassMemberDeclarationWithPragmas(AS, Attrs, TagType, Tag); } + if (Ptr) { + DeclGroupRef Ref = Ptr.get(); + Decls.append(Ref.begin(), Ref.end()); + } if (Tok.isAnnotation() && Tok.is(tok::annot_pragma_openmp)) { TentativeParsingAction TPA(*this); ConsumeAnnotationToken(); @@ -797,7 +802,8 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( Diag(DTLoc, diag::note_matching) << "'#pragma omp declare target'"; } Actions.ActOnFinishOpenMPDeclareTargetDirective(); - return DeclGroupPtrTy(); + return DeclGroupPtrTy::make(DeclGroupRef::Create( + Actions.getASTContext(), Decls.begin(), Decls.size())); } case OMPD_unknown: Diag(Tok, diag::err_omp_unknown_directive); |