================
@@ -3745,17 +3842,33 @@ convertOmpTargetData(Operation *op, llvm::IRBuilderBase 
&builder,
     return builder.saveIP();
   };
 
+  auto customMapperCB =
+      [&](unsigned int i) -> llvm::Expected<llvm::Function *> {
+    llvm::Function *mapperFunc = nullptr;
+    if (combinedInfo.Mappers[i]) {
+      info.HasMapper = true;
+      llvm::Expected<llvm::Function *> newFn = 
getOrCreateUserDefinedMapperFunc(
+          combinedInfo.Mappers[i], builder, moduleTranslation);
+      if (!newFn)
+        return newFn.takeError();
+      mapperFunc = *newFn;
+    }
+    return mapperFunc;
----------------
skatrak wrote:

Nit: You can probably simplify this a bit.
```suggestion
    if (!combinedInfo.Mappers[i])
      return nullptr;

    info.HasMapper = true;
    return getOrCreateUserDefinedMapperFunc(
        combinedInfo.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