summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorArpith Chacko Jacob <acjacob@us.ibm.com>2016-01-26 18:48:41 +0000
committerArpith Chacko Jacob <acjacob@us.ibm.com>2016-01-26 18:48:41 +0000
commite955b3d3fe12a05e7639aa336d6945fa9427c0dc (patch)
tree3423de8c95bccda8edcb7065c05cd525a8acc621 /clang/lib/Serialization
parent6ac3f739ca4cd90b41388cc50070a6bca85b6842 (diff)
downloadbcm5719-llvm-e955b3d3fe12a05e7639aa336d6945fa9427c0dc.tar.gz
bcm5719-llvm-e955b3d3fe12a05e7639aa336d6945fa9427c0dc.zip
[OpenMP] Parsing + sema for target parallel directive.
Summary: This patch adds parsing + sema for the target parallel directive and its clauses along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16553 Rebased to current trunk and updated test cases. llvm-svn: 258832
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReaderStmt.cpp12
-rw-r--r--clang/lib/Serialization/ASTWriterStmt.cpp8
2 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index 0b5ab4d7caa..a20b260184d 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -2482,6 +2482,13 @@ void ASTStmtReader::VisitOMPTargetExitDataDirective(
VisitOMPExecutableDirective(D);
}
+void ASTStmtReader::VisitOMPTargetParallelDirective(
+ OMPTargetParallelDirective *D) {
+ VisitStmt(D);
+ ++Idx;
+ VisitOMPExecutableDirective(D);
+}
+
void ASTStmtReader::VisitOMPTeamsDirective(OMPTeamsDirective *D) {
VisitStmt(D);
// The NumClauses field was read in ReadStmtFromStream.
@@ -3135,6 +3142,11 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) {
Context, Record[ASTStmtReader::NumStmtFields], Empty);
break;
+ case STMT_OMP_TARGET_PARALLEL_DIRECTIVE:
+ S = OMPTargetParallelDirective::CreateEmpty(
+ Context, Record[ASTStmtReader::NumStmtFields], Empty);
+ break;
+
case STMT_OMP_TEAMS_DIRECTIVE:
S = OMPTeamsDirective::CreateEmpty(
Context, Record[ASTStmtReader::NumStmtFields], Empty);
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index e93cfe5fd85..acba66a50ca 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -2238,6 +2238,14 @@ void ASTStmtWriter::VisitOMPTargetExitDataDirective(
Code = serialization::STMT_OMP_TARGET_EXIT_DATA_DIRECTIVE;
}
+void ASTStmtWriter::VisitOMPTargetParallelDirective(
+ OMPTargetParallelDirective *D) {
+ VisitStmt(D);
+ Record.push_back(D->getNumClauses());
+ VisitOMPExecutableDirective(D);
+ Code = serialization::STMT_OMP_TARGET_PARALLEL_DIRECTIVE;
+}
+
void ASTStmtWriter::VisitOMPTaskyieldDirective(OMPTaskyieldDirective *D) {
VisitStmt(D);
VisitOMPExecutableDirective(D);
OpenPOWER on IntegriCloud