Skip to content

Commit

Permalink
Rename public API to use c interface function to make this term consi…
Browse files Browse the repository at this point in the history
…stent.
  • Loading branch information
niyue committed Nov 8, 2023
1 parent c11101b commit 77a8135
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cpp/src/gandiva/external_stub_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static arrow::Result<std::pair<std::vector<llvm::Type*>, llvm::Type*>> MapToLLVM
}

arrow::Status ExternalStubFunctions::AddMappings(Engine* engine) const {
auto external_stub_funcs = function_registry_->GetStubFunctions();
auto const& external_stub_funcs = function_registry_->GetCInterfaceFunctions();
auto types = engine->types();
for (auto& [func, func_ptr] : external_stub_funcs) {
for (auto const& sig : func.signatures()) {
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/gandiva/function_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ arrow::Status FunctionRegistry::Register(
ARROW_RETURN_NOT_OK(holder_maker_registry_.Register(
func_base_name, std::move(function_holder_maker.value())));
}
stub_functions_.emplace_back(func, stub_function_ptr);
c_interface_functions_.emplace_back(func, stub_function_ptr);
ARROW_RETURN_NOT_OK(FunctionRegistry::Add(std::move(func)));
return Status::OK();
}
Expand All @@ -128,9 +128,9 @@ const std::vector<std::shared_ptr<arrow::Buffer>>& FunctionRegistry::GetBitcodeB
return bitcode_memory_buffers_;
}

const std::vector<std::pair<NativeFunction, void*>>& FunctionRegistry::GetStubFunctions()
const std::vector<std::pair<NativeFunction, void*>>& FunctionRegistry::GetCInterfaceFunctions()
const {
return stub_functions_;
return c_interface_functions_;
}

const FunctionHolderMakerRegistry& FunctionRegistry::GetFunctionHolderMakerRegistry()
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/gandiva/function_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ class GANDIVA_EXPORT FunctionRegistry {
arrow::Status Register(const std::vector<NativeFunction>& funcs,
std::shared_ptr<arrow::Buffer> bitcode_buffer);

/// \brief register a stub function into the function registry
/// \brief register a C interface function into the function registry
/// @param func the registered function's metadata
/// @param stub_function_ptr the function pointer to the
/// @param c_interface_function_ptr the function pointer to the
/// registered function's implementation
/// @param function_holder_maker this will be used as the function holder if the
/// function requires a function holder
arrow::Status Register(
NativeFunction func, void* stub_function_ptr,
NativeFunction func, void* c_interface_function_ptr,
std::optional<FunctionHolderMaker> function_holder_maker = std::nullopt);

/// \brief get a list of bitcode memory buffers saved in the registry
const std::vector<std::shared_ptr<arrow::Buffer>>& GetBitcodeBuffers() const;

/// \brief get a list of stub functions saved in the registry
const std::vector<std::pair<NativeFunction, void*>>& GetStubFunctions() const;
/// \brief get a list of C interface functions saved in the registry
const std::vector<std::pair<NativeFunction, void*>>& GetCInterfaceFunctions() const;

const FunctionHolderMakerRegistry& GetFunctionHolderMakerRegistry() const;

Expand All @@ -86,7 +86,7 @@ class GANDIVA_EXPORT FunctionRegistry {
std::vector<NativeFunction> pc_registry_;
SignatureMap pc_registry_map_;
std::vector<std::shared_ptr<arrow::Buffer>> bitcode_memory_buffers_;
std::vector<std::pair<NativeFunction, void*>> stub_functions_;
std::vector<std::pair<NativeFunction, void*>> c_interface_functions_;
FunctionHolderMakerRegistry holder_maker_registry_;

Status Add(NativeFunction func);
Expand Down

0 comments on commit 77a8135

Please sign in to comment.