diff options
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 5 | ||||
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 175526a9313..e8a02eee7f8 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1343,6 +1343,7 @@ void OMPLinearClause::setFinals(ArrayRef<Expr *> FL) { OMPLinearClause *OMPLinearClause::Create( const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PL, ArrayRef<Expr *> IL, Expr *Step, Expr *CalcStep) { // Allocate space for 4 lists (Vars, Inits, Updates, Finals) and 2 expressions @@ -1350,8 +1351,8 @@ OMPLinearClause *OMPLinearClause::Create( void *Mem = C.Allocate(llvm::RoundUpToAlignment(sizeof(OMPLinearClause), llvm::alignOf<Expr *>()) + (5 * VL.size() + 2) * sizeof(Expr *)); - OMPLinearClause *Clause = new (Mem) - OMPLinearClause(StartLoc, LParenLoc, ColonLoc, EndLoc, VL.size()); + OMPLinearClause *Clause = new (Mem) OMPLinearClause( + StartLoc, LParenLoc, Modifier, ModifierLoc, ColonLoc, EndLoc, VL.size()); Clause->setVarRefs(VL); Clause->setPrivates(PL); Clause->setInits(IL); diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 64f90ba951d..fb5fcc4902d 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -767,7 +767,13 @@ void OMPClausePrinter::VisitOMPReductionClause(OMPReductionClause *Node) { void OMPClausePrinter::VisitOMPLinearClause(OMPLinearClause *Node) { if (!Node->varlist_empty()) { OS << "linear"; + if (Node->getModifierLoc().isValid()) { + OS << '(' + << getOpenMPSimpleClauseTypeName(OMPC_linear, Node->getModifier()); + } VisitOMPClauseList(Node, '('); + if (Node->getModifierLoc().isValid()) + OS << ')'; if (Node->getStep() != nullptr) { OS << ": "; Node->getStep()->printPretty(OS, nullptr, Policy, 0); |