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

Method AddFunctionCall

cpp/src/gandiva/llvm_generator.cc:532–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

VisitInExpressionMethod · 0.80
BuildFunctionCallMethod · 0.80

Calls 4

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

Tested by

no test coverage detected