================ @@ -3529,6 +3549,84 @@ static void genMapInfos(llvm::IRBuilderBase &builder, } } +static llvm::Expected<llvm::Function *> +emitUserDefinedMapper(Operation *declMapperOp, llvm::IRBuilderBase &builder, + LLVM::ModuleTranslation &moduleTranslation); + +static llvm::Expected<llvm::Function *> +getOrCreateUserDefinedMapperFunc(Operation *declMapperOp, + llvm::IRBuilderBase &builder, + LLVM::ModuleTranslation &moduleTranslation) { + static llvm::DenseMap<const Operation *, llvm::Function *> userDefMapperMap; ---------------- skatrak wrote:
I think we should avoid creating these kinds of global variables. Can't we use `moduleTranslation.lookupFunction()` + `moduleTranslation.mapFunction()` to handle this case? We'd just need to make sure we can easily obtain the function name from the operation, which I guess looking below it's `ompBuilder>createPlatformSpecificName({"omp_mapper", declMapperOp.getSymName()});`. 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