From 77a8135a431f76aaffedca09f09bc4e7fc09fc69 Mon Sep 17 00:00:00 2001 From: Yue Ni Date: Wed, 8 Nov 2023 13:44:51 +0800 Subject: [PATCH] Rename public API to use c interface function to make this term consistent. --- cpp/src/gandiva/external_stub_functions.cc | 2 +- cpp/src/gandiva/function_registry.cc | 6 +++--- cpp/src/gandiva/function_registry.h | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cpp/src/gandiva/external_stub_functions.cc b/cpp/src/gandiva/external_stub_functions.cc index 669b97669f827..f3fdcd332460d 100644 --- a/cpp/src/gandiva/external_stub_functions.cc +++ b/cpp/src/gandiva/external_stub_functions.cc @@ -81,7 +81,7 @@ static arrow::Result, 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()) { diff --git a/cpp/src/gandiva/function_registry.cc b/cpp/src/gandiva/function_registry.cc index 4f78f8e75ef4e..7fe260d57d833 100644 --- a/cpp/src/gandiva/function_registry.cc +++ b/cpp/src/gandiva/function_registry.cc @@ -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(); } @@ -128,9 +128,9 @@ const std::vector>& FunctionRegistry::GetBitcodeB return bitcode_memory_buffers_; } -const std::vector>& FunctionRegistry::GetStubFunctions() +const std::vector>& FunctionRegistry::GetCInterfaceFunctions() const { - return stub_functions_; + return c_interface_functions_; } const FunctionHolderMakerRegistry& FunctionRegistry::GetFunctionHolderMakerRegistry() diff --git a/cpp/src/gandiva/function_registry.h b/cpp/src/gandiva/function_registry.h index ec3661d74161a..c1860188d17a2 100644 --- a/cpp/src/gandiva/function_registry.h +++ b/cpp/src/gandiva/function_registry.h @@ -58,21 +58,21 @@ class GANDIVA_EXPORT FunctionRegistry { arrow::Status Register(const std::vector& funcs, std::shared_ptr 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 function_holder_maker = std::nullopt); /// \brief get a list of bitcode memory buffers saved in the registry const std::vector>& GetBitcodeBuffers() const; - /// \brief get a list of stub functions saved in the registry - const std::vector>& GetStubFunctions() const; + /// \brief get a list of C interface functions saved in the registry + const std::vector>& GetCInterfaceFunctions() const; const FunctionHolderMakerRegistry& GetFunctionHolderMakerRegistry() const; @@ -86,7 +86,7 @@ class GANDIVA_EXPORT FunctionRegistry { std::vector pc_registry_; SignatureMap pc_registry_map_; std::vector> bitcode_memory_buffers_; - std::vector> stub_functions_; + std::vector> c_interface_functions_; FunctionHolderMakerRegistry holder_maker_registry_; Status Add(NativeFunction func);