| 843 | namespace gandiva { |
| 844 | |
| 845 | arrow::Status ExportedStringFunctions::AddMappings(Engine* engine) const { |
| 846 | std::vector<llvm::Type*> args; |
| 847 | auto types = engine->types(); |
| 848 | |
| 849 | // gdv_fn_like_utf8_utf8 |
| 850 | args = {types->i64_type(), // int64_t ptr |
| 851 | types->i8_ptr_type(), // const char* data |
| 852 | types->i32_type(), // int data_len |
| 853 | types->i8_ptr_type(), // const char* pattern |
| 854 | types->i32_type()}; // int pattern_len |
| 855 | |
| 856 | engine->AddGlobalMappingForFunc("gdv_fn_like_utf8_utf8", |
| 857 | types->i1_type() /*return_type*/, args, |
| 858 | reinterpret_cast<void*>(gdv_fn_like_utf8_utf8)); |
| 859 | |
| 860 | // gdv_fn_like_utf8_utf8_utf8 |
| 861 | args = {types->i64_type(), // int64_t ptr |
| 862 | types->i8_ptr_type(), // const char* data |
| 863 | types->i32_type(), // int data_len |
| 864 | types->i8_ptr_type(), // const char* pattern |
| 865 | types->i32_type(), // int pattern_len |
| 866 | types->i8_ptr_type(), // const char* escape_char |
| 867 | types->i32_type()}; // int escape_char_len |
| 868 | |
| 869 | engine->AddGlobalMappingForFunc("gdv_fn_like_utf8_utf8_utf8", |
| 870 | types->i1_type() /*return_type*/, args, |
| 871 | reinterpret_cast<void*>(gdv_fn_like_utf8_utf8_utf8)); |
| 872 | |
| 873 | // gdv_fn_ilike_utf8_utf8 |
| 874 | args = {types->i64_type(), // int64_t ptr |
| 875 | types->i8_ptr_type(), // const char* data |
| 876 | types->i32_type(), // int data_len |
| 877 | types->i8_ptr_type(), // const char* pattern |
| 878 | types->i32_type()}; // int pattern_len |
| 879 | |
| 880 | engine->AddGlobalMappingForFunc("gdv_fn_ilike_utf8_utf8", |
| 881 | types->i1_type() /*return_type*/, args, |
| 882 | reinterpret_cast<void*>(gdv_fn_ilike_utf8_utf8)); |
| 883 | |
| 884 | // gdv_fn_regexp_replace_utf8_utf8 |
| 885 | args = {types->i64_type(), // int64_t ptr |
| 886 | types->i64_type(), // int64_t holder_ptr |
| 887 | types->i8_ptr_type(), // const char* data |
| 888 | types->i32_type(), // int data_len |
| 889 | types->i8_ptr_type(), // const char* pattern |
| 890 | types->i32_type(), // int pattern_len |
| 891 | types->i8_ptr_type(), // const char* replace_string |
| 892 | types->i32_type(), // int32_t replace_string_len |
| 893 | types->i32_ptr_type()}; // int32_t* out_length |
| 894 | |
| 895 | engine->AddGlobalMappingForFunc( |
| 896 | "gdv_fn_regexp_replace_utf8_utf8", types->i8_ptr_type() /*return_type*/, args, |
| 897 | reinterpret_cast<void*>(gdv_fn_regexp_replace_utf8_utf8)); |
| 898 | |
| 899 | // gdv_fn_regexp_extract_utf8_utf8_int32 |
| 900 | args = {types->i64_type(), // int64_t ptr |
| 901 | types->i64_type(), // int64_t holder_ptr |
| 902 | types->i8_ptr_type(), // const char* data |
nothing calls this directly
no test coverage detected