calculate the number of arguments for a function signature
| 23 | namespace { |
| 24 | // calculate the number of arguments for a function signature |
| 25 | size_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 |
| 38 | arrow::Result<std::pair<std::vector<llvm::Type*>, llvm::Type*>> MapToLLVMSignature( |
no test coverage detected