[clang] [OpenACC] Implement Sema work for OpenACC Clauses (PR #87821)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 8 07:38:54 PDT 2024
================
@@ -11077,16 +11077,65 @@ OMPClause *TreeTransform<Derived>::TransformOMPXBareClause(OMPXBareClause *C) {
//===----------------------------------------------------------------------===//
// OpenACC transformation
//===----------------------------------------------------------------------===//
+template <typename Derived>
+OpenACCClause *TreeTransform<Derived>::TransformOpenACCClause(
+ ArrayRef<const OpenACCClause *> ExistingClauses,
+ OpenACCDirectiveKind DirKind, const OpenACCClause *OldClause) {
+
+ SemaOpenACC::OpenACCParsedClause ParsedClause(
+ DirKind, OldClause->getClauseKind(), OldClause->getBeginLoc());
+ ParsedClause.setEndLoc(OldClause->getEndLoc());
+
+ if (const auto *WithParms = dyn_cast<OpenACCClauseWithParams>(OldClause))
+ ParsedClause.setLParenLoc(WithParms->getLParenLoc());
+
+ switch (OldClause->getClauseKind()) {
+ // TODO OpenACC: Transform individual clauses, and set their info in
+ // ParsedClause.
+ default:
+ assert(false && "Unhandled OpenACC clause in TreeTransform");
+ return nullptr;
+ }
+
+ return getSema().OpenACC().ActOnClause(ExistingClauses, ParsedClause);
+}
+
+template <typename Derived>
+llvm::SmallVector<OpenACCClause *>
+TreeTransform<Derived>::TransformOpenACCClauseList(
+ OpenACCDirectiveKind DirKind, ArrayRef<const OpenACCClause *> OldClauses) {
----------------
erichkeane wrote:
In this patch, no. The next patch (that actually adds a clause) does, but I wanted to split the patch up to make it easier for you to review. This one is already unfortunately large, despite it effectively being 'NFC'.
https://github.com/llvm/llvm-project/pull/87821
More information about the cfe-commits
mailing list