-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[OpenACC] Private Clause on Compute Constructs #90521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
54ba7d0
11a3890
425e4fd
6c653fc
4b277b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,24 @@ OpenACCNumGangsClause *OpenACCNumGangsClause::Create(const ASTContext &C, | |
return new (Mem) OpenACCNumGangsClause(BeginLoc, LParenLoc, IntExprs, EndLoc); | ||
} | ||
|
||
OpenACCPrivateClause *OpenACCPrivateClause::Create(const ASTContext &C, | ||
SourceLocation BeginLoc, | ||
SourceLocation LParenLoc, | ||
ArrayRef<Expr *> VarList, | ||
SourceLocation EndLoc) { | ||
void *Mem = C.Allocate( | ||
OpenACCPrivateClause::totalSizeToAlloc<Expr *>(VarList.size())); | ||
return new (Mem) OpenACCPrivateClause(BeginLoc, LParenLoc, VarList, EndLoc); | ||
} | ||
|
||
// ValueDecl *getDeclFromExpr(Expr *RefExpr) { | ||
// //RefExpr = RefExpr->IgnoreParenImpCasts(); | ||
// | ||
// ////while (isa<ArraySubscriptExpr, ArraySectionExpr>(RefExpr)) { | ||
// ////} | ||
// // TODO: | ||
// } | ||
|
||
//===----------------------------------------------------------------------===// | ||
// OpenACC clauses printing methods | ||
//===----------------------------------------------------------------------===// | ||
|
@@ -166,3 +184,9 @@ void OpenACCClausePrinter::VisitVectorLengthClause( | |
const OpenACCVectorLengthClause &C) { | ||
OS << "vector_length(" << C.getIntExpr() << ")"; | ||
} | ||
|
||
void OpenACCClausePrinter::VisitPrivateClause(const OpenACCPrivateClause &C) { | ||
OS << "private("; | ||
llvm::interleaveComma(C.getVarList(), OS); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a test for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont! I THINK this uses 'ast-print', so give me a minute and I'll put one on this review that tests all of the variants here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test added :) A bit of exploration, plus a patch to fix the rest (upstreamed as review after commit), and now up to date here :) |
||
OS << ")"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops! Thanks, good catch!