================
@@ -4438,15 +4551,33 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase 
&builder,
       findAllocaInsertPoint(builder, moduleTranslation);
   llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
 
+  llvm::OpenMPIRBuilder::TargetDataInfo info(
+      /*RequiresDevicePointerInfo=*/false,
+      /*SeparateBeginEndCalls=*/true);
+
+  auto customMapperCB =
+      [&](unsigned int i) -> llvm::Expected<llvm::Function *> {
+    llvm::Function *mapperFunc = nullptr;
+    if (combinedInfos.Mappers[i]) {
+      info.HasMapper = true;
+      llvm::Expected<llvm::Function *> newFn = 
getOrCreateUserDefinedMapperFunc(
+          combinedInfos.Mappers[i], builder, moduleTranslation);
+      if (!newFn)
+        return newFn.takeError();
+      mapperFunc = *newFn;
+    }
+    return mapperFunc;
----------------
skatrak wrote:

```suggestion
    if (!combinedInfos.Mappers[i])
      return nullptr;

    info.HasMapper = true;
    return getOrCreateUserDefinedMapperFunc(
        combinedInfos.Mappers[i], builder, moduleTranslation);
```

https://github.com/llvm/llvm-project/pull/124746
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to