Skip to content

Commit f69ded0

Browse files
authored
[clang] Introduce SemaOpenMP (#88642)
This patch moves OpenMP-related entities out of `Sema` to a newly created `SemaOpenMP` class. This is a part of the effort to split `Sema` up, and follows the recent example of CUDA, OpenACC, SYCL, HLSL. Additional context can be found in #82217, #84184, #87634.
1 parent e272c37 commit f69ded0

18 files changed

+4565
-4341
lines changed

clang/include/clang/Parse/Parser.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "clang/Lex/CodeCompletionHandler.h"
1919
#include "clang/Lex/Preprocessor.h"
2020
#include "clang/Sema/Sema.h"
21+
#include "clang/Sema/SemaOpenMP.h"
2122
#include "llvm/ADT/SmallVector.h"
2223
#include "llvm/Frontend/OpenMP/OMPContext.h"
2324
#include "llvm/Support/SaveAndRestore.h"
@@ -2537,7 +2538,7 @@ class Parser : public CodeCompletionHandler {
25372538
/// Returns true for declaration, false for expression.
25382539
bool isForInitDeclaration() {
25392540
if (getLangOpts().OpenMP)
2540-
Actions.startOpenMPLoop();
2541+
Actions.OpenMP().startOpenMPLoop();
25412542
if (getLangOpts().CPlusPlus)
25422543
return Tok.is(tok::kw_using) ||
25432544
isCXXSimpleDeclaration(/*AllowForRangeDecl=*/true);
@@ -3396,7 +3397,7 @@ class Parser : public CodeCompletionHandler {
33963397
SourceLocation Loc);
33973398

33983399
/// Parse clauses for '#pragma omp [begin] declare target'.
3399-
void ParseOMPDeclareTargetClauses(Sema::DeclareTargetContextInfo &DTCI);
3400+
void ParseOMPDeclareTargetClauses(SemaOpenMP::DeclareTargetContextInfo &DTCI);
34003401

34013402
/// Parse '#pragma omp end declare target'.
34023403
void ParseOMPEndDeclareTargetDirective(OpenMPDirectiveKind BeginDKind,
@@ -3486,7 +3487,7 @@ class Parser : public CodeCompletionHandler {
34863487
/// Parses indirect clause
34873488
/// \param ParseOnly true to skip the clause's semantic actions and return
34883489
// false;
3489-
bool ParseOpenMPIndirectClause(Sema::DeclareTargetContextInfo &DTCI,
3490+
bool ParseOpenMPIndirectClause(SemaOpenMP::DeclareTargetContextInfo &DTCI,
34903491
bool ParseOnly);
34913492
/// Parses clause with a single expression and an additional argument
34923493
/// of a kind \a Kind.
@@ -3556,24 +3557,24 @@ class Parser : public CodeCompletionHandler {
35563557

35573558
/// Parses a reserved locator like 'omp_all_memory'.
35583559
bool ParseOpenMPReservedLocator(OpenMPClauseKind Kind,
3559-
Sema::OpenMPVarListDataTy &Data,
3560+
SemaOpenMP::OpenMPVarListDataTy &Data,
35603561
const LangOptions &LangOpts);
35613562
/// Parses clauses with list.
35623563
bool ParseOpenMPVarList(OpenMPDirectiveKind DKind, OpenMPClauseKind Kind,
35633564
SmallVectorImpl<Expr *> &Vars,
3564-
Sema::OpenMPVarListDataTy &Data);
3565+
SemaOpenMP::OpenMPVarListDataTy &Data);
35653566
bool ParseUnqualifiedId(CXXScopeSpec &SS, ParsedType ObjectType,
35663567
bool ObjectHadErrors, bool EnteringContext,
35673568
bool AllowDestructorName, bool AllowConstructorName,
35683569
bool AllowDeductionGuide,
35693570
SourceLocation *TemplateKWLoc, UnqualifiedId &Result);
35703571

35713572
/// Parses the mapper modifier in map, to, and from clauses.
3572-
bool parseMapperModifier(Sema::OpenMPVarListDataTy &Data);
3573+
bool parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy &Data);
35733574
/// Parses map-type-modifiers in map clause.
35743575
/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
35753576
/// where, map-type-modifier ::= always | close | mapper(mapper-identifier)
3576-
bool parseMapTypeModifiers(Sema::OpenMPVarListDataTy &Data);
3577+
bool parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy &Data);
35773578

35783579
//===--------------------------------------------------------------------===//
35793580
// OpenACC Parsing.

0 commit comments

Comments
 (0)