diff options
author | Carlo Bertolli <cbertol@us.ibm.com> | 2016-07-13 15:37:16 +0000 |
---|---|---|
committer | Carlo Bertolli <cbertol@us.ibm.com> | 2016-07-13 15:37:16 +0000 |
commit | 2404b1719241456b7c4a3f8c5f9ece18eebcfa48 (patch) | |
tree | c0ab2da3adf82d8b9c5ff603fb8bdba0443bf95b /clang/lib/Serialization/ASTReaderStmt.cpp | |
parent | 48d83407602b15f80310bba0bdf5731ed194e092 (diff) | |
download | bcm5719-llvm-2404b1719241456b7c4a3f8c5f9ece18eebcfa48.tar.gz bcm5719-llvm-2404b1719241456b7c4a3f8c5f9ece18eebcfa48.zip |
[OpenMP] Initial implementation of parse+sema for clause use_device_ptr of 'target data'
http://reviews.llvm.org/D21904
This patch is similar to the implementation of 'private' clause: it adds a list of private pointers to be used within the target data region to store the device pointers returned by the runtime.
Please refer to the following document for a full description of what the runtime witll return in this case (page 10 and 11):
https://github.com/clang-omp/OffloadingDesign
I am happy to answer any question related to the runtime interface to help reviewing this patch.
llvm-svn: 275271
Diffstat (limited to 'clang/lib/Serialization/ASTReaderStmt.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index 075d07471a2..2bc2228bdfe 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -1922,6 +1922,9 @@ OMPClause *OMPClauseReader::readClause() { NumComponents); break; } + case OMPC_use_device_ptr: + C = OMPUseDevicePtrClause::CreateEmpty(Context, Record[Idx++]); + break; } Visit(C); C->setLocStart(Reader->ReadSourceLocation(Record, Idx)); @@ -2439,6 +2442,17 @@ void OMPClauseReader::VisitOMPFromClause(OMPFromClause *C) { C->setComponents(Components, ListSizes); } +void OMPClauseReader::VisitOMPUseDevicePtrClause(OMPUseDevicePtrClause *C) { + C->setLParenLoc(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); + Vars.clear(); +} + //===----------------------------------------------------------------------===// // OpenMP Directives. //===----------------------------------------------------------------------===// |