diff options
author | Carlo Bertolli <cbertol@us.ibm.com> | 2016-01-15 18:50:31 +0000 |
---|---|---|
committer | Carlo Bertolli <cbertol@us.ibm.com> | 2016-01-15 18:50:31 +0000 |
commit | b4adf55e0f050a494cc0c9a98b0bd46e8e30070a (patch) | |
tree | 450730c8fe4392d25666e1a3aad1481ce2f16c40 /clang/lib/Serialization | |
parent | 47f2452da84f820addf92cb003e7d4905d4aa1bc (diff) | |
download | bcm5719-llvm-b4adf55e0f050a494cc0c9a98b0bd46e8e30070a.tar.gz bcm5719-llvm-b4adf55e0f050a494cc0c9a98b0bd46e8e30070a.zip |
Add OpenMP dist_schedule clause to distribute directive and related regression tests.
llvm-svn: 257917
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 13 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index ad81ac84420..3c2a98b09f7 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -1878,6 +1878,9 @@ OMPClause *OMPClauseReader::readClause() { case OMPC_hint: C = new (Context) OMPHintClause(); break; + case OMPC_dist_schedule: + C = new (Context) OMPDistScheduleClause(); + break; } Visit(C); C->setLocStart(Reader->ReadSourceLocation(Record, Idx)); @@ -2240,6 +2243,16 @@ void OMPClauseReader::VisitOMPHintClause(OMPHintClause *C) { C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); } +void OMPClauseReader::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) { + C->setDistScheduleKind( + static_cast<OpenMPDistScheduleClauseKind>(Record[Idx++])); + C->setChunkSize(Reader->Reader.ReadSubExpr()); + C->setHelperChunkSize(Reader->Reader.ReadSubExpr()); + C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setDistScheduleKindLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setCommaLoc(Reader->ReadSourceLocation(Record, Idx)); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 000a2185f5f..7b5440b2f57 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -2037,6 +2037,15 @@ void OMPClauseWriter::VisitOMPHintClause(OMPHintClause *C) { Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); } +void OMPClauseWriter::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) { + Record.push_back(C->getDistScheduleKind()); + Writer->Writer.AddStmt(C->getChunkSize()); + Writer->Writer.AddStmt(C->getHelperChunkSize()); + Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); + Writer->Writer.AddSourceLocation(C->getDistScheduleKindLoc(), Record); + Writer->Writer.AddSourceLocation(C->getCommaLoc(), Record); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// |