diff options
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index a03ef00ce76..8e937fb08b1 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1192,6 +1192,30 @@ OMPSharedClause *OMPSharedClause::CreateEmpty(const ASTContext &C, return new (Mem) OMPSharedClause(N); } +OMPLinearClause *OMPLinearClause::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation LParenLoc, + SourceLocation ColonLoc, + SourceLocation EndLoc, + ArrayRef<Expr *> VL, Expr *Step) { + void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLinearClause), + llvm::alignOf<Expr *>()) + + sizeof(Expr *) * (VL.size() + 1)); + OMPLinearClause *Clause = new (Mem) + OMPLinearClause(StartLoc, LParenLoc, ColonLoc, EndLoc, VL.size()); + Clause->setVarRefs(VL); + Clause->setStep(Step); + return Clause; +} + +OMPLinearClause *OMPLinearClause::CreateEmpty(const ASTContext &C, + unsigned NumVars) { + void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLinearClause), + llvm::alignOf<Expr *>()) + + sizeof(Expr *) * (NumVars + 1)); + return new (Mem) OMPLinearClause(NumVars); +} + OMPCopyinClause *OMPCopyinClause::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, |