diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp | 93 |
1 files changed, 90 insertions, 3 deletions
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp index e980ce7..0dd8090 100644 --- a/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp @@ -553,6 +553,7 @@ void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) { Writer.AddDeclRef(E->getMemberDecl(), Record); Writer.AddSourceLocation(E->getMemberLoc(), Record); Record.push_back(E->isArrow()); + Writer.AddSourceLocation(E->getOperatorLoc(), Record); Writer.AddDeclarationNameLoc(E->MemberDNLoc, E->getMemberDecl()->getDeclName(), Record); Code = serialization::EXPR_MEMBER; @@ -737,6 +738,18 @@ void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) { Code = serialization::EXPR_DESIGNATED_INIT; } +void ASTStmtWriter::VisitDesignatedInitUpdateExpr(DesignatedInitUpdateExpr *E) { + VisitExpr(E); + Writer.AddStmt(E->getBase()); + Writer.AddStmt(E->getUpdater()); + Code = serialization::EXPR_DESIGNATED_INIT_UPDATE; +} + +void ASTStmtWriter::VisitNoInitExpr(NoInitExpr *E) { + VisitExpr(E); + Code = serialization::EXPR_NO_INIT; +} + void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) { VisitExpr(E); Code = serialization::EXPR_IMPLICIT_VALUE_INIT; @@ -1744,6 +1757,7 @@ void OMPClauseWriter::VisitOMPProcBindClause(OMPProcBindClause *C) { void OMPClauseWriter::VisitOMPScheduleClause(OMPScheduleClause *C) { Record.push_back(C->getScheduleKind()); Writer->Writer.AddStmt(C->getChunkSize()); + Writer->Writer.AddStmt(C->getHelperChunkSize()); Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); Writer->Writer.AddSourceLocation(C->getScheduleKindLoc(), Record); Writer->Writer.AddSourceLocation(C->getCommaLoc(), Record); @@ -1797,6 +1811,14 @@ void OMPClauseWriter::VisitOMPLastprivateClause(OMPLastprivateClause *C) { Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); for (auto *VE : C->varlists()) Writer->Writer.AddStmt(VE); + for (auto *E : C->private_copies()) + Writer->Writer.AddStmt(E); + for (auto *E : C->source_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->destination_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->assignment_ops()) + Writer->Writer.AddStmt(E); } void OMPClauseWriter::VisitOMPSharedClause(OMPSharedClause *C) { @@ -1814,15 +1836,32 @@ void OMPClauseWriter::VisitOMPReductionClause(OMPReductionClause *C) { Writer->Writer.AddDeclarationNameInfo(C->getNameInfo(), Record); for (auto *VE : C->varlists()) Writer->Writer.AddStmt(VE); + for (auto *E : C->lhs_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->rhs_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->reduction_ops()) + Writer->Writer.AddStmt(E); } void OMPClauseWriter::VisitOMPLinearClause(OMPLinearClause *C) { Record.push_back(C->varlist_size()); Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); Writer->Writer.AddSourceLocation(C->getColonLoc(), Record); - for (auto *VE : C->varlists()) + for (auto *VE : C->varlists()) { Writer->Writer.AddStmt(VE); + } + for (auto *VE : C->inits()) { + Writer->Writer.AddStmt(VE); + } + for (auto *VE : C->updates()) { + Writer->Writer.AddStmt(VE); + } + for (auto *VE : C->finals()) { + Writer->Writer.AddStmt(VE); + } Writer->Writer.AddStmt(C->getStep()); + Writer->Writer.AddStmt(C->getCalcStep()); } void OMPClauseWriter::VisitOMPAlignedClause(OMPAlignedClause *C) { @@ -1839,6 +1878,12 @@ void OMPClauseWriter::VisitOMPCopyinClause(OMPCopyinClause *C) { Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); for (auto *VE : C->varlists()) Writer->Writer.AddStmt(VE); + for (auto *E : C->source_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->destination_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->assignment_ops()) + Writer->Writer.AddStmt(E); } void OMPClauseWriter::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) { @@ -1846,6 +1891,12 @@ void OMPClauseWriter::VisitOMPCopyprivateClause(OMPCopyprivateClause *C) { Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); for (auto *VE : C->varlists()) Writer->Writer.AddStmt(VE); + for (auto *E : C->source_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->destination_exprs()) + Writer->Writer.AddStmt(E); + for (auto *E : C->assignment_ops()) + Writer->Writer.AddStmt(E); } void OMPClauseWriter::VisitOMPFlushClause(OMPFlushClause *C) { @@ -1855,6 +1906,16 @@ void OMPClauseWriter::VisitOMPFlushClause(OMPFlushClause *C) { Writer->Writer.AddStmt(VE); } +void OMPClauseWriter::VisitOMPDependClause(OMPDependClause *C) { + Record.push_back(C->varlist_size()); + Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); + Record.push_back(C->getDependencyKind()); + Writer->Writer.AddSourceLocation(C->getDependencyLoc(), Record); + Writer->Writer.AddSourceLocation(C->getColonLoc(), Record); + for (auto *VE : C->varlists()) + Writer->Writer.AddStmt(VE); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// @@ -1878,8 +1939,7 @@ void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) { Writer.AddStmt(D->getLastIteration()); Writer.AddStmt(D->getCalcLastIteration()); Writer.AddStmt(D->getPreCond()); - Writer.AddStmt(D->getCond(/* SeparateIter */ false)); - Writer.AddStmt(D->getCond(/* SeparateIter */ true)); + Writer.AddStmt(D->getCond()); Writer.AddStmt(D->getInit()); Writer.AddStmt(D->getInc()); if (isOpenMPWorksharingDirective(D->getDirectiveKind())) { @@ -1894,6 +1954,9 @@ void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) { for (auto I : D->counters()) { Writer.AddStmt(I); } + for (auto I : D->inits()) { + Writer.AddStmt(I); + } for (auto I : D->updates()) { Writer.AddStmt(I); } @@ -1990,6 +2053,9 @@ void ASTStmtWriter::VisitOMPAtomicDirective(OMPAtomicDirective *D) { Writer.AddStmt(D->getX()); Writer.AddStmt(D->getV()); Writer.AddStmt(D->getExpr()); + Writer.AddStmt(D->getUpdateExpr()); + Record.push_back(D->isXLHSInRHSPart() ? 1 : 0); + Record.push_back(D->isPostfixUpdate() ? 1 : 0); Code = serialization::STMT_OMP_ATOMIC_DIRECTIVE; } @@ -2018,6 +2084,12 @@ void ASTStmtWriter::VisitOMPTaskwaitDirective(OMPTaskwaitDirective *D) { Code = serialization::STMT_OMP_TASKWAIT_DIRECTIVE; } +void ASTStmtWriter::VisitOMPTaskgroupDirective(OMPTaskgroupDirective *D) { + VisitStmt(D); + VisitOMPExecutableDirective(D); + Code = serialization::STMT_OMP_TASKGROUP_DIRECTIVE; +} + void ASTStmtWriter::VisitOMPFlushDirective(OMPFlushDirective *D) { VisitStmt(D); Record.push_back(D->getNumClauses()); @@ -2038,6 +2110,21 @@ void ASTStmtWriter::VisitOMPTeamsDirective(OMPTeamsDirective *D) { Code = serialization::STMT_OMP_TEAMS_DIRECTIVE; } +void ASTStmtWriter::VisitOMPCancellationPointDirective( + OMPCancellationPointDirective *D) { + VisitStmt(D); + VisitOMPExecutableDirective(D); + Record.push_back(D->getCancelRegion()); + Code = serialization::STMT_OMP_CANCELLATION_POINT_DIRECTIVE; +} + +void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) { + VisitStmt(D); + VisitOMPExecutableDirective(D); + Record.push_back(D->getCancelRegion()); + Code = serialization::STMT_OMP_CANCEL_DIRECTIVE; +} + //===----------------------------------------------------------------------===// // ASTWriter Implementation //===----------------------------------------------------------------------===// |