diff options
author | Patrick Lyster <Patrick.lyster@ibm.com> | 2018-10-11 14:41:10 +0000 |
---|---|---|
committer | Patrick Lyster <Patrick.lyster@ibm.com> | 2018-10-11 14:41:10 +0000 |
commit | 851f70b951e5e068b0afa6f69ec58e0e80b0a1a4 (patch) | |
tree | c84f9b2e4f0280db12231998549f63b635884345 /lib | |
parent | bb45239209491f6df1cf5bac7896673d5864640a (diff) | |
download | clang-851f70b951e5e068b0afa6f69ec58e0e80b0a1a4.tar.gz |
Add support for 'dynamic_allocators' clause on 'requires' directive. Differential Revision: https://reviews.llvm.org/D53079
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/OpenMPClause.cpp | 2 | ||||
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 5 | ||||
-rw-r--r-- | lib/AST/StmtProfile.cpp | 3 | ||||
-rw-r--r-- | lib/Basic/OpenMPKinds.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGStmtOpenMP.cpp | 1 | ||||
-rw-r--r-- | lib/Parse/ParseOpenMP.cpp | 1 | ||||
-rw-r--r-- | lib/Sema/SemaOpenMP.cpp | 13 | ||||
-rw-r--r-- | lib/Sema/TreeTransform.h | 7 | ||||
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 7 | ||||
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 4 |
10 files changed, 45 insertions, 0 deletions
diff --git a/lib/AST/OpenMPClause.cpp b/lib/AST/OpenMPClause.cpp index 5642294f09..a39f8b06c5 100644 --- a/lib/AST/OpenMPClause.cpp +++ b/lib/AST/OpenMPClause.cpp @@ -109,6 +109,7 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) { case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: break; } @@ -181,6 +182,7 @@ const OMPClauseWithPostUpdate *OMPClauseWithPostUpdate::get(const OMPClause *C) case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: break; } diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index fc12ce9a5f..e9d351e868 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -709,6 +709,11 @@ void OMPClausePrinter::VisitOMPReverseOffloadClause(OMPReverseOffloadClause *) { OS << "reverse_offload"; } +void OMPClausePrinter::VisitOMPDynamicAllocatorsClause( + OMPDynamicAllocatorsClause *) { + OS << "dynamic_allocators"; +} + void OMPClausePrinter::VisitOMPScheduleClause(OMPScheduleClause *Node) { OS << "schedule("; if (Node->getFirstScheduleModifier() != OMPC_SCHEDULE_MODIFIER_unknown) { diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index 10b10254dd..2ad973436c 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -476,6 +476,9 @@ void OMPClauseProfiler::VisitOMPUnifiedSharedMemoryClause( void OMPClauseProfiler::VisitOMPReverseOffloadClause( const OMPReverseOffloadClause *C) {} +void OMPClauseProfiler::VisitOMPDynamicAllocatorsClause( + const OMPDynamicAllocatorsClause *C) {} + void OMPClauseProfiler::VisitOMPScheduleClause(const OMPScheduleClause *C) { VistOMPClauseWithPreInit(C); if (auto *S = C->getChunkSize()) diff --git a/lib/Basic/OpenMPKinds.cpp b/lib/Basic/OpenMPKinds.cpp index fa3c3dfd51..7693c4288b 100644 --- a/lib/Basic/OpenMPKinds.cpp +++ b/lib/Basic/OpenMPKinds.cpp @@ -171,6 +171,7 @@ unsigned clang::getOpenMPSimpleClauseType(OpenMPClauseKind Kind, case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: break; } llvm_unreachable("Invalid OpenMP simple clause kind"); @@ -315,6 +316,7 @@ const char *clang::getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: break; } llvm_unreachable("Invalid OpenMP simple clause kind"); diff --git a/lib/CodeGen/CGStmtOpenMP.cpp b/lib/CodeGen/CGStmtOpenMP.cpp index 7872a805cc..f410c59829 100644 --- a/lib/CodeGen/CGStmtOpenMP.cpp +++ b/lib/CodeGen/CGStmtOpenMP.cpp @@ -3901,6 +3901,7 @@ static void emitOMPAtomicExpr(CodeGenFunction &CGF, OpenMPClauseKind Kind, case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: llvm_unreachable("Clause is not allowed in 'omp atomic'."); } } diff --git a/lib/Parse/ParseOpenMP.cpp b/lib/Parse/ParseOpenMP.cpp index 94eabf4797..353bb80060 100644 --- a/lib/Parse/ParseOpenMP.cpp +++ b/lib/Parse/ParseOpenMP.cpp @@ -1381,6 +1381,7 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind, case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: // OpenMP [2.7.1, Restrictions, p. 9] // Only one ordered clause can appear on a loop directive. // OpenMP [2.7.1, Restrictions, C/C++, p. 4] diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index de78a1a520..d9f2973552 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -8013,6 +8013,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: llvm_unreachable("Clause is not allowed."); } return Res; @@ -8537,6 +8538,7 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause( case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: llvm_unreachable("Unexpected OpenMP clause."); } return CaptureRegion; @@ -8857,6 +8859,7 @@ OMPClause *Sema::ActOnOpenMPSimpleClause( case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: llvm_unreachable("Clause is not allowed."); } return Res; @@ -9016,6 +9019,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprWithArgClause( case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: llvm_unreachable("Clause is not allowed."); } return Res; @@ -9180,6 +9184,9 @@ OMPClause *Sema::ActOnOpenMPClause(OpenMPClauseKind Kind, case OMPC_reverse_offload: Res = ActOnOpenMPReverseOffloadClause(StartLoc, EndLoc); break; + case OMPC_dynamic_allocators: + Res = ActOnOpenMPDynamicAllocatorsClause(StartLoc, EndLoc); + break; case OMPC_if: case OMPC_final: case OMPC_num_threads: @@ -9295,6 +9302,11 @@ OMPClause *Sema::ActOnOpenMPReverseOffloadClause(SourceLocation StartLoc, return new (Context) OMPReverseOffloadClause(StartLoc, EndLoc); } +OMPClause *Sema::ActOnOpenMPDynamicAllocatorsClause(SourceLocation StartLoc, + SourceLocation EndLoc) { + return new (Context) OMPDynamicAllocatorsClause(StartLoc, EndLoc); +} + OMPClause *Sema::ActOnOpenMPVarListClause( OpenMPClauseKind Kind, ArrayRef<Expr *> VarList, Expr *TailExpr, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, @@ -9405,6 +9417,7 @@ OMPClause *Sema::ActOnOpenMPVarListClause( case OMPC_unified_address: case OMPC_unified_shared_memory: case OMPC_reverse_offload: + case OMPC_dynamic_allocators: llvm_unreachable("Clause is not allowed."); } return Res; diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 5d600b735a..73a522b2ea 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -8450,6 +8450,13 @@ OMPClause *TreeTransform<Derived>::TransformOMPReverseOffloadClause( } template <typename Derived> +OMPClause *TreeTransform<Derived>::TransformOMPDynamicAllocatorsClause( + OMPDynamicAllocatorsClause *C) { + llvm_unreachable( + "dynamic_allocators clause cannot appear in dependent context"); +} + +template <typename Derived> OMPClause * TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *C) { llvm::SmallVector<Expr *, 16> Vars; diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 7cf78175fb..5a29b2e33b 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -11729,6 +11729,9 @@ OMPClause *OMPClauseReader::readClause() { case OMPC_reverse_offload: C = new (Context) OMPReverseOffloadClause(); break; + case OMPC_dynamic_allocators: + C = new (Context) OMPDynamicAllocatorsClause(); + break; case OMPC_private: C = OMPPrivateClause::CreateEmpty(Context, Record.readInt()); break; @@ -11964,6 +11967,10 @@ void OMPClauseReader::VisitOMPUnifiedSharedMemoryClause( void OMPClauseReader::VisitOMPReverseOffloadClause(OMPReverseOffloadClause *) {} +void +OMPClauseReader::VisitOMPDynamicAllocatorsClause(OMPDynamicAllocatorsClause *) { +} + void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) { C->setLParenLoc(Record.readSourceLocation()); unsigned NumVars = C->varlist_size(); diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 81ef885779..06df715699 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -6937,3 +6937,7 @@ void OMPClauseWriter::VisitOMPUnifiedSharedMemoryClause( OMPUnifiedSharedMemoryClause *) {} void OMPClauseWriter::VisitOMPReverseOffloadClause(OMPReverseOffloadClause *) {} + +void +OMPClauseWriter::VisitOMPDynamicAllocatorsClause(OMPDynamicAllocatorsClause *) { +} |