summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TreeTransform.h
diff options
context:
space:
mode:
authorKelvin Li <kkwli0@gmail.com>2015-11-23 05:32:03 +0000
committerKelvin Li <kkwli0@gmail.com>2015-11-23 05:32:03 +0000
commit0bff7afab5bb88cafa91037c91b47436f5284331 (patch)
tree878fee7855d19dff45db6dfcc164870633e025bb /clang/lib/Sema/TreeTransform.h
parent67501ca1b95213d0ef46f4d8e24073d70e16a7bc (diff)
downloadbcm5719-llvm-0bff7afab5bb88cafa91037c91b47436f5284331.tar.gz
bcm5719-llvm-0bff7afab5bb88cafa91037c91b47436f5284331.zip
[OpenMP] Parsing and sema support for map clause
http://reviews.llvm.org/D14134 llvm-svn: 253849
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r--clang/lib/Sema/TreeTransform.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index ca85ad5ea91..23ad563809b 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -1652,6 +1652,20 @@ public:
EndLoc);
}
+ /// \brief Build a new OpenMP 'map' clause.
+ ///
+ /// By default, performs semantic analysis to build the new OpenMP clause.
+ /// Subclasses may override this routine to provide different behavior.
+ OMPClause *RebuildOMPMapClause(
+ OpenMPMapClauseKind MapTypeModifier, OpenMPMapClauseKind MapType,
+ SourceLocation MapLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
+ SourceLocation StartLoc, SourceLocation LParenLoc,
+ SourceLocation EndLoc) {
+ return getSema().ActOnOpenMPMapClause(MapTypeModifier, MapType, MapLoc,
+ ColonLoc, VarList,StartLoc,
+ LParenLoc, EndLoc);
+ }
+
/// \brief Rebuild the operand to an Objective-C \@synchronized statement.
///
/// By default, performs semantic analysis to build the new statement.
@@ -7648,6 +7662,22 @@ TreeTransform<Derived>::TransformOMPDeviceClause(OMPDeviceClause *C) {
E.get(), C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
}
+template <typename Derived>
+OMPClause *TreeTransform<Derived>::TransformOMPMapClause(OMPMapClause *C) {
+ llvm::SmallVector<Expr *, 16> Vars;
+ Vars.reserve(C->varlist_size());
+ for (auto *VE : C->varlists()) {
+ ExprResult EVar = getDerived().TransformExpr(cast<Expr>(VE));
+ if (EVar.isInvalid())
+ return nullptr;
+ Vars.push_back(EVar.get());
+ }
+ return getDerived().RebuildOMPMapClause(
+ C->getMapTypeModifier(), C->getMapType(), C->getMapLoc(),
+ C->getColonLoc(), Vars, C->getLocStart(), C->getLParenLoc(),
+ C->getLocEnd());
+}
+
//===----------------------------------------------------------------------===//
// Expression transformation
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud