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

Method BuildFunction

cpp/src/gandiva/function_ir_builder.cc:63–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63llvm::Function* FunctionIRBuilder::BuildFunction(const std::string& function_name,
64 llvm::Type* return_type,
65 std::vector<NamedArg> in_args) {
66 std::vector<llvm::Type*> arg_types;
67 for (auto& arg : in_args) {
68 arg_types.push_back(arg.type);
69 }
70 auto prototype = llvm::FunctionType::get(return_type, arg_types, false /*isVarArg*/);
71 auto function = llvm::Function::Create(prototype, llvm::GlobalValue::ExternalLinkage,
72 function_name, module());
73
74 uint32_t i = 0;
75 for (auto& fn_arg : function->args()) {
76 DCHECK_LT(i, in_args.size());
77 fn_arg.setName(in_args[i].name);
78 ++i;
79 }
80 return function;
81}
82
83} // namespace gandiva

Callers

nothing calls this directly

Calls 3

moduleFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected