/// \brief Build a new OpenMP 'if' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPIfClause(Expr *Condition,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'num_threads' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPNumThreadsClause(Expr *NumThreads,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'safelen' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPSafelenClause(Expr *Len, SourceLocation StartLoc,
SourceLocation LParenLoc,
/// \brief Build a new OpenMP 'collapse' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPCollapseClause(Expr *Num, SourceLocation StartLoc,
SourceLocation LParenLoc,
/// \brief Build a new OpenMP 'default' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPDefaultClause(OpenMPDefaultClauseKind Kind,
SourceLocation KindKwLoc,
/// \brief Build a new OpenMP 'proc_bind' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPProcBindClause(OpenMPProcBindClauseKind Kind,
SourceLocation KindKwLoc,
/// \brief Build a new OpenMP 'private' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPPrivateClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'firstprivate' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPFirstprivateClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'shared' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPSharedClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'linear' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPLinearClause(ArrayRef<Expr *> VarList, Expr *Step,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'aligned' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment,
SourceLocation StartLoc,
/// \brief Build a new OpenMP 'copyin' clause.
///
- /// By default, performs semantic analysis to build the new statement.
+ /// By default, performs semantic analysis to build the new OpenMP clause.
/// Subclasses may override this routine to provide different behavior.
OMPClause *RebuildOMPCopyinClause(ArrayRef<Expr *> VarList,
SourceLocation StartLoc,
return getDerived().TransformSEHExceptStmt(cast<SEHExceptStmt>(Handler));
}
-template<typename Derived>
-StmtResult
-TreeTransform<Derived>::TransformOMPExecutableDirective(
- OMPExecutableDirective *D) {
+//===----------------------------------------------------------------------===//
+// OpenMP directive transformation
+//===----------------------------------------------------------------------===//
+template <typename Derived>
+StmtResult TreeTransform<Derived>::TransformOMPExecutableDirective(
+ OMPExecutableDirective *D) {
// Transform the clauses
llvm::SmallVector<OMPClause *, 16> TClauses;
return StmtError();
}
TClauses.push_back(Clause);
- }
- else {
+ } else {
TClauses.push_back(nullptr);
}
}
return StmtError();
}
StmtResult AssociatedStmt =
- getDerived().TransformStmt(D->getAssociatedStmt());
+ getDerived().TransformStmt(D->getAssociatedStmt());
if (AssociatedStmt.isInvalid()) {
return StmtError();
}
- return getDerived().RebuildOMPExecutableDirective(D->getDirectiveKind(),
- TClauses,
- AssociatedStmt.get(),
- D->getLocStart(),
- D->getLocEnd());
+ return getDerived().RebuildOMPExecutableDirective(
+ D->getDirectiveKind(), TClauses, AssociatedStmt.get(), D->getLocStart(),
+ D->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
StmtResult
TreeTransform<Derived>::TransformOMPParallelDirective(OMPParallelDirective *D) {
DeclarationNameInfo DirName;
return Res;
}
-template<typename Derived>
+template <typename Derived>
StmtResult
TreeTransform<Derived>::TransformOMPSimdDirective(OMPSimdDirective *D) {
DeclarationNameInfo DirName;
return Res;
}
-template<typename Derived>
-OMPClause *
-TreeTransform<Derived>::TransformOMPIfClause(OMPIfClause *C) {
+//===----------------------------------------------------------------------===//
+// OpenMP clause transformation
+//===----------------------------------------------------------------------===//
+template <typename Derived>
+OMPClause *TreeTransform<Derived>::TransformOMPIfClause(OMPIfClause *C) {
ExprResult Cond = getDerived().TransformExpr(C->getCondition());
if (Cond.isInvalid())
return nullptr;
C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPNumThreadsClause(OMPNumThreadsClause *C) {
ExprResult NumThreads = getDerived().TransformExpr(C->getNumThreads());
if (NumThreads.isInvalid())
return nullptr;
- return getDerived().RebuildOMPNumThreadsClause(NumThreads.get(),
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPNumThreadsClause(
+ NumThreads.get(), C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
}
template <typename Derived>
E.get(), C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPDefaultClause(OMPDefaultClause *C) {
- return getDerived().RebuildOMPDefaultClause(C->getDefaultKind(),
- C->getDefaultKindKwLoc(),
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPDefaultClause(
+ C->getDefaultKind(), C->getDefaultKindKwLoc(), C->getLocStart(),
+ C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPProcBindClause(OMPProcBindClause *C) {
- return getDerived().RebuildOMPProcBindClause(C->getProcBindKind(),
- C->getProcBindKindKwLoc(),
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPProcBindClause(
+ C->getProcBindKind(), C->getProcBindKindKwLoc(), C->getLocStart(),
+ C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPPrivateClause(OMPPrivateClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
return nullptr;
Vars.push_back(EVar.get());
}
- return getDerived().RebuildOMPPrivateClause(Vars,
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPPrivateClause(
+ Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
-OMPClause *
-TreeTransform<Derived>::TransformOMPFirstprivateClause(
- OMPFirstprivateClause *C) {
+template <typename Derived>
+OMPClause *TreeTransform<Derived>::TransformOMPFirstprivateClause(
+ OMPFirstprivateClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
Vars.reserve(C->varlist_size());
for (auto *VE : C->varlists()) {
return nullptr;
Vars.push_back(EVar.get());
}
- return getDerived().RebuildOMPFirstprivateClause(Vars,
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPFirstprivateClause(
+ Vars, C->getLocStart(), C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPSharedClause(OMPSharedClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
return nullptr;
Vars.push_back(EVar.get());
}
- return getDerived().RebuildOMPSharedClause(Vars,
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPSharedClause(Vars, C->getLocStart(),
+ C->getLParenLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPLinearClause(OMPLinearClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
ExprResult Step = getDerived().TransformExpr(C->getStep());
if (Step.isInvalid())
return nullptr;
- return getDerived().RebuildOMPLinearClause(
- Vars, Step.get(), C->getLocStart(), C->getLParenLoc(), C->getColonLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPLinearClause(Vars, Step.get(), C->getLocStart(),
+ C->getLParenLoc(),
+ C->getColonLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPAlignedClause(OMPAlignedClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
C->getColonLoc(), C->getLocEnd());
}
-template<typename Derived>
+template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPCopyinClause(OMPCopyinClause *C) {
llvm::SmallVector<Expr *, 16> Vars;
return nullptr;
Vars.push_back(EVar.get());
}
- return getDerived().RebuildOMPCopyinClause(Vars,
- C->getLocStart(),
- C->getLParenLoc(),
- C->getLocEnd());
+ return getDerived().RebuildOMPCopyinClause(Vars, C->getLocStart(),
+ C->getLParenLoc(), C->getLocEnd());
}
//===----------------------------------------------------------------------===//