MCPcopy Create free account
hub / github.com/apache/impala / MaterializeFunction

Method MaterializeFunction

be/src/codegen/llvm-codegen.cc:706–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704}
705
706Status LlvmCodeGen::MaterializeFunction(llvm::Function* fn) {
707 DCHECK(!is_compiled_);
708 if (fn->isIntrinsic() || !fn->isMaterializable()) return Status::OK();
709
710 llvm::Error err = module_->materialize(fn);
711 if (UNLIKELY(err)) {
712 string err_string;
713 llvm::handleAllErrors(
714 move(err), [&](llvm::ErrorInfoBase& eib) { err_string = eib.message(); });
715 return Status(Substitute("Failed to materialize $0: $1",
716 fn->getName().str(), err_string));
717 }
718
719 // Materialized functions are marked as not materializable by LLVM.
720 DCHECK(!fn->isMaterializable());
721 SetCPUAttrs(fn);
722 const unordered_set<string>* callees = shared_call_graph_.GetCallees(fn->getName());
723 if (callees != nullptr) {
724 for (const string& callee : *callees) {
725 llvm::Function* callee_fn = module_->getFunction(callee);
726 DCHECK(callee_fn != nullptr);
727 RETURN_IF_ERROR(MaterializeFunction(callee_fn));
728 }
729 }
730 return Status::OK();
731}
732
733llvm::Function* LlvmCodeGen::GetFunction(const string& symbol, bool clone) {
734 llvm::Function* fn = module_->getFunction(symbol.c_str());

Callers 1

CreateImpalaCodegenMethod · 0.80

Calls 9

OKFunction · 0.85
moveFunction · 0.85
SubstituteFunction · 0.85
GetCalleesMethod · 0.80
getNameMethod · 0.65
getFunctionMethod · 0.65
StatusClass · 0.50
messageMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected