diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-21 11:14:16 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-21 11:14:16 +0000 |
commit | 66b15b505fe1af2eb570e35a98b3acbd4b6d38e5 (patch) | |
tree | d544c8df86cb5a2ed9132b5011e17a8ad48c3731 /clang/lib/Serialization | |
parent | b3b1f467cea319c24ce5065881b874fa5afe4cb6 (diff) | |
download | bcm5719-llvm-66b15b505fe1af2eb570e35a98b3acbd4b6d38e5.tar.gz bcm5719-llvm-66b15b505fe1af2eb570e35a98b3acbd4b6d38e5.zip |
[OPENMP 4.1] Initial support for 'simdlen' clause.
Add parsing/sema analysis for 'simdlen' clause in simd directives. Also add check that if both 'safelen' and 'simdlen' clauses are specified, the value of 'simdlen' parameter is less than the value of 'safelen' parameter.
llvm-svn: 245692
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index 18b1051d177..4a76ca0bc7d 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -1716,6 +1716,9 @@ OMPClause *OMPClauseReader::readClause() { case OMPC_safelen: C = new (Context) OMPSafelenClause(); break; + case OMPC_simdlen: + C = new (Context) OMPSimdlenClause(); + break; case OMPC_collapse: C = new (Context) OMPCollapseClause(); break; @@ -1819,6 +1822,11 @@ void OMPClauseReader::VisitOMPSafelenClause(OMPSafelenClause *C) { C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); } +void OMPClauseReader::VisitOMPSimdlenClause(OMPSimdlenClause *C) { + C->setSimdlen(Reader->Reader.ReadSubExpr()); + C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); +} + void OMPClauseReader::VisitOMPCollapseClause(OMPCollapseClause *C) { C->setNumForLoops(Reader->Reader.ReadSubExpr()); C->setLParenLoc(Reader->ReadSourceLocation(Record, Idx)); diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index c91db223d96..6bf5b7d3057 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -1737,6 +1737,11 @@ void OMPClauseWriter::VisitOMPSafelenClause(OMPSafelenClause *C) { Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); } +void OMPClauseWriter::VisitOMPSimdlenClause(OMPSimdlenClause *C) { + Writer->Writer.AddStmt(C->getSimdlen()); + Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); +} + void OMPClauseWriter::VisitOMPCollapseClause(OMPCollapseClause *C) { Writer->Writer.AddStmt(C->getNumForLoops()); Writer->Writer.AddSourceLocation(C->getLParenLoc(), Record); |