r254899 - [OPENMP 4.5] parsing/sema support for 'nogroup' clause.
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 7 02:51:45 PST 2015
Author: abataev
Date: Mon Dec 7 04:51:44 2015
New Revision: 254899
URL: http://llvm.org/viewvc/llvm-project?rev=254899&view=rev
Log:
[OPENMP 4.5] parsing/sema support for 'nogroup' clause.
OpenMP 4.5 adds 'taskloop' and 'taskloop simd' directives. These directives have new 'nogroup' clause. Patch adds basic parsing/sema support for this clause.
Modified:
cfe/trunk/include/clang/AST/OpenMPClause.h
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
cfe/trunk/include/clang/Basic/OpenMPKinds.def
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtProfile.cpp
cfe/trunk/lib/Basic/OpenMPKinds.cpp
cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp
cfe/trunk/lib/Parse/ParseOpenMP.cpp
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/lib/Sema/TreeTransform.h
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
cfe/trunk/test/OpenMP/taskloop_ast_print.cpp
cfe/trunk/test/OpenMP/taskloop_misc_messages.c
cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp
cfe/trunk/test/OpenMP/taskloop_simd_misc_messages.c
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/include/clang/AST/OpenMPClause.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OpenMPClause.h?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/OpenMPClause.h (original)
+++ cfe/trunk/include/clang/AST/OpenMPClause.h Mon Dec 7 04:51:44 2015
@@ -2893,6 +2893,37 @@ public:
child_range children() { return child_range(&Priority, &Priority + 1); }
};
+/// \brief This represents 'nogroup' clause in the '#pragma omp ...' directive.
+///
+/// \code
+/// #pragma omp taskloop nogroup
+/// \endcode
+/// In this example directive '#pragma omp taskloop' has 'nogroup' clause.
+///
+class OMPNogroupClause : public OMPClause {
+public:
+ /// \brief Build 'nogroup' clause.
+ ///
+ /// \param StartLoc Starting location of the clause.
+ /// \param EndLoc Ending location of the clause.
+ ///
+ OMPNogroupClause(SourceLocation StartLoc, SourceLocation EndLoc)
+ : OMPClause(OMPC_nogroup, StartLoc, EndLoc) {}
+
+ /// \brief Build an empty clause.
+ ///
+ OMPNogroupClause()
+ : OMPClause(OMPC_nogroup, SourceLocation(), SourceLocation()) {}
+
+ static bool classof(const OMPClause *T) {
+ return T->getClauseKind() == OMPC_nogroup;
+ }
+
+ child_range children() {
+ return child_range(child_iterator(), child_iterator());
+ }
+};
+
} // end namespace clang
#endif // LLVM_CLANG_AST_OPENMPCLAUSE_H
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Mon Dec 7 04:51:44 2015
@@ -2571,6 +2571,11 @@ bool RecursiveASTVisitor<Derived>::Visit
}
template <typename Derived>
+bool RecursiveASTVisitor<Derived>::VisitOMPNogroupClause(OMPNogroupClause *) {
+ return true;
+}
+
+template <typename Derived>
template <typename T>
bool RecursiveASTVisitor<Derived>::VisitOMPClauseList(T *Node) {
for (auto *E : Node->varlists()) {
Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/OpenMPKinds.def (original)
+++ cfe/trunk/include/clang/Basic/OpenMPKinds.def Mon Dec 7 04:51:44 2015
@@ -161,6 +161,7 @@ OPENMP_CLAUSE(map, OMPMapClause)
OPENMP_CLAUSE(num_teams, OMPNumTeamsClause)
OPENMP_CLAUSE(thread_limit, OMPThreadLimitClause)
OPENMP_CLAUSE(priority, OMPPriorityClause)
+OPENMP_CLAUSE(nogroup, OMPNogroupClause)
// Clauses allowed for OpenMP directive 'parallel'.
OPENMP_PARALLEL_CLAUSE(if)
@@ -363,6 +364,7 @@ OPENMP_TASKLOOP_CLAUSE(final)
OPENMP_TASKLOOP_CLAUSE(untied)
OPENMP_TASKLOOP_CLAUSE(mergeable)
OPENMP_TASKLOOP_CLAUSE(priority)
+OPENMP_TASKLOOP_CLAUSE(nogroup)
// Clauses allowed for OpenMP directive 'taskloop simd'.
// TODO: add next clauses
@@ -381,6 +383,7 @@ OPENMP_TASKLOOP_SIMD_CLAUSE(linear)
OPENMP_TASKLOOP_SIMD_CLAUSE(aligned)
OPENMP_TASKLOOP_SIMD_CLAUSE(safelen)
OPENMP_TASKLOOP_SIMD_CLAUSE(simdlen)
+OPENMP_TASKLOOP_SIMD_CLAUSE(nogroup)
#undef OPENMP_TASKLOOP_SIMD_CLAUSE
#undef OPENMP_TASKLOOP_CLAUSE
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Mon Dec 7 04:51:44 2015
@@ -8069,6 +8069,9 @@ public:
/// \brief Called on well-formed 'simd' clause.
OMPClause *ActOnOpenMPSIMDClause(SourceLocation StartLoc,
SourceLocation EndLoc);
+ /// \brief Called on well-formed 'nogroup' clause.
+ OMPClause *ActOnOpenMPNogroupClause(SourceLocation StartLoc,
+ SourceLocation EndLoc);
OMPClause *ActOnOpenMPVarListClause(
OpenMPClauseKind Kind, ArrayRef<Expr *> Vars, Expr *TailExpr,
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Mon Dec 7 04:51:44 2015
@@ -677,6 +677,10 @@ void OMPClausePrinter::VisitOMPUntiedCla
OS << "untied";
}
+void OMPClausePrinter::VisitOMPNogroupClause(OMPNogroupClause *) {
+ OS << "nogroup";
+}
+
void OMPClausePrinter::VisitOMPMergeableClause(OMPMergeableClause *) {
OS << "mergeable";
}
Modified: cfe/trunk/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)
+++ cfe/trunk/lib/AST/StmtProfile.cpp Mon Dec 7 04:51:44 2015
@@ -337,6 +337,8 @@ void OMPClauseProfiler::VisitOMPThreadsC
void OMPClauseProfiler::VisitOMPSIMDClause(const OMPSIMDClause *) {}
+void OMPClauseProfiler::VisitOMPNogroupClause(const OMPNogroupClause *) {}
+
template<typename T>
void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
for (auto *E : Node->varlists()) {
Modified: cfe/trunk/lib/Basic/OpenMPKinds.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/OpenMPKinds.cpp (original)
+++ cfe/trunk/lib/Basic/OpenMPKinds.cpp Mon Dec 7 04:51:44 2015
@@ -138,6 +138,7 @@ unsigned clang::getOpenMPSimpleClauseTyp
case OMPC_num_teams:
case OMPC_thread_limit:
case OMPC_priority:
+ case OMPC_nogroup:
break;
}
llvm_unreachable("Invalid OpenMP simple clause kind");
@@ -239,6 +240,7 @@ const char *clang::getOpenMPSimpleClause
case OMPC_num_teams:
case OMPC_thread_limit:
case OMPC_priority:
+ case OMPC_nogroup:
break;
}
llvm_unreachable("Invalid OpenMP simple clause kind");
Modified: cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp Mon Dec 7 04:51:44 2015
@@ -2481,6 +2481,7 @@ static void EmitOMPAtomicExpr(CodeGenFun
case OMPC_num_teams:
case OMPC_thread_limit:
case OMPC_priority:
+ case OMPC_nogroup:
llvm_unreachable("Clause is not allowed in 'omp atomic'.");
}
}
Modified: cfe/trunk/lib/Parse/ParseOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseOpenMP.cpp (original)
+++ cfe/trunk/lib/Parse/ParseOpenMP.cpp Mon Dec 7 04:51:44 2015
@@ -400,7 +400,7 @@ bool Parser::ParseOpenMPSimpleVarList(Op
/// mergeable-clause | flush-clause | read-clause | write-clause |
/// update-clause | capture-clause | seq_cst-clause | device-clause |
/// simdlen-clause | threads-clause | simd-clause | num_teams-clause |
-/// thread_limit-clause | priority-clause
+/// thread_limit-clause | priority-clause | nogroup-clause
///
OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
OpenMPClauseKind CKind, bool FirstClause) {
@@ -488,6 +488,7 @@ OMPClause *Parser::ParseOpenMPClause(Ope
case OMPC_seq_cst:
case OMPC_threads:
case OMPC_simd:
+ case OMPC_nogroup:
// 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]
@@ -627,6 +628,9 @@ OMPClause *Parser::ParseOpenMPSimpleClau
/// simd-clause:
/// 'simd'
///
+/// nogroup-clause:
+/// 'nogroup'
+///
OMPClause *Parser::ParseOpenMPClause(OpenMPClauseKind Kind) {
SourceLocation Loc = Tok.getLocation();
ConsumeAnyToken();
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Mon Dec 7 04:51:44 2015
@@ -5408,6 +5408,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprCl
case OMPC_threads:
case OMPC_simd:
case OMPC_map:
+ case OMPC_nogroup:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
@@ -5684,6 +5685,7 @@ OMPClause *Sema::ActOnOpenMPSimpleClause
case OMPC_num_teams:
case OMPC_thread_limit:
case OMPC_priority:
+ case OMPC_nogroup:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
@@ -5817,6 +5819,7 @@ OMPClause *Sema::ActOnOpenMPSingleExprWi
case OMPC_num_teams:
case OMPC_thread_limit:
case OMPC_priority:
+ case OMPC_nogroup:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
@@ -5926,6 +5929,9 @@ OMPClause *Sema::ActOnOpenMPClause(OpenM
case OMPC_simd:
Res = ActOnOpenMPSIMDClause(StartLoc, EndLoc);
break;
+ case OMPC_nogroup:
+ Res = ActOnOpenMPNogroupClause(StartLoc, EndLoc);
+ break;
case OMPC_if:
case OMPC_final:
case OMPC_num_threads:
@@ -6009,6 +6015,11 @@ OMPClause *Sema::ActOnOpenMPSIMDClause(S
return new (Context) OMPSIMDClause(StartLoc, EndLoc);
}
+OMPClause *Sema::ActOnOpenMPNogroupClause(SourceLocation StartLoc,
+ SourceLocation EndLoc) {
+ return new (Context) OMPNogroupClause(StartLoc, EndLoc);
+}
+
OMPClause *Sema::ActOnOpenMPVarListClause(
OpenMPClauseKind Kind, ArrayRef<Expr *> VarList, Expr *TailExpr,
SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc,
@@ -6084,6 +6095,7 @@ OMPClause *Sema::ActOnOpenMPVarListClaus
case OMPC_num_teams:
case OMPC_thread_limit:
case OMPC_priority:
+ case OMPC_nogroup:
case OMPC_unknown:
llvm_unreachable("Clause is not allowed.");
}
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Mon Dec 7 04:51:44 2015
@@ -7546,6 +7546,13 @@ OMPClause *TreeTransform<Derived>::Trans
template <typename Derived>
OMPClause *
+TreeTransform<Derived>::TransformOMPNogroupClause(OMPNogroupClause *C) {
+ // No need to rebuild this clause, no template-dependent parameters.
+ return C;
+}
+
+template <typename Derived>
+OMPClause *
TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
Vars.reserve(C->varlist_size());
Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Mon Dec 7 04:51:44 2015
@@ -1811,6 +1811,9 @@ OMPClause *OMPClauseReader::readClause()
case OMPC_simd:
C = new (Context) OMPSIMDClause();
break;
+ case OMPC_nogroup:
+ C = new (Context) OMPNogroupClause();
+ break;
case OMPC_private:
C = OMPPrivateClause::CreateEmpty(Context, Record[Idx++]);
break;
@@ -1949,6 +1952,8 @@ void OMPClauseReader::VisitOMPThreadsCla
void OMPClauseReader::VisitOMPSIMDClause(OMPSIMDClause *) {}
+void OMPClauseReader::VisitOMPNogroupClause(OMPNogroupClause *) {}
+
void OMPClauseReader::VisitOMPPrivateClause(OMPPrivateClause *C) {
C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx));
unsigned NumVars = C->varlist_size();
Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Mon Dec 7 04:51:44 2015
@@ -1843,6 +1843,8 @@ void OMPClauseWriter::VisitOMPThreadsCla
void OMPClauseWriter::VisitOMPSIMDClause(OMPSIMDClause *) {}
+void OMPClauseWriter::VisitOMPNogroupClause(OMPNogroupClause *) {}
+
void OMPClauseWriter::VisitOMPPrivateClause(OMPPrivateClause *C) {
Record.push_back(C->varlist_size());
Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record);
Modified: cfe/trunk/test/OpenMP/taskloop_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_ast_print.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_ast_print.cpp Mon Dec 7 04:51:44 2015
@@ -20,7 +20,7 @@ T tmain(T argc) {
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: a = 2;
#pragma omp parallel
-#pragma omp taskloop private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f)
+#pragma omp taskloop private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) nogroup
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
for (int j = 0; j < 2; ++j)
@@ -33,7 +33,7 @@ T tmain(T argc) {
for (int j = 0; j < 2; ++j)
foo();
// CHECK-NEXT: #pragma omp parallel
- // CHECK-NEXT: #pragma omp taskloop private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f)
+ // CHECK-NEXT: #pragma omp taskloop private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) nogroup
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
@@ -52,8 +52,8 @@ int main(int argc, char **argv) {
int b = argc, c, d, e, f, g;
static int a;
// CHECK: static int a;
-#pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5)
- // CHECK-NEXT: #pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5)
+#pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) nogroup
+ // CHECK-NEXT: #pragma omp taskloop if(taskloop: a) default(none) shared(a) final(b) priority(5) nogroup
for (int i = 0; i < 2; ++i)
a = 2;
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
Modified: cfe/trunk/test/OpenMP/taskloop_misc_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_misc_messages.c?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_misc_messages.c (original)
+++ cfe/trunk/test/OpenMP/taskloop_misc_messages.c Mon Dec 7 04:51:44 2015
@@ -52,6 +52,10 @@ void test_invalid_clause() {
#pragma omp taskloop foo bar
for (i = 0; i < 16; ++i)
;
+// expected-error at +1 {{directive '#pragma omp taskloop' cannot contain more than one 'nogroup' clause}}
+#pragma omp taskloop nogroup nogroup
+ for (i = 0; i < 16; ++i)
+ ;
}
void test_non_identifiers() {
Modified: cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_ast_print.cpp Mon Dec 7 04:51:44 2015
@@ -21,7 +21,7 @@ T tmain(T argc) {
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: a = 2;
#pragma omp parallel
-#pragma omp taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) simdlen(N)
+#pragma omp taskloop simd private(argc, b), firstprivate(c, d), lastprivate(d, f) collapse(N) shared(g) if (c) final(d) mergeable priority(f) simdlen(N) nogroup
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
for (int j = 0; j < 2; ++j)
@@ -34,7 +34,7 @@ T tmain(T argc) {
for (int j = 0; j < 2; ++j)
foo();
// CHECK-NEXT: #pragma omp parallel
- // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f)
+ // CHECK-NEXT: #pragma omp taskloop simd private(argc,b) firstprivate(c,d) lastprivate(d,f) collapse(N) shared(g) if(c) final(d) mergeable priority(f) simdlen(N) nogroup
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
// CHECK-NEXT: for (int j = 0; j < 2; ++j)
@@ -53,8 +53,8 @@ int main(int argc, char **argv) {
int b = argc, c, d, e, f, g;
static int a;
// CHECK: static int a;
-#pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b), aligned(argv)
- // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b) aligned(argv)
+#pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b), aligned(argv) nogroup
+ // CHECK-NEXT: #pragma omp taskloop simd if(taskloop: a) default(none) shared(a) final(b) priority(5) safelen(8) linear(b) aligned(argv) nogroup
for (int i = 0; i < 2; ++i)
a = 2;
// CHECK-NEXT: for (int i = 0; i < 2; ++i)
Modified: cfe/trunk/test/OpenMP/taskloop_simd_misc_messages.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/taskloop_simd_misc_messages.c?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/test/OpenMP/taskloop_simd_misc_messages.c (original)
+++ cfe/trunk/test/OpenMP/taskloop_simd_misc_messages.c Mon Dec 7 04:51:44 2015
@@ -52,6 +52,10 @@ void test_invalid_clause() {
#pragma omp taskloop simd foo bar
for (i = 0; i < 16; ++i)
;
+// expected-error at +1 {{directive '#pragma omp taskloop simd' cannot contain more than one 'nogroup' clause}}
+#pragma omp taskloop simd nogroup nogroup
+ for (i = 0; i < 16; ++i)
+ ;
}
void test_non_identifiers() {
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=254899&r1=254898&r2=254899&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Mon Dec 7 04:51:44 2015
@@ -2073,6 +2073,8 @@ void OMPClauseEnqueue::VisitOMPThreadsCl
void OMPClauseEnqueue::VisitOMPSIMDClause(const OMPSIMDClause *) {}
+void OMPClauseEnqueue::VisitOMPNogroupClause(const OMPNogroupClause *) {}
+
void OMPClauseEnqueue::VisitOMPDeviceClause(const OMPDeviceClause *C) {
Visitor->AddStmt(C->getDevice());
}
More information about the cfe-commits
mailing list