diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-06-23 14:25:19 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-06-23 14:25:19 +0000 |
commit | 1c2cfbc3eac44ab3ec79bcdae56a23a17e5c9693 (patch) | |
tree | 2158e97e424dd441a8db2fcd5704f1d3ddec7fca /clang/lib/Serialization | |
parent | 8c5f537f184a1e78d9a734cef3202382946a0108 (diff) | |
download | bcm5719-llvm-1c2cfbc3eac44ab3ec79bcdae56a23a17e5c9693.tar.gz bcm5719-llvm-1c2cfbc3eac44ab3ec79bcdae56a23a17e5c9693.zip |
[OPENMP] Initial support for 'depend' clause (4.0).
Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).
llvm-svn: 240409
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index c15f6b0b552..f64d856a628 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -1785,6 +1785,9 @@ OMPClause *OMPClauseReader::readClause() { case OMPC_flush: C = OMPFlushClause::CreateEmpty(Context, Record[Idx++]); break; + case OMPC_depend: + C = OMPDependClause::CreateEmpty(Context, Record[Idx++]); + break; } Visit(C); C->setLocStart(Reader->ReadSourceLocation(Record, Idx)); @@ -2049,6 +2052,19 @@ void OMPClauseReader::VisitOMPFlushClause(OMPFlushClause *C) { C->setVarRefs(Vars); } +void OMPClauseReader::VisitOMPDependClause(OMPDependClause *C) { + C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setDependencyKind(static_cast<OpenMPDependClauseKind>(Record[Idx++])); + C->setDependencyLoc(Reader->ReadSourceLocation(Record, Idx)); + C->setColonLoc(Reader->ReadSourceLocation(Record, Idx)); + unsigned NumVars = C->varlist_size(); + SmallVector<Expr *, 16> Vars; + Vars.reserve(NumVars); + for (unsigned i = 0; i != NumVars; ++i) + Vars.push_back(Reader->Reader.ReadSubExpr()); + C->setVarRefs(Vars); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index a461d3f6639..0f35f0ce8a3 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -1906,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. //===----------------------------------------------------------------------===// |