[clang] [OpenMP] Clang Codegen Interop : Accept multiple init (PR #82604)

via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 24 10:18:40 PST 2024


================
@@ -7023,19 +7023,25 @@ void CodeGenFunction::EmitOMPInteropDirective(const OMPInteropDirective &S) {
                                      S.getSingleClause<OMPUseClause>())) &&
          "OMPNowaitClause clause is used separately in OMPInteropDirective.");
 
-  if (const auto *C = S.getSingleClause<OMPInitClause>()) {
-    llvm::Value *InteropvarPtr =
-        EmitLValue(C->getInteropVar()).getPointer(*this);
-    llvm::omp::OMPInteropType InteropType = llvm::omp::OMPInteropType::Unknown;
-    if (C->getIsTarget()) {
-      InteropType = llvm::omp::OMPInteropType::Target;
-    } else {
-      assert(C->getIsTargetSync() && "Expected interop-type target/targetsync");
-      InteropType = llvm::omp::OMPInteropType::TargetSync;
+  auto It = S.getClausesOfKind<OMPInitClause>();
+  if (!It.empty()) {
+    // Look at the multiple init clauses
+    for (auto C : It) {
----------------
SunilKuravinakop wrote:

For the Iterator variable `It` `auto It` is preferable rather than 
`llvm::iterator_range<clang::OMPExecutableDirective::specific_clause_iterator<clang::OMPInitClause> > It`

https://github.com/llvm/llvm-project/pull/82604


More information about the cfe-commits mailing list