Skip to content

Commit 7efb825

Browse files
committed
Revert "OpenMP 5.0 metadirective"
This reverts commit c7d7b98.
1 parent c7d7b98 commit 7efb825

35 files changed

+5
-773
lines changed

clang/include/clang-c/Index.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,11 +2592,7 @@ enum CXCursorKind {
25922592
*/
25932593
CXCursor_OMPUnrollDirective = 293,
25942594

2595-
/** OpenMP metadirective directive.
2596-
*/
2597-
CXCursor_OMPMetaDirective = 294,
2598-
2599-
CXCursor_LastStmt = CXCursor_OMPMetaDirective,
2595+
CXCursor_LastStmt = CXCursor_OMPUnrollDirective,
26002596

26012597
/**
26022598
* Cursor that represents the translation unit itself.

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,9 +2842,6 @@ RecursiveASTVisitor<Derived>::TraverseOMPLoopDirective(OMPLoopDirective *S) {
28422842
return TraverseOMPExecutableDirective(S);
28432843
}
28442844

2845-
DEF_TRAVERSE_STMT(OMPMetaDirective,
2846-
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
2847-
28482845
DEF_TRAVERSE_STMT(OMPParallelDirective,
28492846
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
28502847

clang/include/clang/AST/StmtOpenMP.h

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5379,44 +5379,6 @@ class OMPMaskedDirective final : public OMPExecutableDirective {
53795379
}
53805380
};
53815381

5382-
/// This represents '#pragma omp metadirective' directive.
5383-
///
5384-
/// \code
5385-
/// #pragma omp metadirective when(user={condition(N>10)}: parallel for)
5386-
/// \endcode
5387-
/// In this example directive '#pragma omp metadirective' has clauses 'when'
5388-
/// with a dynamic user condition to check if a variable 'N > 10'
5389-
///
5390-
class OMPMetaDirective final : public OMPExecutableDirective {
5391-
friend class ASTStmtReader;
5392-
friend class OMPExecutableDirective;
5393-
Stmt *IfStmt;
5394-
5395-
OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
5396-
: OMPExecutableDirective(OMPMetaDirectiveClass,
5397-
llvm::omp::OMPD_metadirective, StartLoc,
5398-
EndLoc) {}
5399-
explicit OMPMetaDirective()
5400-
: OMPExecutableDirective(OMPMetaDirectiveClass,
5401-
llvm::omp::OMPD_metadirective, SourceLocation(),
5402-
SourceLocation()) {}
5403-
5404-
void setIfStmt(Stmt *S) { IfStmt = S; }
5405-
5406-
public:
5407-
static OMPMetaDirective *Create(const ASTContext &C, SourceLocation StartLoc,
5408-
SourceLocation EndLoc,
5409-
ArrayRef<OMPClause *> Clauses,
5410-
Stmt *AssociatedStmt, Stmt *IfStmt);
5411-
static OMPMetaDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
5412-
EmptyShell);
5413-
Stmt *getIfStmt() const { return IfStmt; }
5414-
5415-
static bool classof(const Stmt *T) {
5416-
return T->getStmtClass() == OMPMetaDirectiveClass;
5417-
}
5418-
};
5419-
54205382
} // end namespace clang
54215383

54225384
#endif

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,9 +1436,6 @@ def warn_omp51_compat_attributes : Warning<
14361436
"specifying OpenMP directives with [[]] is incompatible with OpenMP "
14371437
"standards before OpenMP 5.1">,
14381438
InGroup<OpenMPPre51Compat>, DefaultIgnore;
1439-
def err_omp_expected_colon : Error<"missing ':' in %0">;
1440-
def err_omp_expected_context_selector
1441-
: Error<"expected valid context selector in %0">;
14421439

14431440
// Pragma loop support.
14441441
def err_pragma_loop_missing_argument : Error<

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10794,8 +10794,6 @@ def err_omp_dispatch_statement_call
1079410794
def err_omp_unroll_full_variable_trip_count : Error<
1079510795
"loop to be fully unrolled must have a constant trip count">;
1079610796
def note_omp_directive_here : Note<"'%0' directive found here">;
10797-
def err_omp_instantiation_not_supported
10798-
: Error<"instantiation of '%0' not supported yet">;
1079910797
} // end of OpenMP category
1080010798

1080110799
let CategoryName = "Related Result Type Issue" in {

clang/include/clang/Basic/StmtNodes.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ def AsTypeExpr : StmtNode<Expr>;
219219
// OpenMP Directives.
220220
def OMPCanonicalLoop : StmtNode<Stmt>;
221221
def OMPExecutableDirective : StmtNode<Stmt, 1>;
222-
def OMPMetaDirective : StmtNode<OMPExecutableDirective>;
223222
def OMPLoopBasedDirective : StmtNode<OMPExecutableDirective, 1>;
224223
def OMPLoopDirective : StmtNode<OMPLoopBasedDirective, 1>;
225224
def OMPParallelDirective : StmtNode<OMPExecutableDirective>;

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10456,12 +10456,6 @@ class Sema final {
1045610456
/// \param Init First part of the for loop.
1045710457
void ActOnOpenMPLoopInitialization(SourceLocation ForLoc, Stmt *Init);
1045810458

10459-
/// Called on well-formed '\#pragma omp metadirective' after parsing
10460-
/// of the associated statement.
10461-
StmtResult ActOnOpenMPMetaDirective(ArrayRef<OMPClause *> Clauses,
10462-
Stmt *AStmt, SourceLocation StartLoc,
10463-
SourceLocation EndLoc);
10464-
1046510459
// OpenMP directives and clauses.
1046610460
/// Called on correct id-expression from the '#pragma omp
1046710461
/// threadprivate'.
@@ -11029,10 +11023,6 @@ class Sema final {
1102911023
SourceLocation StartLoc,
1103011024
SourceLocation LParenLoc,
1103111025
SourceLocation EndLoc);
11032-
/// Called on well-formed 'when' clause.
11033-
OMPClause *ActOnOpenMPWhenClause(OMPTraitInfo &TI, SourceLocation StartLoc,
11034-
SourceLocation LParenLoc,
11035-
SourceLocation EndLoc);
1103611026
/// Called on well-formed 'default' clause.
1103711027
OMPClause *ActOnOpenMPDefaultClause(llvm::omp::DefaultKind Kind,
1103811028
SourceLocation KindLoc,

clang/include/clang/Serialization/ASTBitCodes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,6 @@ enum StmtCode {
18931893
STMT_SEH_TRY, // SEHTryStmt
18941894

18951895
// OpenMP directives
1896-
STMT_OMP_META_DIRECTIVE,
18971896
STMT_OMP_CANONICAL_LOOP,
18981897
STMT_OMP_PARALLEL_DIRECTIVE,
18991898
STMT_OMP_SIMD_DIRECTIVE,

clang/lib/AST/OpenMPClause.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) {
160160
case OMPC_exclusive:
161161
case OMPC_uses_allocators:
162162
case OMPC_affinity:
163-
case OMPC_when:
164163
break;
165164
default:
166165
break;
@@ -258,7 +257,6 @@ const OMPClauseWithPostUpdate *OMPClauseWithPostUpdate::get(const OMPClause *C)
258257
case OMPC_exclusive:
259258
case OMPC_uses_allocators:
260259
case OMPC_affinity:
261-
case OMPC_when:
262260
break;
263261
default:
264262
break;

clang/lib/AST/StmtOpenMP.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -253,25 +253,6 @@ void OMPLoopDirective::setFinalsConditions(ArrayRef<Expr *> A) {
253253
llvm::copy(A, getFinalsConditions().begin());
254254
}
255255

256-
OMPMetaDirective *OMPMetaDirective::Create(const ASTContext &C,
257-
SourceLocation StartLoc,
258-
SourceLocation EndLoc,
259-
ArrayRef<OMPClause *> Clauses,
260-
Stmt *AssociatedStmt, Stmt *IfStmt) {
261-
auto *Dir = createDirective<OMPMetaDirective>(
262-
C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);
263-
Dir->setIfStmt(IfStmt);
264-
return Dir;
265-
}
266-
267-
OMPMetaDirective *OMPMetaDirective::CreateEmpty(const ASTContext &C,
268-
unsigned NumClauses,
269-
EmptyShell) {
270-
return createEmptyDirective<OMPMetaDirective>(C, NumClauses,
271-
/*HasAssociatedStmt=*/true,
272-
/*NumChildren=*/1);
273-
}
274-
275256
OMPParallelDirective *OMPParallelDirective::Create(
276257
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
277258
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,

clang/lib/AST/StmtPrinter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,6 @@ void StmtPrinter::PrintOMPExecutableDirective(OMPExecutableDirective *S,
654654
PrintStmt(S->getRawStmt());
655655
}
656656

657-
void StmtPrinter::VisitOMPMetaDirective(OMPMetaDirective *Node) {
658-
Indent() << "#pragma omp metadirective";
659-
PrintOMPExecutableDirective(Node);
660-
}
661-
662657
void StmtPrinter::VisitOMPParallelDirective(OMPParallelDirective *Node) {
663658
Indent() << "#pragma omp parallel";
664659
PrintOMPExecutableDirective(Node);

clang/lib/AST/StmtProfile.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -903,10 +903,6 @@ void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) {
903903
VisitOMPLoopBasedDirective(S);
904904
}
905905

906-
void StmtProfiler::VisitOMPMetaDirective(const OMPMetaDirective *S) {
907-
VisitOMPExecutableDirective(S);
908-
}
909-
910906
void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) {
911907
VisitOMPExecutableDirective(S);
912908
}

