| 869 | namespace gandiva { |
| 870 | |
| 871 | arrow::Status ExportedStringFunctions::AddMappings(Engine* engine) const { |
| 872 | std::vector<llvm::Type*> args; |
| 873 | auto types = engine->types(); |
| 874 | |
| 875 | // gdv_fn_like_utf8_utf8 |
| 876 | args = {types->i64_type(), // int64_t ptr |
| 877 | types->i8_ptr_type(), // const char* data |
| 878 | types->i32_type(), // int data_len |
| 879 | types->i8_ptr_type(), // const char* pattern |
| 880 | types->i32_type()}; // int pattern_len |
| 881 | |
| 882 | engine->AddGlobalMappingForFunc("gdv_fn_like_utf8_utf8", |
| 883 | types->i1_type() /*return_type*/, args, |
| 884 | reinterpret_cast<void*>(gdv_fn_like_utf8_utf8)); |
| 885 | |
| 886 | // gdv_fn_like_utf8_utf8_utf8 |
| 887 | args = {types->i64_type(), // int64_t ptr |
| 888 | types->i8_ptr_type(), // const char* data |
| 889 | types->i32_type(), // int data_len |
| 890 | types->i8_ptr_type(), // const char* pattern |
| 891 | types->i32_type(), // int pattern_len |
| 892 | types->i8_ptr_type(), // const char* escape_char |
| 893 | types->i32_type()}; // int escape_char_len |
| 894 | |
| 895 | engine->AddGlobalMappingForFunc("gdv_fn_like_utf8_utf8_utf8", |
| 896 | types->i1_type() /*return_type*/, args, |
| 897 | reinterpret_cast<void*>(gdv_fn_like_utf8_utf8_utf8)); |
| 898 | |
| 899 | // gdv_fn_ilike_utf8_utf8 |
| 900 | args = {types->i64_type(), // int64_t ptr |
| 901 | types->i8_ptr_type(), // const char* data |
| 902 | types->i32_type(), // int data_len |
| 903 | types->i8_ptr_type(), // const char* pattern |
| 904 | types->i32_type()}; // int pattern_len |
| 905 | |
| 906 | engine->AddGlobalMappingForFunc("gdv_fn_ilike_utf8_utf8", |
| 907 | types->i1_type() /*return_type*/, args, |
| 908 | reinterpret_cast<void*>(gdv_fn_ilike_utf8_utf8)); |
| 909 | |
| 910 | // gdv_fn_regexp_replace_utf8_utf8 |
| 911 | args = {types->i64_type(), // int64_t ptr |
| 912 | types->i64_type(), // int64_t holder_ptr |
| 913 | types->i8_ptr_type(), // const char* data |
| 914 | types->i32_type(), // int data_len |
| 915 | types->i8_ptr_type(), // const char* pattern |
| 916 | types->i32_type(), // int pattern_len |
| 917 | types->i8_ptr_type(), // const char* replace_string |
| 918 | types->i32_type(), // int32_t replace_string_len |
| 919 | types->i32_ptr_type()}; // int32_t* out_length |
| 920 | |
| 921 | engine->AddGlobalMappingForFunc( |
| 922 | "gdv_fn_regexp_replace_utf8_utf8", types->i8_ptr_type() /*return_type*/, args, |
| 923 | reinterpret_cast<void*>(gdv_fn_regexp_replace_utf8_utf8)); |
| 924 | |
| 925 | // gdv_fn_regexp_extract_utf8_utf8_int32 |
| 926 | args = {types->i64_type(), // int64_t ptr |
| 927 | types->i64_type(), // int64_t holder_ptr |
| 928 | types->i8_ptr_type(), // const char* data |
nothing calls this directly
no test coverage detected