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

Function GetNumArgs

cpp/src/gandiva/external_c_functions.cc:25–35  ·  view source on GitHub ↗

calculate the number of arguments for a function signature

Source from the content-addressed store, hash-verified

23namespace {
24// calculate the number of arguments for a function signature
25size_t GetNumArgs(const gandiva::FunctionSignature& sig,
26 const gandiva::NativeFunction& func) {
27 auto num_args = 0;
28 num_args += func.NeedsContext() ? 1 : 0;
29 num_args += func.NeedsFunctionHolder() ? 1 : 0;
30 for (const auto& arg : sig.param_types()) {
31 num_args += arg->id() == arrow::Type::STRING ? 2 : 1;
32 }
33 num_args += sig.ret_type()->id() == arrow::Type::STRING ? 1 : 0;
34 return num_args;
35}
36
37// map from a NativeFunction's signature to the corresponding LLVM signature
38arrow::Result<std::pair<std::vector<llvm::Type*>, llvm::Type*>> MapToLLVMSignature(

Callers 1

MapToLLVMSignatureFunction · 0.85

Calls 1

idMethod · 0.45

Tested by

no test coverage detected