[clang] [llvm] [OpenMP] OpenMP 5.1 "assume" directive parsing support (PR #92731)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 10:30:26 PDT 2024
================
@@ -9193,6 +9207,63 @@ StmtResult TreeTransform<Derived>::TransformOMPExecutableDirective(
AssociatedStmt.get(), D->getBeginLoc(), D->getEndLoc());
}
+/// This is mostly the same as above, but allows 'informational' class
+/// directives when rebuilding the stmt. It still takes an
+/// OMPExecutableDirective-type argument because we're reusing that as the
+/// superclass for the 'assume' directive at present, instead of defining a
+/// mostly-identical OMPInformationalDirective parent class.
+template <typename Derived>
+StmtResult TreeTransform<Derived>::TransformOMPInformationalDirective(
+ OMPExecutableDirective *D) {
+
+ // Transform the clauses
+ llvm::SmallVector<OMPClause *, 16> TClauses;
+ ArrayRef<OMPClause *> Clauses = D->clauses();
+ TClauses.reserve(Clauses.size());
+ for (ArrayRef<OMPClause *>::iterator I = Clauses.begin(), E = Clauses.end();
+ I != E; ++I) {
----------------
alexey-bataev wrote:
```suggestion
for (OMPClause *C : Clauses) {
```
https://github.com/llvm/llvm-project/pull/92731
More information about the llvm-commits
mailing list