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

Method CompiledFunction

cpp/src/gandiva/engine.cc:604–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604Result<void*> Engine::CompiledFunction(const std::string& function) {
605 DCHECK(module_finalized_)
606 << "module must be finalized before getting compiled function";
607 auto sym = lljit_->lookup(function);
608 if (!sym) {
609 return Status::CodeGenError("Failed to look up function: " + function +
610 " error: " + llvm::toString(sym.takeError()));
611 }
612 // Since LLVM 15, `LLJIT::lookup` returns ExecutorAddrs rather than
613 // JITEvaluatedSymbols
614#if LLVM_VERSION_MAJOR >= 15
615 auto fn_addr = sym->getValue();
616#else
617 auto fn_addr = sym->getAddress();
618#endif
619 auto fn_ptr = reinterpret_cast<void*>(fn_addr);
620 if (fn_ptr == nullptr) {
621 return Status::CodeGenError("Failed to get address for function: " + function);
622 }
623 return fn_ptr;
624}
625
626void Engine::AddGlobalMappingForFunc(const std::string& name, llvm::Type* ret_type,
627 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