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

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 24 10:36:08 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) {
----------------
alexey-bataev wrote:

I asking about auto for C, not for It.

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


More information about the cfe-commits mailing list