diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-12-20 11:04:57 -0500 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-12-24 12:22:05 -0500 |
commit | 93dc40dddde40cff2f54b68c66abb00927cdbcea (patch) | |
tree | b63973cdc9636d337fb7dee48d9ec1fd4b633b34 /clang/lib/AST | |
parent | 0d47399167eee87711f5c93a3f36801c7b6a6774 (diff) | |
download | bcm5719-llvm-93dc40dddde40cff2f54b68c66abb00927cdbcea.tar.gz bcm5719-llvm-93dc40dddde40cff2f54b68c66abb00927cdbcea.zip |
[OPENMP50]Basic support for conditional lastprivate.
Added parsing/sema checks for conditional lastprivates.
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/OpenMPClause.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index 790b4401229..30d55ef07c1 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -15,6 +15,7 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclOpenMP.h" #include "clang/Basic/LLVM.h" +#include "clang/Basic/OpenMPKinds.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" @@ -404,11 +405,12 @@ void OMPLastprivateClause::setAssignmentOps(ArrayRef<Expr *> AssignmentOps) { OMPLastprivateClause *OMPLastprivateClause::Create( const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs, - ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps, Stmt *PreInit, - Expr *PostUpdate) { + ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps, + OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, + SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate) { void *Mem = C.Allocate(totalSizeToAlloc<Expr *>(5 * VL.size())); - OMPLastprivateClause *Clause = - new (Mem) OMPLastprivateClause(StartLoc, LParenLoc, EndLoc, VL.size()); + OMPLastprivateClause *Clause = new (Mem) OMPLastprivateClause( + StartLoc, LParenLoc, EndLoc, LPKind, LPKindLoc, ColonLoc, VL.size()); Clause->setVarRefs(VL); Clause->setSourceExprs(SrcExprs); Clause->setDestinationExprs(DstExprs); @@ -1428,7 +1430,13 @@ void OMPClausePrinter::VisitOMPFirstprivateClause(OMPFirstprivateClause *Node) { void OMPClausePrinter::VisitOMPLastprivateClause(OMPLastprivateClause *Node) { if (!Node->varlist_empty()) { OS << "lastprivate"; - VisitOMPClauseList(Node, '('); + OpenMPLastprivateModifier LPKind = Node->getKind(); + if (LPKind != OMPC_LASTPRIVATE_unknown) { + OS << "(" + << getOpenMPSimpleClauseTypeName(OMPC_lastprivate, Node->getKind()) + << ":"; + } + VisitOMPClauseList(Node, LPKind == OMPC_LASTPRIVATE_unknown ? '(' : ' '); OS << ")"; } } |