aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Serialization/ASTReaderStmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderStmt.cpp88
1 files changed, 85 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index 0e1af53303b4..b100f946f558 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -185,11 +185,13 @@ void ASTStmtReader::VisitDefaultStmt(DefaultStmt *S) {
void ASTStmtReader::VisitLabelStmt(LabelStmt *S) {
VisitStmt(S);
+ bool IsSideEntry = Record.readInt();
auto *LD = readDeclAs<LabelDecl>();
LD->setStmt(S);
S->setDecl(LD);
S->setSubStmt(Record.readSubStmt());
S->setIdentLoc(readSourceLocation());
+ S->setSideEntry(IsSideEntry);
}
void ASTStmtReader::VisitAttributedStmt(AttributedStmt *S) {
@@ -579,6 +581,16 @@ void ASTStmtReader::VisitConstantExpr(ConstantExpr *E) {
E->setSubExpr(Record.readSubExpr());
}
+void ASTStmtReader::VisitSYCLUniqueStableNameExpr(SYCLUniqueStableNameExpr *E) {
+ VisitExpr(E);
+
+ E->setLocation(readSourceLocation());
+ E->setLParenLocation(readSourceLocation());
+ E->setRParenLocation(readSourceLocation());
+
+ E->setTypeSourceInfo(Record.readTypeSourceInfo());
+}
+
void ASTStmtReader::VisitPredefinedExpr(PredefinedExpr *E) {
VisitExpr(E);
bool HasFunctionName = Record.readInt();
@@ -1099,10 +1111,9 @@ void ASTStmtReader::VisitCastExpr(CastExpr *E) {
void ASTStmtReader::VisitBinaryOperator(BinaryOperator *E) {
bool hasFP_Features;
- BinaryOperator::Opcode opc;
VisitExpr(E);
E->setHasStoredFPFeatures(hasFP_Features = Record.readInt());
- E->setOpcode(opc = (BinaryOperator::Opcode)Record.readInt());
+ E->setOpcode((BinaryOperator::Opcode)Record.readInt());
E->setLHS(Record.readSubExpr());
E->setRHS(Record.readSubExpr());
E->setOperatorLoc(readSourceLocation());
@@ -2273,19 +2284,29 @@ void ASTStmtReader::VisitAsTypeExpr(AsTypeExpr *E) {
// OpenMP Directives.
//===----------------------------------------------------------------------===//
+void ASTStmtReader::VisitOMPCanonicalLoop(OMPCanonicalLoop *S) {
+ VisitStmt(S);
+ for (Stmt *&SubStmt : S->SubStmts)
+ SubStmt = Record.readSubStmt();
+}
+
void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
Record.readOMPChildren(E->Data);
E->setLocStart(readSourceLocation());
E->setLocEnd(readSourceLocation());
}
-void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
+void ASTStmtReader::VisitOMPLoopBasedDirective(OMPLoopBasedDirective *D) {
VisitStmt(D);
// Field CollapsedNum was read in ReadStmtFromStream.
Record.skipInts(1);
VisitOMPExecutableDirective(D);
}
+void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
+ VisitOMPLoopBasedDirective(D);
+}
+
void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
VisitStmt(D);
VisitOMPExecutableDirective(D);
@@ -2296,6 +2317,14 @@ void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
VisitOMPLoopDirective(D);
}
+void ASTStmtReader::VisitOMPTileDirective(OMPTileDirective *D) {
+ VisitOMPLoopBasedDirective(D);
+}
+
+void ASTStmtReader::VisitOMPUnrollDirective(OMPUnrollDirective *D) {
+ VisitOMPLoopBasedDirective(D);
+}
+
void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
VisitOMPLoopDirective(D);
D->setHasCancel(Record.readBool());
@@ -2574,6 +2603,22 @@ void ASTStmtReader::VisitOMPTargetTeamsDistributeSimdDirective(
VisitOMPLoopDirective(D);
}
+void ASTStmtReader::VisitOMPInteropDirective(OMPInteropDirective *D) {
+ VisitStmt(D);
+ VisitOMPExecutableDirective(D);
+}
+
+void ASTStmtReader::VisitOMPDispatchDirective(OMPDispatchDirective *D) {
+ VisitStmt(D);
+ VisitOMPExecutableDirective(D);
+ D->setTargetCallLoc(Record.readSourceLocation());
+}
+
+void ASTStmtReader::VisitOMPMaskedDirective(OMPMaskedDirective *D) {
+ VisitStmt(D);
+ VisitOMPExecutableDirective(D);
+}
+
//===----------------------------------------------------------------------===//
// ASTReader Implementation
//===----------------------------------------------------------------------===//
@@ -2771,6 +2816,10 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
/*StorageKind=*/Record[ASTStmtReader::NumExprFields]));
break;
+ case EXPR_SYCL_UNIQUE_STABLE_NAME:
+ S = SYCLUniqueStableNameExpr::CreateEmpty(Context);
+ break;
+
case EXPR_PREDEFINED:
S = PredefinedExpr::CreateEmpty(
Context,
@@ -3130,6 +3179,10 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
nullptr);
break;
+ case STMT_OMP_CANONICAL_LOOP:
+ S = OMPCanonicalLoop::createEmpty(Context);
+ break;
+
case STMT_OMP_PARALLEL_DIRECTIVE:
S =
OMPParallelDirective::CreateEmpty(Context,
@@ -3145,6 +3198,20 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
break;
}
+ case STMT_OMP_TILE_DIRECTIVE: {
+ unsigned NumLoops = Record[ASTStmtReader::NumStmtFields];
+ unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
+ S = OMPTileDirective::CreateEmpty(Context, NumClauses, NumLoops);
+ break;
+ }
+
+ case STMT_OMP_UNROLL_DIRECTIVE: {
+ assert(Record[ASTStmtReader::NumStmtFields] == 1 && "Unroll directive accepts only a single loop");
+ unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
+ S = OMPUnrollDirective::CreateEmpty(Context, NumClauses);
+ break;
+ }
+
case STMT_OMP_FOR_DIRECTIVE: {
unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields];
unsigned NumClauses = Record[ASTStmtReader::NumStmtFields + 1];
@@ -3478,6 +3545,21 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
break;
}
+ case STMT_OMP_INTEROP_DIRECTIVE:
+ S = OMPInteropDirective::CreateEmpty(
+ Context, Record[ASTStmtReader::NumStmtFields], Empty);
+ break;
+
+ case STMT_OMP_DISPATCH_DIRECTIVE:
+ S = OMPDispatchDirective::CreateEmpty(
+ Context, Record[ASTStmtReader::NumStmtFields], Empty);
+ break;
+
+ case STMT_OMP_MASKED_DIRECTIVE:
+ S = OMPMaskedDirective::CreateEmpty(
+ Context, Record[ASTStmtReader::NumStmtFields], Empty);
+ break;
+
case EXPR_CXX_OPERATOR_CALL:
S = CXXOperatorCallExpr::CreateEmpty(
Context, /*NumArgs=*/Record[ASTStmtReader::NumExprFields],