diff options
author | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2016-01-26 16:37:23 +0000 |
---|---|---|
committer | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2016-01-26 16:37:23 +0000 |
commit | 3cf89040b0fa1ef6d930374e04a314d4c1cb0c87 (patch) | |
tree | 88435467e8adcbbe760803882052ba793b8b54b5 /clang/lib/Serialization | |
parent | 980b280f501b91fb13538c95de5b0677f2b635fb (diff) | |
download | bcm5719-llvm-3cf89040b0fa1ef6d930374e04a314d4c1cb0c87.tar.gz bcm5719-llvm-3cf89040b0fa1ef6d930374e04a314d4c1cb0c87.zip |
[OpenMP] Parsing + sema for defaultmap clause.
Summary:
This patch adds parsing + sema for the defaultmap clause associated with the target directive (among others).
Reviewers: ABataev
Differential Revision: http://reviews.llvm.org/D16527
llvm-svn: 258817
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 13 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index ae978d5bcb7..0b5ab4d7caa 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -1881,6 +1881,9 @@ OMPClause *OMPClauseReader::readClause() { case OMPC_dist_schedule: C = new (Context) OMPDistScheduleClause(); break; + case OMPC_defaultmap: + C = new (Context) OMPDefaultmapClause(); + break; } Visit(C); C->setLocStart(Reader->ReadSourceLocation(Record, Idx)); @@ -2253,6 +2256,16 @@ void OMPClauseReader::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) { C->setCommaLoc(Reader->ReadSourceLocation(Record, Idx)); } +void OMPClauseReader::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) { + C->setDefaultmapKind( + static_cast<OpenMPDefaultmapClauseKind>(Record[Idx++])); + C->setDefaultmapModifier( + static_cast<OpenMPDefaultmapClauseModifier>(Record[Idx++])); + C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setDefaultmapModifierLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setDefaultmapKindLoc(Reader->ReadSourceLocation(Record, Idx)); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 8d1de313d0f..e93cfe5fd85 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -2046,6 +2046,14 @@ void OMPClauseWriter::VisitOMPDistScheduleClause(OMPDistScheduleClause *C) { Writer->Writer.AddSourceLocation(C->getCommaLoc(), Record); } +void OMPClauseWriter::VisitOMPDefaultmapClause(OMPDefaultmapClause *C) { + Record.push_back(C->getDefaultmapKind()); + Record.push_back(C->getDefaultmapModifier()); + Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); + Writer->Writer.AddSourceLocation(C->getDefaultmapModifierLoc(), Record); + Writer->Writer.AddSourceLocation(C->getDefaultmapKindLoc(), Record); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// |