diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 | 
| commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
| tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /clang/lib/Serialization/ASTWriterStmt.cpp | |
| parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) | |
Notes
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
| -rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 54 | 
1 files changed, 43 insertions, 11 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index c39d4d39bcdf..9231f3b2b9ba 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -11,7 +11,7 @@  ///  //===----------------------------------------------------------------------===// -#include "clang/Serialization/ASTWriter.h" +#include "clang/Serialization/ASTRecordWriter.h"  #include "clang/AST/ASTContext.h"  #include "clang/AST/DeclCXX.h"  #include "clang/AST/DeclObjC.h" @@ -395,13 +395,30 @@ void ASTStmtWriter::VisitConceptSpecializationExpr(    Record.push_back(TemplateArgs.size());    Record.AddNestedNameSpecifierLoc(E->getNestedNameSpecifierLoc());    Record.AddSourceLocation(E->getTemplateKWLoc()); -  Record.AddSourceLocation(E->getConceptNameLoc()); -  Record.AddDeclRef(E->getFoundDecl()); +  Record.AddDeclarationNameInfo(E->getConceptNameInfo());    Record.AddDeclRef(E->getNamedConcept());    Record.AddASTTemplateArgumentListInfo(E->getTemplateArgsAsWritten());    for (const TemplateArgument &Arg : TemplateArgs)      Record.AddTemplateArgument(Arg); -  Record.push_back(E->isSatisfied()); +  const ASTConstraintSatisfaction &Satisfaction = E->getSatisfaction(); +  Record.push_back(Satisfaction.IsSatisfied); +  if (!Satisfaction.IsSatisfied) { +    Record.push_back(Satisfaction.NumRecords); +    for (const auto &DetailRecord : Satisfaction) { +      Record.AddStmt(const_cast<Expr *>(DetailRecord.first)); +      auto *E = DetailRecord.second.dyn_cast<Expr *>(); +      Record.push_back(E == nullptr); +      if (E) +        Record.AddStmt(E); +      else { +        auto *Diag = DetailRecord.second.get<std::pair<SourceLocation, +                                                       StringRef> *>(); +        Record.AddSourceLocation(Diag->first); +        Record.AddString(Diag->second); +      } +    } +  } +    Code = serialization::EXPR_CONCEPT_SPECIALIZATION;  } @@ -1835,9 +1852,11 @@ void ASTStmtWriter::VisitFunctionParmPackExpr(FunctionParmPackExpr *E) {  void ASTStmtWriter::VisitMaterializeTemporaryExpr(MaterializeTemporaryExpr *E) {    VisitExpr(E); -  Record.AddStmt(E->getTemporary()); -  Record.AddDeclRef(E->getExtendingDecl()); -  Record.push_back(E->getManglingNumber()); +  Record.push_back(static_cast<bool>(E->getLifetimeExtendedTemporaryDecl())); +  if (E->getLifetimeExtendedTemporaryDecl()) +    Record.AddDeclRef(E->getLifetimeExtendedTemporaryDecl()); +  else +    Record.AddStmt(E->getSubExpr());    Code = serialization::EXPR_MATERIALIZE_TEMPORARY;  } @@ -1958,9 +1977,8 @@ void ASTStmtWriter::VisitSEHLeaveStmt(SEHLeaveStmt *S) {  void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {    Record.AddSourceLocation(E->getBeginLoc());    Record.AddSourceLocation(E->getEndLoc()); -  OMPClauseWriter ClauseWriter(Record);    for (unsigned i = 0; i < E->getNumClauses(); ++i) { -    ClauseWriter.writeClause(E->getClause(i)); +    Record.writeOMPClause(E->getClause(i));    }    if (E->hasAssociatedStmt())      Record.AddStmt(E->getAssociatedStmt()); @@ -2101,6 +2119,14 @@ void ASTStmtWriter::VisitOMPParallelForSimdDirective(    Code = serialization::STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE;  } +void ASTStmtWriter::VisitOMPParallelMasterDirective( +    OMPParallelMasterDirective *D) { +  VisitStmt(D); +  Record.push_back(D->getNumClauses()); +  VisitOMPExecutableDirective(D); +  Code = serialization::STMT_OMP_PARALLEL_MASTER_DIRECTIVE; +} +  void ASTStmtWriter::VisitOMPParallelSectionsDirective(      OMPParallelSectionsDirective *D) {    VisitStmt(D); @@ -2227,7 +2253,7 @@ void ASTStmtWriter::VisitOMPCancellationPointDirective(      OMPCancellationPointDirective *D) {    VisitStmt(D);    VisitOMPExecutableDirective(D); -  Record.push_back(D->getCancelRegion()); +  Record.push_back(uint64_t(D->getCancelRegion()));    Code = serialization::STMT_OMP_CANCELLATION_POINT_DIRECTIVE;  } @@ -2235,7 +2261,7 @@ void ASTStmtWriter::VisitOMPCancelDirective(OMPCancelDirective *D) {    VisitStmt(D);    Record.push_back(D->getNumClauses());    VisitOMPExecutableDirective(D); -  Record.push_back(D->getCancelRegion()); +  Record.push_back(uint64_t(D->getCancelRegion()));    Code = serialization::STMT_OMP_CANCEL_DIRECTIVE;  } @@ -2267,6 +2293,12 @@ void ASTStmtWriter::VisitOMPParallelMasterTaskLoopDirective(    Code = serialization::STMT_OMP_PARALLEL_MASTER_TASKLOOP_DIRECTIVE;  } +void ASTStmtWriter::VisitOMPParallelMasterTaskLoopSimdDirective( +    OMPParallelMasterTaskLoopSimdDirective *D) { +  VisitOMPLoopDirective(D); +  Code = serialization::STMT_OMP_PARALLEL_MASTER_TASKLOOP_SIMD_DIRECTIVE; +} +  void ASTStmtWriter::VisitOMPDistributeDirective(OMPDistributeDirective *D) {    VisitOMPLoopDirective(D);    Code = serialization::STMT_OMP_DISTRIBUTE_DIRECTIVE;  | 
