diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 911f7cc96635dbd9540133bbefbe3f5809a0b097..1175196436056dafc9957ac8298a98ca92f6fb31 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -2221,11 +2221,7 @@ enum CXCursorKind { */ CXCursor_OMPTargetDirective = 252, - /** \brief OpenMP teams directive. - */ - CXCursor_OMPTeamsDirective = 253, - - CXCursor_LastStmt = CXCursor_OMPTeamsDirective, + CXCursor_LastStmt = CXCursor_OMPTargetDirective, /** * \brief Cursor that represents the translation unit itself. diff --git a/include/clang/AST/DataRecursiveASTVisitor.h b/include/clang/AST/DataRecursiveASTVisitor.h index 078451cf542694d6c88a2e23322b93ac0548955f..0d470891fa7245568d5e7dadd3f4869bc06bdcb8 100644 --- a/include/clang/AST/DataRecursiveASTVisitor.h +++ b/include/clang/AST/DataRecursiveASTVisitor.h @@ -2350,9 +2350,6 @@ DEF_TRAVERSE_STMT(OMPAtomicDirective, DEF_TRAVERSE_STMT(OMPTargetDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) -DEF_TRAVERSE_STMT(OMPTeamsDirective, - { TRY_TO(TraverseOMPExecutableDirective(S)); }) - // OpenMP clauses. template <typename Derived> bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) { diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index cf8131dc363c54e7e5928cfb4f5e101a13604b81..821eacb21f5a8373fda0f5de6af8424ee4832d76 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -2372,9 +2372,6 @@ DEF_TRAVERSE_STMT(OMPAtomicDirective, DEF_TRAVERSE_STMT(OMPTargetDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) -DEF_TRAVERSE_STMT(OMPTeamsDirective, - { TRY_TO(TraverseOMPExecutableDirective(S)); }) - // OpenMP clauses. template <typename Derived> bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) { diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index 6a6abb9b9951a41632169c7bc6df63b0f8c31c5a..249ee44553761b6fef9fb852b1a51bcfd012d78b 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -1527,64 +1527,6 @@ public: } }; -/// \brief This represents '#pragma omp teams' directive. -/// -/// \code -/// #pragma omp teams if(a) -/// \endcode -/// In this example directive '#pragma omp teams' has clause 'if' with -/// condition 'a'. -/// -class OMPTeamsDirective : public OMPExecutableDirective { - friend class ASTStmtReader; - /// \brief Build directive with the given start and end location. - /// - /// \param StartLoc Starting location of the directive kind. - /// \param EndLoc Ending location of the directive. - /// \param NumClauses Number of clauses. - /// - OMPTeamsDirective(SourceLocation StartLoc, SourceLocation EndLoc, - unsigned NumClauses) - : OMPExecutableDirective(this, OMPTeamsDirectiveClass, OMPD_teams, - StartLoc, EndLoc, NumClauses, 1) {} - - /// \brief Build an empty directive. - /// - /// \param NumClauses Number of clauses. - /// - explicit OMPTeamsDirective(unsigned NumClauses) - : OMPExecutableDirective(this, OMPTeamsDirectiveClass, OMPD_teams, - SourceLocation(), SourceLocation(), NumClauses, - 1) {} - -public: - /// \brief Creates directive with a list of \a Clauses. - /// - /// \param C AST context. - /// \param StartLoc Starting location of the directive kind. - /// \param EndLoc Ending Location of the directive. - /// \param Clauses List of clauses. - /// \param AssociatedStmt Statement, associated with the directive. - /// - static OMPTeamsDirective *Create(const ASTContext &C, SourceLocation StartLoc, - SourceLocation EndLoc, - ArrayRef<OMPClause *> Clauses, - Stmt *AssociatedStmt); - - /// \brief Creates an empty directive with the place for \a NumClauses - /// clauses. - /// - /// \param C AST context. - /// \param NumClauses Number of clauses. - /// - static OMPTeamsDirective *CreateEmpty(const ASTContext &C, - unsigned NumClauses, EmptyShell); - - static bool classof(const Stmt *T) { - return T->getStmtClass() == OMPTeamsDirectiveClass; - } -}; - } // end namespace clang #endif diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 1957db33dc8f9ec4fb80f8999ccc608390fd4571..cb81078880d3084a8ea53e8d9e2af13ee93056dc 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -7262,8 +7262,7 @@ def err_omp_reduction_id_not_compatible : Error< def err_omp_prohibited_region : Error< "region cannot be%select{| closely}0 nested inside '%1' region" "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|" - "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|" - "; perhaps you forget to enclose 'omp %3' directive into a target region?}2">; + "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?}2">; def err_omp_prohibited_region_simd : Error< "OpenMP constructs may not be nested inside a simd region">; def err_omp_prohibited_region_atomic : Error< @@ -7306,12 +7305,6 @@ def err_omp_atomic_several_clauses : Error< "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">; def note_omp_atomic_previous_clause : Note< "'%0' clause used here">; -def err_omp_target_contains_not_only_teams : Error< - "target construct with nested teams region contains statements outside of the teams construct">; -def note_omp_nested_teams_construct_here : Note< - "nested teams construct here">; -def note_omp_nested_statement_here : Note< - "%select{statement|directive}0 outside teams construct here">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index 0145db0593290c46cc75ef69b28d57b8222697cb..d238120d6da42ef7fe74535f47ef7832d5fc88c4 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -57,9 +57,6 @@ #ifndef OPENMP_TARGET_CLAUSE # define OPENMP_TARGET_CLAUSE(Name) #endif -#ifndef OPENMP_TEAMS_CLAUSE -# define OPENMP_TEAMS_CLAUSE(Name) -#endif #ifndef OPENMP_DEFAULT_KIND # define OPENMP_DEFAULT_KIND(Name) #endif @@ -88,7 +85,6 @@ OPENMP_DIRECTIVE(flush) OPENMP_DIRECTIVE(ordered) OPENMP_DIRECTIVE(atomic) OPENMP_DIRECTIVE(target) -OPENMP_DIRECTIVE(teams) OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for") OPENMP_DIRECTIVE_EXT(parallel_for_simd, "parallel for simd") OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel sections") @@ -259,14 +255,6 @@ OPENMP_ATOMIC_CLAUSE(seq_cst) // TODO More clauses for 'target' directive. OPENMP_TARGET_CLAUSE(if) -// Clauses allowed for OpenMP directive 'teams'. -// TODO More clauses for 'teams' directive. -OPENMP_TEAMS_CLAUSE(default) -OPENMP_TEAMS_CLAUSE(private) -OPENMP_TEAMS_CLAUSE(firstprivate) -OPENMP_TEAMS_CLAUSE(shared) -OPENMP_TEAMS_CLAUSE(reduction) - #undef OPENMP_SCHEDULE_KIND #undef OPENMP_PROC_BIND_KIND #undef OPENMP_DEFAULT_KIND @@ -282,7 +270,6 @@ OPENMP_TEAMS_CLAUSE(reduction) #undef OPENMP_TASK_CLAUSE #undef OPENMP_ATOMIC_CLAUSE #undef OPENMP_TARGET_CLAUSE -#undef OPENMP_TEAMS_CLAUSE #undef OPENMP_SIMD_CLAUSE #undef OPENMP_FOR_CLAUSE #undef OPENMP_FOR_SIMD_CLAUSE diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h index e2f115113e200b4272afc5cf83d1aee7c8d916af..526cbb26cf1517d75e9f5c227db6f8c61aa7a1b1 100644 --- a/include/clang/Basic/OpenMPKinds.h +++ b/include/clang/Basic/OpenMPKinds.h @@ -93,12 +93,6 @@ bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind); /// parallel', otherwise - false. bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a teams-kind directive. -/// \param DKind Specified directive. -/// \return true - the directive is a teams-like directive like 'omp teams', -/// otherwise - false. -bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind); - /// \brief Checks if the specified directive is a simd directive. /// \param DKind Specified directive. /// \return true - the directive is a simd directive like 'omp simd', diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index be025e344a0cea86574712c9d9f3d3e093ce7285..c1dc4d2cf9edbee826ca927d307c27c6b12c3cf3 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -199,4 +199,3 @@ def OMPFlushDirective : DStmt<OMPExecutableDirective>; def OMPOrderedDirective : DStmt<OMPExecutableDirective>; def OMPAtomicDirective : DStmt<OMPExecutableDirective>; def OMPTargetDirective : DStmt<OMPExecutableDirective>; -def OMPTeamsDirective : DStmt<OMPExecutableDirective>; diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 3f52f2dccb5591bc9453e1c03b1d99b07c42da26..ddc997d64de0909095f1e4a30acd85042cbdf6a2 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -7501,16 +7501,12 @@ public: StmtResult ActOnOpenMPAtomicDirective(ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc); + /// \brief Called on well-formed '\#pragma omp target' after parsing of the /// associated statement. StmtResult ActOnOpenMPTargetDirective(ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc); - /// \brief Called on well-formed '\#pragma omp teams' after parsing of the - /// associated statement. - StmtResult ActOnOpenMPTeamsDirective(ArrayRef<OMPClause *> Clauses, - Stmt *AStmt, SourceLocation StartLoc, - SourceLocation EndLoc); OMPClause *ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index d635102af46ad773d1899f4b9d35fbc83a1b45c8..49f2b1b7fa107c8e9d531a06c806c41b4efbe606 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -1360,7 +1360,6 @@ namespace clang { STMT_OMP_ORDERED_DIRECTIVE, STMT_OMP_ATOMIC_DIRECTIVE, STMT_OMP_TARGET_DIRECTIVE, - STMT_OMP_TEAMS_DIRECTIVE, // ARC EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index c645d4aa341930f40dbc92270c5bcb73d22589ec..af19af4943a9d9f3f20f51a922b8522e552e2394 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -1942,29 +1942,3 @@ OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C, return new (Mem) OMPTargetDirective(NumClauses); } -OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C, - SourceLocation StartLoc, - SourceLocation EndLoc, - ArrayRef<OMPClause *> Clauses, - Stmt *AssociatedStmt) { - unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPTeamsDirective), - llvm::alignOf<OMPClause *>()); - void *Mem = - C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *)); - OMPTeamsDirective *Dir = - new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size()); - Dir->setClauses(Clauses); - Dir->setAssociatedStmt(AssociatedStmt); - return Dir; -} - -OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C, - unsigned NumClauses, - EmptyShell) { - unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPTeamsDirective), - llvm::alignOf<OMPClause *>()); - void *Mem = - C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *)); - return new (Mem) OMPTeamsDirective(NumClauses); -} - diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 301d6a7bb68929c503540d10613d441129672ef7..4ed996254baed5edb0ba574e2b296eb2d7b5ee5f 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -928,11 +928,6 @@ void StmtPrinter::VisitOMPTargetDirective(OMPTargetDirective *Node) { PrintOMPExecutableDirective(Node); } -void StmtPrinter::VisitOMPTeamsDirective(OMPTeamsDirective *Node) { - Indent() << "#pragma omp teams "; - PrintOMPExecutableDirective(Node); -} - //===----------------------------------------------------------------------===// // Expr printing methods. //===----------------------------------------------------------------------===// diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index 2da2174bf64a01bb2c04a19f1c499831cdda4fbf..9bcb5929ed0886f1f28a57b482dd1c6d1806d341 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -466,10 +466,6 @@ void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) { VisitOMPExecutableDirective(S); } -void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) { - VisitOMPExecutableDirective(S); -} - void StmtProfiler::VisitExpr(const Expr *S) { VisitStmt(S); } diff --git a/lib/Basic/OpenMPKinds.cpp b/lib/Basic/OpenMPKinds.cpp index 5b4ef28297161375a1d369e11c4ddff81b47fe9d..d4e07e876cf75279f6c6901f7faa3b9a8a1d6836 100644 --- a/lib/Basic/OpenMPKinds.cpp +++ b/lib/Basic/OpenMPKinds.cpp @@ -309,16 +309,6 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind, #define OPENMP_TARGET_CLAUSE(Name) \ case OMPC_##Name: \ return true; -#include "clang/Basic/OpenMPKinds.def" - default: - break; - } - break; - case OMPD_teams: - switch (CKind) { -#define OPENMP_TEAMS_CLAUSE(Name) \ - case OMPC_##Name: \ - return true; #include "clang/Basic/OpenMPKinds.def" default: break; @@ -358,10 +348,6 @@ bool clang::isOpenMPParallelDirective(OpenMPDirectiveKind DKind) { DKind == OMPD_parallel_sections; // TODO add next directives. } -bool clang::isOpenMPTeamsDirective(OpenMPDirectiveKind DKind) { - return DKind == OMPD_teams; // TODO add next directives. -} - bool clang::isOpenMPSimdDirective(OpenMPDirectiveKind DKind) { return DKind == OMPD_simd || DKind == OMPD_for_simd || DKind == OMPD_parallel_for_simd; // TODO add next directives. diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index b970e4f1ab4cdbe6b97027a809bf5c87ff41e689..81031f14ae30148e935a1978e2376f3634142311 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -236,9 +236,6 @@ void CodeGenFunction::EmitStmt(const Stmt *S) { case Stmt::OMPTargetDirectiveClass: EmitOMPTargetDirective(cast<OMPTargetDirective>(*S)); break; - case Stmt::OMPTeamsDirectiveClass: - EmitOMPTeamsDirective(cast<OMPTeamsDirective>(*S)); - break; } } diff --git a/lib/CodeGen/CGStmtOpenMP.cpp b/lib/CodeGen/CGStmtOpenMP.cpp index c2864689be90c88c88b7bc04890066d2bc773010..985cc0e62aeb12001b7ebff97ad0f8ae932315ef 100644 --- a/lib/CodeGen/CGStmtOpenMP.cpp +++ b/lib/CodeGen/CGStmtOpenMP.cpp @@ -345,7 +345,3 @@ void CodeGenFunction::EmitOMPTargetDirective(const OMPTargetDirective &) { llvm_unreachable("CodeGen for 'omp target' is not supported yet."); } -void CodeGenFunction::EmitOMPTeamsDirective(const OMPTeamsDirective &) { - llvm_unreachable("CodeGen for 'omp teams' is not supported yet."); -} - diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index ff905e47873a5131c1daca5a4ce3e86b1a400ff3..a4b231ddf4b610b14f9b371e7a218a2c552d29e9 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -2014,7 +2014,6 @@ public: void EmitOMPOrderedDirective(const OMPOrderedDirective &S); void EmitOMPAtomicDirective(const OMPAtomicDirective &S); void EmitOMPTargetDirective(const OMPTargetDirective &S); - void EmitOMPTeamsDirective(const OMPTeamsDirective &S); /// Helpers for 'omp simd' directive. void EmitOMPLoopBody(const OMPLoopDirective &Directive, diff --git a/lib/Parse/ParseOpenMP.cpp b/lib/Parse/ParseOpenMP.cpp index 3a119a601e226929d27aea3057a09894a0401672..1682c83bab1fe7c77b2eab00195667cbbea7d4fb 100644 --- a/lib/Parse/ParseOpenMP.cpp +++ b/lib/Parse/ParseOpenMP.cpp @@ -108,7 +108,6 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirective() { case OMPD_parallel_sections: case OMPD_atomic: case OMPD_target: - case OMPD_teams: Diag(Tok, diag::err_omp_unexpected_directive) << getOpenMPDirectiveName(DKind); break; @@ -128,7 +127,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirective() { /// 'section' | 'single' | 'master' | 'critical' [ '(' <name> ')' ] | /// 'parallel for' | 'parallel sections' | 'task' | 'taskyield' | /// 'barrier' | 'taskwait' | 'flush' | 'ordered' | 'atomic' | -/// 'for simd' | 'parallel for simd' | 'target' | 'teams' {clause} +/// 'for simd' | 'parallel for simd' | 'target' {clause} /// annot_pragma_openmp_end /// StmtResult @@ -197,8 +196,7 @@ Parser::ParseOpenMPDeclarativeOrExecutableDirective(bool StandAloneAllowed) { case OMPD_task: case OMPD_ordered: case OMPD_atomic: - case OMPD_target: - case OMPD_teams: { + case OMPD_target: { ConsumeToken(); // Parse directive name of the 'critical' directive if any. if (DKind == OMPD_critical) { diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index c4a813d45cba7f644e966e2a1a9cd04149a34307..ff2b2826092f29ca6d069b3509ec7a841dc3aee6 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -92,16 +92,15 @@ private: Scope *CurScope; SourceLocation ConstructLoc; bool OrderedRegion; - SourceLocation InnerTeamsRegionLoc; SharingMapTy(OpenMPDirectiveKind DKind, DeclarationNameInfo Name, Scope *CurScope, SourceLocation Loc) : SharingMap(), AlignedMap(), DefaultAttr(DSA_unspecified), Directive(DKind), DirectiveName(std::move(Name)), CurScope(CurScope), - ConstructLoc(Loc), OrderedRegion(false), InnerTeamsRegionLoc() {} + ConstructLoc(Loc), OrderedRegion(false) {} SharingMapTy() : SharingMap(), AlignedMap(), DefaultAttr(DSA_unspecified), Directive(OMPD_unknown), DirectiveName(), CurScope(nullptr), - ConstructLoc(), OrderedRegion(false), InnerTeamsRegionLoc() {} + ConstructLoc(), OrderedRegion(false) {} }; typedef SmallVector<SharingMapTy, 64> StackTy; @@ -208,30 +207,13 @@ public: return false; } - /// \brief Marks current target region as one with closely nested teams - /// region. - void setParentTeamsRegionLoc(SourceLocation TeamsRegionLoc) { - if (Stack.size() > 2) - Stack[Stack.size() - 2].InnerTeamsRegionLoc = TeamsRegionLoc; - } - /// \brief Returns true, if current region has closely nested teams region. - bool hasInnerTeamsRegion() const { - return getInnerTeamsRegionLoc().isValid(); - } - /// \brief Returns location of the nested teams region (if any). - SourceLocation getInnerTeamsRegionLoc() const { - if (Stack.size() > 1) - return Stack.back().InnerTeamsRegionLoc; - return SourceLocation(); - } - Scope *getCurScope() const { return Stack.back().CurScope; } Scope *getCurScope() { return Stack.back().CurScope; } SourceLocation getConstructLoc() { return Stack.back().ConstructLoc; } }; bool isParallelOrTaskRegion(OpenMPDirectiveKind DKind) { return isOpenMPParallelDirective(DKind) || DKind == OMPD_task || - isOpenMPTeamsDirective(DKind) || DKind == OMPD_unknown; + DKind == OMPD_unknown; } } // namespace @@ -294,8 +276,7 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator Iter, // In a parallel construct, if no default clause is present, these // variables are shared. DVar.ImplicitDSALoc = Iter->DefaultAttrLoc; - if (isOpenMPParallelDirective(DVar.DKind) || - isOpenMPTeamsDirective(DVar.DKind)) { + if (isOpenMPParallelDirective(DVar.DKind)) { DVar.CKind = OMPC_shared; return DVar; } @@ -952,8 +933,7 @@ public: DVar = Stack->hasInnermostDSA(VD, MatchesAnyClause(OMPC_reduction), [](OpenMPDirectiveKind K) -> bool { return isOpenMPParallelDirective(K) || - isOpenMPWorksharingDirective(K) || - isOpenMPTeamsDirective(K); + isOpenMPWorksharingDirective(K); }, false); if (DKind == OMPD_task && DVar.CKind == OMPC_reduction) { @@ -1172,18 +1152,6 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) { Params); break; } - case OMPD_teams: { - QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1); - QualType KmpInt32PtrTy = Context.getPointerType(KmpInt32Ty); - Sema::CapturedParamNameType Params[] = { - std::make_pair(".global_tid.", KmpInt32PtrTy), - std::make_pair(".bound_tid.", KmpInt32PtrTy), - std::make_pair(StringRef(), QualType()) // __context with shared vars - }; - ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP, - Params); - break; - } case OMPD_threadprivate: llvm_unreachable("OpenMP Directive is not allowed"); case OMPD_unknown: @@ -1219,7 +1187,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel | ordered | + | // | parallel | atomic | * | // | parallel | target | * | - // | parallel | teams | + | // +------------------+-----------------+------------------------------------+ // | for | parallel | * | // | for | for | + | @@ -1241,7 +1208,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | for | ordered | * (if construct is ordered) | // | for | atomic | * | // | for | target | * | - // | for | teams | + | // +------------------+-----------------+------------------------------------+ // | master | parallel | * | // | master | for | + | @@ -1263,7 +1229,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | master | ordered | + | // | master | atomic | * | // | master | target | * | - // | master | teams | + | // +------------------+-----------------+------------------------------------+ // | critical | parallel | * | // | critical | for | + | @@ -1284,7 +1249,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | critical | ordered | + | // | critical | atomic | * | // | critical | target | * | - // | critical | teams | + | // +------------------+-----------------+------------------------------------+ // | simd | parallel | | // | simd | for | | @@ -1306,7 +1270,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | simd | ordered | | // | simd | atomic | | // | simd | target | | - // | simd | teams | | // +------------------+-----------------+------------------------------------+ // | for simd | parallel | | // | for simd | for | | @@ -1328,7 +1291,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | for simd | ordered | | // | for simd | atomic | | // | for simd | target | | - // | for simd | teams | | // +------------------+-----------------+------------------------------------+ // | parallel for simd| parallel | | // | parallel for simd| for | | @@ -1350,7 +1312,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel for simd| ordered | | // | parallel for simd| atomic | | // | parallel for simd| target | | - // | parallel for simd| teams | | // +------------------+-----------------+------------------------------------+ // | sections | parallel | * | // | sections | for | + | @@ -1372,7 +1333,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | sections | ordered | + | // | sections | atomic | * | // | sections | target | * | - // | sections | teams | + | // +------------------+-----------------+------------------------------------+ // | section | parallel | * | // | section | for | + | @@ -1394,7 +1354,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | section | ordered | + | // | section | atomic | * | // | section | target | * | - // | section | teams | + | // +------------------+-----------------+------------------------------------+ // | single | parallel | * | // | single | for | + | @@ -1416,7 +1375,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | single | ordered | + | // | single | atomic | * | // | single | target | * | - // | single | teams | + | // +------------------+-----------------+------------------------------------+ // | parallel for | parallel | * | // | parallel for | for | + | @@ -1438,7 +1396,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel for | ordered | * (if construct is ordered) | // | parallel for | atomic | * | // | parallel for | target | * | - // | parallel for | teams | + | // +------------------+-----------------+------------------------------------+ // | parallel sections| parallel | * | // | parallel sections| for | + | @@ -1460,7 +1417,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel sections| ordered | + | // | parallel sections| atomic | * | // | parallel sections| target | * | - // | parallel sections| teams | + | // +------------------+-----------------+------------------------------------+ // | task | parallel | * | // | task | for | + | @@ -1482,7 +1438,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | task | ordered | + | // | task | atomic | * | // | task | target | * | - // | task | teams | + | // +------------------+-----------------+------------------------------------+ // | ordered | parallel | * | // | ordered | for | + | @@ -1504,7 +1459,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | ordered | ordered | + | // | ordered | atomic | * | // | ordered | target | * | - // | ordered | teams | + | // +------------------+-----------------+------------------------------------+ // | atomic | parallel | | // | atomic | for | | @@ -1526,7 +1480,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | atomic | ordered | | // | atomic | atomic | | // | atomic | target | | - // | atomic | teams | | // +------------------+-----------------+------------------------------------+ // | target | parallel | * | // | target | for | * | @@ -1548,29 +1501,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | target | ordered | * | // | target | atomic | * | // | target | target | * | - // | target | teams | * | - // +------------------+-----------------+------------------------------------+ - // | teams | parallel | * | - // | teams | for | + | - // | teams | for simd | + | - // | teams | master | + | - // | teams | critical | + | - // | teams | simd | + | - // | teams | sections | + | - // | teams | section | + | - // | teams | single | + | - // | teams | parallel for | * | - // | teams |parallel for simd| * | - // | teams |parallel sections| * | - // | teams | task | + | - // | teams | taskyield | + | - // | teams | barrier | + | - // | teams | taskwait | + | - // | teams | flush | + | - // | teams | ordered | + | - // | teams | atomic | + | - // | teams | target | + | - // | teams | teams | + | // +------------------+-----------------+------------------------------------+ if (Stack->getCurScope()) { auto ParentRegion = Stack->getParentDirective(); @@ -1579,8 +1509,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, enum { NoRecommend, ShouldBeInParallelRegion, - ShouldBeInOrderedRegion, - ShouldBeInTargetRegion + ShouldBeInOrderedRegion } Recommend = NoRecommend; if (isOpenMPSimdDirective(ParentRegion)) { // OpenMP [2.16, Nesting of Regions] @@ -1675,22 +1604,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, ParentRegion == OMPD_task || !Stack->isParentOrderedRegion(); Recommend = ShouldBeInOrderedRegion; - } else if (isOpenMPTeamsDirective(CurrentRegion)) { - // OpenMP [2.16, Nesting of Regions] - // If specified, a teams construct must be contained within a target - // construct. - NestingProhibited = ParentRegion != OMPD_target; - Recommend = ShouldBeInTargetRegion; - Stack->setParentTeamsRegionLoc(Stack->getConstructLoc()); - } - if (!NestingProhibited && isOpenMPTeamsDirective(ParentRegion)) { - // OpenMP [2.16, Nesting of Regions] - // distribute, parallel, parallel sections, parallel workshare, and the - // parallel loop and parallel loop SIMD constructs are the only OpenMP - // constructs that can be closely nested in the teams region. - // TODO: add distribute directive. - NestingProhibited = !isOpenMPParallelDirective(CurrentRegion); - Recommend = ShouldBeInParallelRegion; } if (NestingProhibited) { SemaRef.Diag(StartLoc, diag::err_omp_prohibited_region) @@ -1830,10 +1743,6 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind, Res = ActOnOpenMPAtomicDirective(ClausesWithImplicit, AStmt, StartLoc, EndLoc); break; - case OMPD_teams: - Res = - ActOnOpenMPTeamsDirective(ClausesWithImplicit, AStmt, StartLoc, EndLoc); - break; case OMPD_target: Res = ActOnOpenMPTargetDirective(ClausesWithImplicit, AStmt, StartLoc, EndLoc); @@ -3252,58 +3161,11 @@ StmtResult Sema::ActOnOpenMPTargetDirective(ArrayRef<OMPClause *> Clauses, SourceLocation EndLoc) { assert(AStmt && isa<CapturedStmt>(AStmt) && "Captured statement expected"); - // OpenMP [2.16, Nesting of Regions] - // If specified, a teams construct must be contained within a target - // construct. That target construct must contain no statements or directives - // outside of the teams construct. - if (DSAStack->hasInnerTeamsRegion()) { - auto S = AStmt->IgnoreContainers(/*IgnoreCaptured*/ true); - bool OMPTeamsFound = true; - if (auto *CS = dyn_cast<CompoundStmt>(S)) { - auto I = CS->body_begin(); - while (I != CS->body_end()) { - auto OED = dyn_cast<OMPExecutableDirective>(*I); - if (!OED || !isOpenMPTeamsDirective(OED->getDirectiveKind())) { - OMPTeamsFound = false; - break; - } - ++I; - } - assert(I != CS->body_end() && "Not found statement"); - S = *I; - } - if (!OMPTeamsFound) { - Diag(StartLoc, diag::err_omp_target_contains_not_only_teams); - Diag(DSAStack->getInnerTeamsRegionLoc(), - diag::note_omp_nested_teams_construct_here); - Diag(S->getLocStart(), diag::note_omp_nested_statement_here) - << isa<OMPExecutableDirective>(S); - return StmtError(); - } - } - getCurFunction()->setHasBranchProtectedScope(); return OMPTargetDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt); } -StmtResult Sema::ActOnOpenMPTeamsDirective(ArrayRef<OMPClause *> Clauses, - Stmt *AStmt, SourceLocation StartLoc, - SourceLocation EndLoc) { - assert(AStmt && isa<CapturedStmt>(AStmt) && "Captured statement expected"); - CapturedStmt *CS = cast<CapturedStmt>(AStmt); - // 1.2.2 OpenMP Language Terminology - // Structured block - An executable statement with a single entry at the - // top and a single exit at the bottom. - // The point of exit cannot be a branch out of the structured block. - // longjmp() and throw() must not violate the entry/exit criteria. - CS->getCapturedDecl()->setNothrow(); - - getCurFunction()->setHasBranchProtectedScope(); - - return OMPTeamsDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt); -} - OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 08a134a30be227526bb89c09037d268bd751b409..687f16473df944ccd32394f60ce397dae5a80d23 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -6693,17 +6693,6 @@ TreeTransform<Derived>::TransformOMPTargetDirective(OMPTargetDirective *D) { return Res; } -template <typename Derived> -StmtResult -TreeTransform<Derived>::TransformOMPTeamsDirective(OMPTeamsDirective *D) { - DeclarationNameInfo DirName; - getDerived().getSema().StartOpenMPDSABlock(OMPD_teams, DirName, nullptr, - D->getLocStart()); - StmtResult Res = getDerived().TransformOMPExecutableDirective(D); - getDerived().getSema().EndOpenMPDSABlock(Res.get()); - return Res; -} - //===----------------------------------------------------------------------===// // OpenMP clause transformation //===----------------------------------------------------------------------===// diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index e5b1c966193b1dc309e8ba202a8a29b1c9e3d946..c8343373ad6f667d613ecf22105438aa95e1210f 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/lib/Serialization/ASTReaderStmt.cpp @@ -2107,13 +2107,6 @@ void ASTStmtReader::VisitOMPTargetDirective(OMPTargetDirective *D) { VisitOMPExecutableDirective(D); } -void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) { - VisitStmt(D); - // The NumClauses field was read in ReadStmtFromStream. - ++Idx; - VisitOMPExecutableDirective(D); -} - //===----------------------------------------------------------------------===// // ASTReader Implementation //===----------------------------------------------------------------------===// @@ -2699,11 +2692,6 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { Context, Record[ASTStmtReader::NumStmtFields], Empty); break; - case STMT_OMP_TEAMS_DIRECTIVE: - S = OMPTeamsDirective::CreateEmpty( - Context, Record[ASTStmtReader::NumStmtFields], Empty); - break; - case EXPR_CXX_OPERATOR_CALL: S = new (Context) CXXOperatorCallExpr(Context, Empty); break; diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp index 775c1bb6d0fea39c823058f52aa6042ba1bd1c80..80d42b8ae5ffbd1018ea4695db145d2336ad3709 100644 --- a/lib/Serialization/ASTWriterStmt.cpp +++ b/lib/Serialization/ASTWriterStmt.cpp @@ -1992,13 +1992,6 @@ void ASTStmtWriter::VisitOMPOrderedDirective(OMPOrderedDirective *D) { Code = serialization::STMT_OMP_ORDERED_DIRECTIVE; } -void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) { - VisitStmt(D); - Record.push_back(D->getNumClauses()); - VisitOMPExecutableDirective(D); - Code = serialization::STMT_OMP_TEAMS_DIRECTIVE; -} - //===----------------------------------------------------------------------===// // ASTWriter Implementation //===----------------------------------------------------------------------===// diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 807d5216e88e2b4b6a22445886ec0bf8807da597..7c1b7f504e8b2d81091c26825213acdd5eaf4a0b 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -818,7 +818,6 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred, case Stmt::OMPOrderedDirectiveClass: case Stmt::OMPAtomicDirectiveClass: case Stmt::OMPTargetDirectiveClass: - case Stmt::OMPTeamsDirectiveClass: llvm_unreachable("Stmt should not be in analyzer evaluation loop"); case Stmt::ObjCSubscriptRefExprClass: diff --git a/test/OpenMP/nesting_of_regions.cpp b/test/OpenMP/nesting_of_regions.cpp index a948ca3e3bcbfcea2215c22dafd6ca3dae7502ae..0bc61f6e0d1624b2cf5589cf9502058f887bb64b 100644 --- a/test/OpenMP/nesting_of_regions.cpp +++ b/test/OpenMP/nesting_of_regions.cpp @@ -95,11 +95,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp parallel - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // SIMD DIRECTIVE #pragma omp simd @@ -222,11 +217,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} ++a; } -#pragma omp simd - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} - ++a; - } // FOR DIRECTIVE #pragma omp for @@ -372,11 +362,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp for - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'for' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // FOR SIMD DIRECTIVE #pragma omp for simd @@ -499,11 +484,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} ++a; } -#pragma omp for simd - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} - ++a; - } // SECTIONS DIRECTIVE #pragma omp sections @@ -656,11 +636,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp sections - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'sections' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // SECTION DIRECTIVE #pragma omp section // expected-error {{orphaned 'omp section' directives are prohibited, it must be closely nested to a sections region}} @@ -848,12 +823,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp sections - { -#pragma omp section -#pragma omp teams // expected-error {{region cannot be closely nested inside 'section' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // SINGLE DIRECTIVE #pragma omp single @@ -989,11 +958,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp single - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'single' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // MASTER DIRECTIVE #pragma omp master @@ -1129,11 +1093,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp master - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'master' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // CRITICAL DIRECTIVE #pragma omp critical @@ -1283,11 +1242,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp critical - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'critical' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // PARALLEL FOR DIRECTIVE #pragma omp parallel for @@ -1438,11 +1392,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp parallel for - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel for' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // PARALLEL FOR SIMD DIRECTIVE #pragma omp parallel for simd @@ -1593,11 +1542,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} ++a; } -#pragma omp parallel for simd - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} - ++a; - } // PARALLEL SECTIONS DIRECTIVE #pragma omp parallel sections @@ -1739,11 +1683,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp parallel sections - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel sections' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // TASK DIRECTIVE #pragma omp task @@ -1831,11 +1770,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp task - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'task' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // ORDERED DIRECTIVE #pragma omp ordered @@ -1971,11 +1905,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp ordered - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'ordered' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // ATOMIC DIRECTIVE #pragma omp atomic @@ -2118,12 +2047,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside an atomic region}} ++a; } -#pragma omp atomic - // expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}} - { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside an atomic region}} - ++a; - } // TARGET DIRECTIVE #pragma omp target @@ -2218,137 +2141,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp target - { -#pragma omp teams - ++a; - } -#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}} - { - ++a; // expected-note {{statement outside teams construct here}} -#pragma omp teams // expected-note {{nested teams construct here}} - ++a; - } - -// TEAMS DIRECTIVE -#pragma omp target -#pragma omp teams -#pragma omp parallel - bar(); -#pragma omp target -#pragma omp teams -#pragma omp for // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp for' directive into a parallel region?}} - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp simd // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp simd' directive into a parallel region?}} - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp for simd // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp for simd' directive into a parallel region?}} - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp sections // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp sections' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp section // expected-error {{'omp section' directive must be closely nested to a sections region, not a teams region}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp single // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp single' directive into a parallel region?}} - bar(); - -#pragma omp target -#pragma omp teams -#pragma omp master // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp master' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp critical // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp critical' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp parallel for - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp parallel for simd - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp parallel sections - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp task // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp task' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp taskyield // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp taskyield' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp barrier // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp barrier' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp taskwait // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp taskwait' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp flush // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp flush' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp ordered // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp ordered' directive into a for or a parallel for region with 'ordered' clause?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp atomic // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp atomic' directive into a parallel region?}} - ++a; - } -#pragma omp target -#pragma omp teams - { -#pragma omp target // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp target' directive into a parallel region?}} - ++a; - } -#pragma omp target -#pragma omp teams - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } } void foo() { @@ -2443,11 +2235,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp parallel - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // SIMD DIRECTIVE #pragma omp simd @@ -2563,11 +2350,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} ++a; } -#pragma omp simd - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} - ++a; - } // FOR DIRECTIVE #pragma omp for @@ -2703,11 +2485,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp for - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'for' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // FOR SIMD DIRECTIVE #pragma omp for simd @@ -2823,11 +2600,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} ++a; } -#pragma omp for simd - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} - ++a; - } // SECTIONS DIRECTIVE #pragma omp sections @@ -2955,11 +2727,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp sections - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'sections' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // SECTION DIRECTIVE #pragma omp section // expected-error {{orphaned 'omp section' directives are prohibited, it must be closely nested to a sections region}} @@ -3151,14 +2918,6 @@ void foo() { ++a; } } -#pragma omp sections - { -#pragma omp section - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'section' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } - } // SINGLE DIRECTIVE #pragma omp single @@ -3284,11 +3043,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp single - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'single' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // MASTER DIRECTIVE #pragma omp master @@ -3424,11 +3178,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp master - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'master' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // CRITICAL DIRECTIVE #pragma omp critical @@ -3583,11 +3332,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp critical - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'critical' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // PARALLEL FOR DIRECTIVE #pragma omp parallel for @@ -3738,11 +3482,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp parallel for - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel for' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // PARALLEL FOR SIMD DIRECTIVE #pragma omp parallel for simd @@ -3893,11 +3632,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside a simd region}} ++a; } -#pragma omp parallel for simd - for (int i = 0; i < 10; ++i) { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside a simd region}} - ++a; - } // PARALLEL SECTIONS DIRECTIVE #pragma omp parallel sections @@ -4035,11 +3769,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp parallel sections - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'parallel sections' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // TASK DIRECTIVE #pragma omp task @@ -4126,11 +3855,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp task - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'task' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } // ATOMIC DIRECTIVE #pragma omp atomic @@ -4273,12 +3997,6 @@ void foo() { #pragma omp target // expected-error {{OpenMP constructs may not be nested inside an atomic region}} ++a; } -#pragma omp atomic - // expected-error@+1 {{the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x', where x is an l-value expression with scalar type}} - { -#pragma omp teams // expected-error {{OpenMP constructs may not be nested inside an atomic region}} - ++a; - } // TARGET DIRECTIVE #pragma omp target @@ -4373,137 +4091,6 @@ void foo() { #pragma omp target ++a; } -#pragma omp target - { -#pragma omp teams - ++a; - } -#pragma omp target // expected-error {{target construct with nested teams region contains statements outside of the teams construct}} - { - ++a; // expected-note {{statement outside teams construct here}} -#pragma omp teams // expected-note {{nested teams construct here}} - ++a; - } - -// TEAMS DIRECTIVE -#pragma omp target -#pragma omp teams -#pragma omp parallel - bar(); -#pragma omp target -#pragma omp teams -#pragma omp for // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp for' directive into a parallel region?}} - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp simd // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp simd' directive into a parallel region?}} - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp for simd // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp for simd' directive into a parallel region?}} - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp sections // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp sections' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp section // expected-error {{'omp section' directive must be closely nested to a sections region, not a teams region}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp single // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp single' directive into a parallel region?}} - bar(); - -#pragma omp target -#pragma omp teams -#pragma omp master // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp master' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp critical // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp critical' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp parallel for - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp parallel for simd - for (int i = 0; i < 10; ++i) - ; -#pragma omp target -#pragma omp teams -#pragma omp parallel sections - { - bar(); - } -#pragma omp target -#pragma omp teams -#pragma omp task // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp task' directive into a parallel region?}} - { - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp taskyield // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp taskyield' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp barrier // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp barrier' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp taskwait // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp taskwait' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp flush // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp flush' directive into a parallel region?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp ordered // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp ordered' directive into a for or a parallel for region with 'ordered' clause?}} - bar(); - } -#pragma omp target -#pragma omp teams - { -#pragma omp atomic // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp atomic' directive into a parallel region?}} - ++a; - } -#pragma omp target -#pragma omp teams - { -#pragma omp target // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp target' directive into a parallel region?}} - ++a; - } -#pragma omp target -#pragma omp teams - { -#pragma omp teams // expected-error {{region cannot be closely nested inside 'teams' region; perhaps you forget to enclose 'omp teams' directive into a target region?}} - ++a; - } return foo<int>(); } diff --git a/test/OpenMP/teams_ast_print.cpp b/test/OpenMP/teams_ast_print.cpp deleted file mode 100644 index 394ec73a841c398ecac0698ee04f4bc16f894a77..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_ast_print.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ast-print %s | FileCheck %s -// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11 -emit-pch -o %t %s -// RUN: %clang_cc1 -fopenmp=libiomp5 -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s -// expected-no-diagnostics - -#ifndef HEADER -#define HEADER - -void foo() {} - -template <class T> -struct S { - operator T() {return T();} - static T TS; - #pragma omp threadprivate(TS) -}; - -// CHECK: template <class T = int> struct S { -// CHECK: static int TS; -// CHECK-NEXT: #pragma omp threadprivate(S<int>::TS) -// CHECK-NEXT: } -// CHECK: template <class T = long> struct S { -// CHECK: static long TS; -// CHECK-NEXT: #pragma omp threadprivate(S<long>::TS) -// CHECK-NEXT: } -// CHECK: template <class T> struct S { -// CHECK: static T TS; -// CHECK-NEXT: #pragma omp threadprivate(S::TS) -// CHECK: }; - -template <typename T, int C> -T tmain(T argc, T *argv) { - T b = argc, c, d, e, f, g; - static T a; - S<T> s; -#pragma omp target -#pragma omp teams - a=2; -#pragma omp target -#pragma omp teams default(none), private(argc,b) firstprivate(argv) shared (d) reduction(+:c) reduction(max:e) - foo(); -#pragma omp target -#pragma omp teams reduction(^:e, f) reduction(&& : g) - foo(); - return 0; -} - -// CHECK: template <typename T = int, int C = 5> int tmain(int argc, int *argv) { -// CHECK-NEXT: int b = argc, c, d, e, f, g; -// CHECK-NEXT: static int a; -// CHECK-NEXT: S<int> s; -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) -// CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g) -// CHECK-NEXT: foo() -// CHECK: template <typename T = long, int C = 1> long tmain(long argc, long *argv) { -// CHECK-NEXT: long b = argc, c, d, e, f, g; -// CHECK-NEXT: static long a; -// CHECK-NEXT: S<long> s; -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) -// CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g) -// CHECK-NEXT: foo() -// CHECK: template <typename T, int C> T tmain(T argc, T *argv) { -// CHECK-NEXT: T b = argc, c, d, e, f, g; -// CHECK-NEXT: static T a; -// CHECK-NEXT: S<T> s; -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) -// CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g) -// CHECK-NEXT: foo() - -enum Enum { }; - -int main (int argc, char **argv) { - long x; - int b = argc, c, d, e, f, g; - static int a; - #pragma omp threadprivate(a) - Enum ee; -// CHECK: Enum ee; -#pragma omp target -#pragma omp teams -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams - a=2; -// CHECK-NEXT: a = 2; -#pragma omp target -#pragma omp teams default(none), private(argc,b) firstprivate(argv) reduction(| : c, d) reduction(* : e) -// CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) reduction(|: c,d) reduction(*: e) - foo(); -// CHECK-NEXT: foo(); - return tmain<int, 5>(b, &b) + tmain<long, 1>(x, &x); -} - -#endif diff --git a/test/OpenMP/teams_default_messages.cpp b/test/OpenMP/teams_default_messages.cpp deleted file mode 100644 index 4f5a267150f9050bf7ba259696d3be0200cfb308..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_default_messages.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -o - %s - -void foo(); - -int main(int argc, char **argv) { - #pragma omp target - #pragma omp teams default // expected-error {{expected '(' after 'default'}} - foo(); - #pragma omp target - #pragma omp teams default ( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams default () // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} - foo(); - #pragma omp target - #pragma omp teams default (none // expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams default (shared), default(shared) // expected-error {{directive '#pragma omp teams' cannot contain more than one 'default' clause}} - foo(); - #pragma omp target - #pragma omp teams default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} - foo(); - - #pragma omp target - #pragma omp teams default(none) - ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} - - #pragma omp target - #pragma omp teams default(none) - #pragma omp parallel default(shared) - ++argc; - return 0; -} diff --git a/test/OpenMP/teams_firstprivate_messages.cpp b/test/OpenMP/teams_firstprivate_messages.cpp deleted file mode 100644 index 67728f7ef9d6fbaca230d651b8529c03fec96005..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_firstprivate_messages.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s - -void foo() { -} - -bool foobool(int argc) { - return argc; -} - -struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}} -extern S1 a; -class S2 { - mutable int a; -public: - S2():a(0) { } - S2(S2 &s2):a(s2.a) { } - static float S2s; - static const float S2sc; -}; -const float S2::S2sc = 0; -const S2 b; -const S2 ba[5]; -class S3 { - int a; -public: - S3():a(0) { } - S3(S3 &s3):a(s3.a) { } -}; -const S3 c; -const S3 ca[5]; -extern const int f; -class S4 { // expected-note {{'S4' declared here}} - int a; - S4(); - S4(const S4 &s4); -public: - S4(int v):a(v) { } -}; -class S5 { // expected-note {{'S5' declared here}} - int a; - S5():a(0) {} - S5(const S5 &s5):a(s5.a) { } -public: - S5(int v):a(v) { } -}; - -S3 h; -#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}} - -int main(int argc, char **argv) { - const int d = 5; - const int da[5] = { 0 }; - S4 e(4); // expected-note {{'e' defined here}} - S5 g(5); // expected-note {{'g' defined here}} - int i; - int &j = i; // expected-note {{'j' defined here}} - #pragma omp target - #pragma omp teams firstprivate // expected-error {{expected '(' after 'firstprivate'}} - foo(); - #pragma omp target - #pragma omp teams firstprivate ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams firstprivate () // expected-error {{expected expression}} - foo(); - #pragma omp target - #pragma omp teams firstprivate (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams firstprivate (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} - foo(); - #pragma omp target - #pragma omp teams firstprivate (argc) - foo(); - #pragma omp target - #pragma omp teams firstprivate (S1) // expected-error {{'S1' does not refer to a value}} - foo(); - #pragma omp target - #pragma omp teams firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} - foo(); - #pragma omp target - #pragma omp teams firstprivate (argv[1]) // expected-error {{expected variable name}} - foo(); - #pragma omp target - #pragma omp teams firstprivate(ba) - foo(); - #pragma omp target - #pragma omp teams firstprivate(ca) - foo(); - #pragma omp target - #pragma omp teams firstprivate(da) - foo(); - #pragma omp target - #pragma omp teams firstprivate(S2::S2s) - foo(); - #pragma omp target - #pragma omp teams firstprivate(S2::S2sc) - foo(); - #pragma omp target - #pragma omp teams firstprivate(e, g) // expected-error 2 {{firstprivate variable must have an accessible, unambiguous copy constructor}} - foo(); - #pragma omp target - #pragma omp teams firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}} - foo(); - #pragma omp target - #pragma omp teams private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note{{defined as private}} - foo(); - #pragma omp target - #pragma omp teams shared(i) - foo(); - #pragma omp target - #pragma omp teams firstprivate(i) - foo(); - #pragma omp target - #pragma omp teams firstprivate(j) // expected-error {{arguments of OpenMP clause 'firstprivate' cannot be of reference type}} - foo(); - - return 0; -} diff --git a/test/OpenMP/teams_messages.cpp b/test/OpenMP/teams_messages.cpp deleted file mode 100644 index 56ed548a0377e3b8caf968239cb286719d070804..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_messages.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -std=c++11 -o - %s - -void foo() { -} - -#pragma omp teams // expected-error {{unexpected OpenMP directive '#pragma omp teams'}} - -int main(int argc, char **argv) { - #pragma omp target - #pragma omp teams { // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); - #pragma omp target - #pragma omp teams ( // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); - #pragma omp target - #pragma omp teams [ // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); - #pragma omp target - #pragma omp teams ] // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); - #pragma omp target - #pragma omp teams ) // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); - #pragma omp target - #pragma omp teams } // expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); - #pragma omp target - #pragma omp teams - foo(); - // expected-warning@+2 {{extra tokens at the end of '#pragma omp teams' are ignored}} - #pragma omp target - #pragma omp teams unknown() - foo(); - L1: - foo(); - #pragma omp target - #pragma omp teams - ; - #pragma omp target - #pragma omp teams - { - goto L1; // expected-error {{use of undeclared label 'L1'}} - argc++; - } - - for (int i = 0; i < 10; ++i) { - switch(argc) { - case (0): - #pragma omp target - #pragma omp teams - { - foo(); - break; // expected-error {{'break' statement not in loop or switch statement}} - continue; // expected-error {{'continue' statement not in loop statement}} - } - default: - break; - } - } - #pragma omp target - #pragma omp teams default(none) - ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} - - goto L2; // expected-error {{use of undeclared label 'L2'}} - #pragma omp target - #pragma omp teams - L2: - foo(); - #pragma omp target - #pragma omp teams - { - return 1; // expected-error {{cannot return from OpenMP region}} - } - - [[]] // expected-error {{an attribute list cannot appear here}} - #pragma omp target - #pragma omp teams - for (int n = 0; n < 100; ++n) {} - - return 0; -} - diff --git a/test/OpenMP/teams_private_messages.cpp b/test/OpenMP/teams_private_messages.cpp deleted file mode 100644 index c461b26e26277e46fa18a79fb540fa18f13532cb..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_private_messages.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s - -void foo() { -} - -bool foobool(int argc) { - return argc; -} - -struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}} -extern S1 a; -class S2 { - mutable int a; -public: - S2():a(0) { } - static float S2s; // expected-note {{static data member is predetermined as shared}} -}; -const S2 b; -const S2 ba[5]; -class S3 { - int a; -public: - S3():a(0) { } -}; -const S3 c; // expected-note {{global variable is predetermined as shared}} -const S3 ca[5]; // expected-note {{global variable is predetermined as shared}} -extern const int f; // expected-note {{global variable is predetermined as shared}} -class S4 { // expected-note {{'S4' declared here}} - int a; - S4(); -public: - S4(int v):a(v) { } -}; -class S5 { // expected-note {{'S5' declared here}} - int a; - S5():a(0) {} -public: - S5(int v):a(v) { } -}; - -int threadvar; -#pragma omp threadprivate(threadvar) // expected-note {{defined as threadprivate or thread local}} - -int main(int argc, char **argv) { - const int d = 5; // expected-note {{constant variable is predetermined as shared}} - const int da[5] = { 0 }; // expected-note {{constant variable is predetermined as shared}} - S4 e(4); // expected-note {{'e' defined here}} - S5 g(5); // expected-note {{'g' defined here}} - int i; - int &j = i; // expected-note {{'j' defined here}} - #pragma omp target - #pragma omp teams private // expected-error {{expected '(' after 'private'}} - foo(); - #pragma omp target - #pragma omp teams private ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams private () // expected-error {{expected expression}} - foo(); - #pragma omp target - #pragma omp teams private (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams private (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} - foo(); - #pragma omp target - #pragma omp teams private (argc argv) // expected-error {{expected ',' or ')' in 'private' clause}} - foo(); - #pragma omp target - #pragma omp teams private (S1) // expected-error {{'S1' does not refer to a value}} - foo(); - #pragma omp target - #pragma omp teams private (a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 3 {{shared variable cannot be private}} - foo(); - #pragma omp target - #pragma omp teams private (argv[1]) // expected-error {{expected variable name}} - foo(); - #pragma omp target - #pragma omp teams private(ba) - foo(); - #pragma omp target - #pragma omp teams private(ca) // expected-error {{shared variable cannot be private}} - foo(); - #pragma omp target - #pragma omp teams private(da) // expected-error {{shared variable cannot be private}} - foo(); - #pragma omp target - #pragma omp teams private(S2::S2s) // expected-error {{shared variable cannot be private}} - foo(); - #pragma omp target - #pragma omp teams private(e, g) // expected-error 2 {{private variable must have an accessible, unambiguous default constructor}} - foo(); - #pragma omp target - #pragma omp teams private(threadvar) // expected-error {{threadprivate or thread local variable cannot be private}} - foo(); - #pragma omp target - #pragma omp teams shared(i), private(i) // expected-error {{shared variable cannot be private}} expected-note {{defined as shared}} - foo(); - #pragma omp target - #pragma omp teams firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}} - foo(); - #pragma omp target - #pragma omp teams private(i) - foo(); - #pragma omp target - #pragma omp teams private(j) // expected-error {{arguments of OpenMP clause 'private' cannot be of reference type 'int &'}} - foo(); - #pragma omp target - #pragma omp teams firstprivate(i) - for (int k = 0; k < 10; ++k) { - #pragma omp parallel private(i) - foo(); - } - - return 0; -} diff --git a/test/OpenMP/teams_reduction_messages.cpp b/test/OpenMP/teams_reduction_messages.cpp deleted file mode 100644 index afedfc3e46fd8e9594a2715aed568d33e41dff25..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_reduction_messages.cpp +++ /dev/null @@ -1,307 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -o - %s - -void foo() { -} - -bool foobool(int argc) { - return argc; -} - -struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}} -extern S1 a; -class S2 { - mutable int a; - S2 &operator+=(const S2 &arg) { return (*this); } - -public: - S2() : a(0) {} - S2(S2 &s2) : a(s2.a) {} - static float S2s; // expected-note 2 {{static data member is predetermined as shared}} - static const float S2sc; -}; -const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}} -S2 b; // expected-note 2 {{'b' defined here}} -const S2 ba[5]; // expected-note 2 {{'ba' defined here}} -class S3 { - int a; - -public: - S3() : a(0) {} - S3(const S3 &s3) : a(s3.a) {} - S3 operator+=(const S3 &arg1) { return arg1; } -}; -int operator+=(const S3 &arg1, const S3 &arg2) { return 5; } -S3 c; // expected-note 2 {{'c' defined here}} -const S3 ca[5]; // expected-note 2 {{'ca' defined here}} -extern const int f; // expected-note 4 {{'f' declared here}} -class S4 { // expected-note {{'S4' declared here}} - int a; - S4(); - S4(const S4 &s4); - S4 &operator+=(const S4 &arg) { return (*this); } - -public: - S4(int v) : a(v) {} -}; -S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; } -class S5 { - int a; - S5() : a(0) {} - S5(const S5 &s5) : a(s5.a) {} - S5 &operator+=(const S5 &arg); - -public: - S5(int v) : a(v) {} -}; -class S6 { - int a; - -public: - S6() : a(6) {} - operator int() { return 6; } -} o; // expected-note 2 {{'o' defined here}} - -S3 h, k; -#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}} - -template <class T> // expected-note {{declared here}} -T tmain(T argc) { // expected-note 2 {{'argc' defined here}} - const T d = T(); // expected-note 4 {{'d' defined here}} - const T da[5] = {T()}; // expected-note 2 {{'da' defined here}} - T qa[5] = {T()}; - T i; - T &j = i; // expected-note 4 {{'j' defined here}} - S3 &p = k; // expected-note 2 {{'p' defined here}} - const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}} - T &q = qa[(int)i]; // expected-note 2 {{'q' defined here}} - T fl; // expected-note {{'fl' defined here}} -#pragma omp target -#pragma omp teams reduction // expected-error {{expected '(' after 'reduction'}} - foo(); -#pragma omp target -#pragma omp teams reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); -#pragma omp target -#pragma omp teams reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); -#pragma omp target -#pragma omp teams reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); -#pragma omp target -#pragma omp teams reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} - foo(); -#pragma omp target -#pragma omp teams reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} - foo(); -#pragma omp target -#pragma omp teams reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} - foo(); -#pragma omp target -#pragma omp teams reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{variable of type 'float' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{variable of type 'float' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name}} - foo(); -#pragma omp target -#pragma omp teams reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}} - foo(); -#pragma omp target -#pragma omp teams reduction(&& : argc) - foo(); -#pragma omp target -#pragma omp teams reduction(^ : T) // expected-error {{'T' does not refer to a value}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : a, b, c, d, f) // expected-error {{reduction variable with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(min : a, b, c, d, f) // expected-error {{reduction variable with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(max : qa[1]) // expected-error 2 {{expected variable name}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : ba) // expected-error {{a reduction variable with array type 'const S2 [5]'}} - foo(); -#pragma omp target -#pragma omp teams reduction(* : ca) // expected-error {{a reduction variable with array type 'const S3 [5]'}} - foo(); -#pragma omp target -#pragma omp teams reduction(- : da) // expected-error {{a reduction variable with array type 'const int [5]'}} expected-error {{a reduction variable with array type 'const float [5]'}} - foo(); -#pragma omp target -#pragma omp teams reduction(^ : fl) // expected-error {{variable of type 'float' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : o) // expected-error {{variable of type 'class S6' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} - foo(); -#pragma omp parallel private(k) -#pragma omp target -#pragma omp teams reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : p), reduction(+ : p) // expected-error 3 {{variable can appear only once in OpenMP 'reduction' clause}} expected-note 3 {{previously referenced here}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp parallel shared(i) -#pragma omp parallel reduction(min : i) -#pragma omp target -#pragma omp teams reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} - foo(); -#pragma omp target -#pragma omp teams -#pragma omp parallel for private(fl) - for (int i = 0; i < 10; ++i) -#pragma omp target -#pragma omp teams reduction(+ : fl) - foo(); -#pragma omp target -#pragma omp teams -#pragma omp parallel for reduction(- : fl) - for (int i = 0; i < 10; ++i) -#pragma omp target -#pragma omp teams reduction(+ : fl) - foo(); - - return T(); -} - -int main(int argc, char **argv) { - const int d = 5; // expected-note 2 {{'d' defined here}} - const int da[5] = {0}; // expected-note {{'da' defined here}} - int qa[5] = {0}; - S4 e(4); // expected-note {{'e' defined here}} - S5 g(5); // expected-note {{'g' defined here}} - int i; - int &j = i; // expected-note 2 {{'j' defined here}} - S3 &p = k; // expected-note 2 {{'p' defined here}} - const int &r = da[i]; // expected-note {{'r' defined here}} - int &q = qa[i]; // expected-note {{'q' defined here}} - float fl; // expected-note {{'fl' defined here}} -#pragma omp target -#pragma omp teams reduction // expected-error {{expected '(' after 'reduction'}} - foo(); -#pragma omp target -#pragma omp teams reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp teams' are ignored}} - foo(); -#pragma omp target -#pragma omp teams reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); -#pragma omp target -#pragma omp teams reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); -#pragma omp target -#pragma omp teams reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} - foo(); -#pragma omp target -#pragma omp teams reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} - foo(); -#pragma omp target -#pragma omp teams reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} - foo(); -#pragma omp target -#pragma omp teams reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}} - foo(); -#pragma omp target -#pragma omp teams reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); -#pragma omp target -#pragma omp teams reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} - foo(); -#pragma omp target -#pragma omp teams reduction(~ : argc) // expected-error {{expected unqualified-id}} - foo(); -#pragma omp target -#pragma omp teams reduction(&& : argc) - foo(); -#pragma omp target -#pragma omp teams reduction(^ : S1) // expected-error {{'S1' does not refer to a value}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : a, b, c, d, f) // expected-error {{reduction variable with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(min : a, b, c, d, f) // expected-error {{reduction variable with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(max : argv[1]) // expected-error {{expected variable name}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : ba) // expected-error {{a reduction variable with array type 'const S2 [5]'}} - foo(); -#pragma omp target -#pragma omp teams reduction(* : ca) // expected-error {{a reduction variable with array type 'const S3 [5]'}} - foo(); -#pragma omp target -#pragma omp teams reduction(- : da) // expected-error {{a reduction variable with array type 'const int [5]'}} - foo(); -#pragma omp target -#pragma omp teams reduction(^ : fl) // expected-error {{variable of type 'float' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(& : e, g) // expected-error {{reduction variable must have an accessible, unambiguous default constructor}} expected-error {{variable of type 'S5' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : o) // expected-error {{variable of type 'class S6' is not valid for specified reduction operation}} - foo(); -#pragma omp target -#pragma omp teams private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} - foo(); -#pragma omp parallel private(k) -#pragma omp target -#pragma omp teams reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}} - foo(); -#pragma omp target -#pragma omp teams reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}} - foo(); -#pragma omp parallel shared(i) -#pragma omp parallel reduction(min : i) -#pragma omp target -#pragma omp teams reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}} - foo(); -#pragma omp target -#pragma omp teams -#pragma omp parallel for private(fl) - for (int i = 0; i < 10; ++i) -#pragma omp target -#pragma omp teams reduction(+ : fl) - foo(); -#pragma omp target -#pragma omp teams -#pragma omp parallel for reduction(- : fl) - for (int i = 0; i < 10; ++i) -#pragma omp target -#pragma omp teams reduction(+ : fl) - foo(); - - return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}} -} diff --git a/test/OpenMP/teams_shared_messages.cpp b/test/OpenMP/teams_shared_messages.cpp deleted file mode 100644 index ce2f917e207c30e2f83f64e13d1304e7486ff014..0000000000000000000000000000000000000000 --- a/test/OpenMP/teams_shared_messages.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s - -void foo() { -} - -bool foobool(int argc) { - return argc; -} - -struct S1; // expected-note {{declared here}} -extern S1 a; -class S2 { - mutable int a; -public: - S2():a(0) { } - S2(S2 &s2):a(s2.a) { } -}; -const S2 b; -const S2 ba[5]; -class S3 { - int a; -public: - S3():a(0) { } - S3(S3 &s3):a(s3.a) { } -}; -const S3 c; -const S3 ca[5]; -extern const int f; -class S4 { - int a; - S4(); - S4(const S4 &s4); -public: - S4(int v):a(v) { } -}; -class S5 { - int a; - S5():a(0) {} - S5(const S5 &s5):a(s5.a) { } -public: - S5(int v):a(v) { } -}; - -S3 h; -#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}} - -int main(int argc, char **argv) { - const int d = 5; - const int da[5] = { 0 }; - S4 e(4); - S5 g(5); - int i; - int &j = i; - #pragma omp target - #pragma omp teams shared // expected-error {{expected '(' after 'shared'}} - foo(); - #pragma omp target - #pragma omp teams shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams shared () // expected-error {{expected expression}} - foo(); - #pragma omp target - #pragma omp teams shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} - foo(); - #pragma omp target - #pragma omp teams shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} - foo(); - #pragma omp target - #pragma omp teams shared (argc) - foo(); - #pragma omp target - #pragma omp teams shared (S1) // expected-error {{'S1' does not refer to a value}} - foo(); - #pragma omp target - #pragma omp teams shared (a, b, c, d, f) - foo(); - #pragma omp target - #pragma omp teams shared (argv[1]) // expected-error {{expected variable name}} - foo(); - #pragma omp target - #pragma omp teams shared(ba) - foo(); - #pragma omp target - #pragma omp teams shared(ca) - foo(); - #pragma omp target - #pragma omp teams shared(da) - foo(); - #pragma omp target - #pragma omp teams shared(e, g) - foo(); - #pragma omp target - #pragma omp teams shared(h) // expected-error {{threadprivate or thread local variable cannot be shared}} - foo(); - #pragma omp target - #pragma omp teams private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}} - foo(); - #pragma omp target - #pragma omp teams firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}} - foo(); - #pragma omp target - #pragma omp teams private(i) - foo(); - #pragma omp target - #pragma omp teams shared(i) - foo(); - #pragma omp target - #pragma omp teams shared(j) - foo(); - #pragma omp target - #pragma omp teams firstprivate(i) - foo(); - #pragma omp target - #pragma omp teams shared(i) - foo(); - #pragma omp target - #pragma omp teams shared(j) - foo(); - - return 0; -} diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index eab289206e105148fa37fa2d7e0b5e40f2942ef6..df696b1cdf4bef8257569405b5e5a329befc3b27 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -1883,7 +1883,6 @@ public: void VisitOMPOrderedDirective(const OMPOrderedDirective *D); void VisitOMPAtomicDirective(const OMPAtomicDirective *D); void VisitOMPTargetDirective(const OMPTargetDirective *D); - void VisitOMPTeamsDirective(const OMPTeamsDirective *D); private: void AddDeclarationNameInfo(const Stmt *S); @@ -2421,10 +2420,6 @@ void EnqueueVisitor::VisitOMPTargetDirective(const OMPTargetDirective *D) { VisitOMPExecutableDirective(D); } -void EnqueueVisitor::VisitOMPTeamsDirective(const OMPTeamsDirective *D) { - VisitOMPExecutableDirective(D); -} - void CursorVisitor::EnqueueWorkList(VisitorWorkList &WL, const Stmt *S) { EnqueueVisitor(WL, MakeCXCursor(S, StmtParent, TU,RegionOfInterest)).Visit(S); } @@ -4194,8 +4189,6 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) { return cxstring::createRef("OMPAtomicDirective"); case CXCursor_OMPTargetDirective: return cxstring::createRef("OMPTargetDirective"); - case CXCursor_OMPTeamsDirective: - return cxstring::createRef("OMPTeamsDirective"); } llvm_unreachable("Unhandled CXCursorKind"); diff --git a/tools/libclang/CXCursor.cpp b/tools/libclang/CXCursor.cpp index 782f05e1e85c39564be7c23284389e3919403d0e..05117ef035622a86db00a8f3db60cedc118a775b 100644 --- a/tools/libclang/CXCursor.cpp +++ b/tools/libclang/CXCursor.cpp @@ -578,9 +578,6 @@ CXCursor cxcursor::MakeCXCursor(const Stmt *S, const Decl *Parent, case Stmt::OMPTargetDirectiveClass: K = CXCursor_OMPTargetDirective; break; - case Stmt::OMPTeamsDirectiveClass: - K = CXCursor_OMPTeamsDirective; - break; } CXCursor C = { K, 0, { Parent, S, TU } };