MCPcopy Create free account
hub / github.com/apache/arrow / CompiledFunction

Method CompiledFunction

cpp/src/gandiva/engine.cc:578–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578Result<void*> Engine::CompiledFunction(const std::string& function) {
579 DCHECK(module_finalized_)
580 << "module must be finalized before getting compiled function";
581 auto sym = lljit_->lookup(function);
582 if (!sym) {
583 return Status::CodeGenError("Failed to look up function: " + function +
584 " error: " + llvm::toString(sym.takeError()));
585 }
586 // Since LLVM 15, `LLJIT::lookup` returns ExecutorAddrs rather than
587 // JITEvaluatedSymbols
588#if LLVM_VERSION_MAJOR >= 15
589 auto fn_addr = sym->getValue();
590#else
591 auto fn_addr = sym->getAddress();
592#endif
593 auto fn_ptr = reinterpret_cast<void*>(fn_addr);
594 if (fn_ptr == nullptr) {
595 return Status::CodeGenError("Failed to get address for function: " + function);
596 }
597 return fn_ptr;
598}
599
600void Engine::AddGlobalMappingForFunc(const std::string& name, llvm::Type* ret_type,
601 const std::vector<llvm::Type*>& args, void* func) {

Callers

nothing calls this directly

Calls 3

CodeGenErrorFunction · 0.85
lookupMethod · 0.80
getAddressMethod · 0.45

Tested by

no test coverage detected