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

Method AddFunctionCall

cpp/src/gandiva/llvm_generator.cc:533–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533llvm::Value* LLVMGenerator::AddFunctionCall(const std::string& full_name,
534 llvm::Type* ret_type,
535 const std::vector<llvm::Value*>& args) {
536 // find the llvm function.
537 llvm::Function* fn = module()->getFunction(full_name);
538 DCHECK_NE(fn, nullptr) << "missing function " << full_name;
539
540 if (enable_ir_traces_ && !full_name.compare("printf") &&
541 !full_name.compare("printff")) {
542 // Trace for debugging
543 ADD_TRACE("invoke native fn " + full_name);
544 }
545
546 // build a call to the llvm function.
547 llvm::CallInst* call;
548 if (ret_type->isVoidTy()) {
549 // void functions can't have a name for the call.
550 call = ir_builder()->CreateCall(fn, args);
551 } else {
552 call = ir_builder()->CreateCall(fn, args, full_name);
553 DCHECK(call->getType() == ret_type);
554 }
555 internal::CopyZExtAttrs(*fn, *call);
556
557 return call;
558}
559
560std::shared_ptr<DecimalLValue> LLVMGenerator::BuildDecimalLValue(llvm::Value* value,
561 DataTypePtr arrow_type) {

Callers 3

VisitInExpressionMethod · 0.80
BuildFunctionCallMethod · 0.80
TEST_FFunction · 0.80

Calls 5

moduleFunction · 0.85
CopyZExtAttrsFunction · 0.85
compareMethod · 0.80
ir_builderFunction · 0.70
getTypeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64