clang/lib/Basic/OpenMPKinds.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ unsigned clang::getOpenMPSimpleClauseType(OpenMPClauseKind Kind, StringRef Str,
185185
case OMPC_exclusive:
186186
case OMPC_uses_allocators:
187187
case OMPC_affinity:
188-
case OMPC_when:
189188
break;
190189
default:
191190
break;
@@ -429,7 +428,6 @@ const char *clang::getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind,
429428
case OMPC_exclusive:
430429
case OMPC_uses_allocators:
431430
case OMPC_affinity:
432-
case OMPC_when:
433431
break;
434432
default:
435433
break;
@@ -593,9 +591,6 @@ void clang::getOpenMPCaptureRegions(
593591
OpenMPDirectiveKind DKind) {
594592
assert(unsigned(DKind) < llvm::omp::Directive_enumSize);
595593
switch (DKind) {
596-
case OMPD_metadirective:
597-
CaptureRegions.push_back(OMPD_metadirective);
598-
break;
599594
case OMPD_parallel:
600595
case OMPD_parallel_for:
601596
case OMPD_parallel_for_simd:

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6740,7 +6740,6 @@ const Expr *CGOpenMPRuntime::getNumTeamsExprForTargetDirective(
67406740
case OMPD_parallel_master_taskloop:
67416741
case OMPD_parallel_master_taskloop_simd:
67426742
case OMPD_requires:
6743-
case OMPD_metadirective:
67446743
case OMPD_unknown:
67456744
break;
67466745
default:
@@ -7215,7 +7214,6 @@ llvm::Value *CGOpenMPRuntime::emitNumThreadsForTargetDirective(
72157214
case OMPD_parallel_master_taskloop:
72167215
case OMPD_parallel_master_taskloop_simd:
72177216
case OMPD_requires:
7218-
case OMPD_metadirective:
72197217
case OMPD_unknown:
72207218
break;
72217219
default:
@@ -9853,7 +9851,6 @@ getNestedDistributeDirective(ASTContext &Ctx, const OMPExecutableDirective &D) {
98539851
case OMPD_parallel_master_taskloop:
98549852
case OMPD_parallel_master_taskloop_simd:
98559853
case OMPD_requires:
9856-
case OMPD_metadirective:
98579854
case OMPD_unknown:
98589855
default:
98599856
llvm_unreachable("Unexpected directive.");
@@ -10704,7 +10701,6 @@ void CGOpenMPRuntime::scanForTargetRegionsFunctions(const Stmt *S,
1070410701
case OMPD_parallel_master_taskloop:
1070510702
case OMPD_parallel_master_taskloop_simd:
1070610703
case OMPD_requires:
10707-
case OMPD_metadirective:
1070810704
case OMPD_unknown:
1070910705
default:
1071010706
llvm_unreachable("Unknown target directive for OpenMP device codegen.");
@@ -11386,7 +11382,6 @@ void CGOpenMPRuntime::emitTargetDataStandAloneCall(
1138611382
case OMPD_target_parallel_for:
1138711383
case OMPD_target_parallel_for_simd:
1138811384
case OMPD_requires:
11389-
case OMPD_metadirective:
1139011385
case OMPD_unknown:
1139111386
default:
1139211387
llvm_unreachable("Unexpected standalone target data directive.");

clang/lib/CodeGen/CGStmt.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ void CodeGenFunction::EmitStmt(const Stmt *S, ArrayRef<const Attr *> Attrs) {
196196
case Stmt::SEHTryStmtClass:
197197
EmitSEHTryStmt(cast<SEHTryStmt>(*S));
198198
break;
199-
case Stmt::OMPMetaDirectiveClass:
200-
EmitOMPMetaDirective(cast<OMPMetaDirective>(*S));
201-
break;
202199
case Stmt::OMPCanonicalLoopClass:
203200
EmitOMPCanonicalLoop(cast<OMPCanonicalLoop>(S));
204201
break;

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,10 +1784,6 @@ void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) {
17841784
checkForLastprivateConditionalUpdate(*this, S);
17851785
}
17861786

1787-
void CodeGenFunction::EmitOMPMetaDirective(const OMPMetaDirective &S) {
1788-
EmitStmt(S.getIfStmt());
1789-
}
1790-
17911787
namespace {
17921788
/// RAII to handle scopes for loop transformation directives.
17931789
class OMPTransformDirectiveScopeRAII {
@@ -5964,7 +5960,6 @@ static void emitOMPAtomicExpr(CodeGenFunction &CGF, OpenMPClauseKind Kind,
59645960
case OMPC_novariants:
59655961
case OMPC_nocontext:
59665962
case OMPC_filter:
5967-
case OMPC_when:
59685963
llvm_unreachable("Clause is not allowed in 'omp atomic'.");
59695964
}
59705965
}

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3464,7 +3464,6 @@ class CodeGenFunction : public CodeGenTypeCache {
34643464
const RegionCodeGenTy &BodyGen,
34653465
OMPTargetDataInfo &InputInfo);
34663466

3467-
void EmitOMPMetaDirective(const OMPMetaDirective &S);
34683467
void EmitOMPParallelDirective(const OMPParallelDirective &S);
34693468
void EmitOMPSimdDirective(const OMPSimdDirective &S);
34703469
void EmitOMPTileDirective(const OMPTileDirective &S);

0 commit comments

Comments
 (0)