| 788 | namespace gandiva { |
| 789 | |
| 790 | arrow::Status ExportedStringFunctions::AddMappings(Engine* engine) const { |
| 791 | std::vector<llvm::Type*> args; |
| 792 | auto types = engine->types(); |
| 793 | |
| 794 | // gdv_fn_like_utf8_utf8 |
| 795 | args = {types->i64_type(), // int64_t ptr |
| 796 | types->i8_ptr_type(), // const char* data |
| 797 | types->i32_type(), // int data_len |
| 798 | types->i8_ptr_type(), // const char* pattern |
| 799 | types->i32_type()}; // int pattern_len |
| 800 | |
| 801 | engine->AddGlobalMappingForFunc("gdv_fn_like_utf8_utf8", |
| 802 | types->i1_type() /*return_type*/, args, |
| 803 | reinterpret_cast<void*>(gdv_fn_like_utf8_utf8)); |
| 804 | |
| 805 | // gdv_fn_like_utf8_utf8_utf8 |
| 806 | args = {types->i64_type(), // int64_t ptr |
| 807 | types->i8_ptr_type(), // const char* data |
| 808 | types->i32_type(), // int data_len |
| 809 | types->i8_ptr_type(), // const char* pattern |
| 810 | types->i32_type(), // int pattern_len |
| 811 | types->i8_ptr_type(), // const char* escape_char |
| 812 | types->i32_type()}; // int escape_char_len |
| 813 | |
| 814 | engine->AddGlobalMappingForFunc("gdv_fn_like_utf8_utf8_utf8", |
| 815 | types->i1_type() /*return_type*/, args, |
| 816 | reinterpret_cast<void*>(gdv_fn_like_utf8_utf8_utf8)); |
| 817 | |
| 818 | // gdv_fn_ilike_utf8_utf8 |
| 819 | args = {types->i64_type(), // int64_t ptr |
| 820 | types->i8_ptr_type(), // const char* data |
| 821 | types->i32_type(), // int data_len |
| 822 | types->i8_ptr_type(), // const char* pattern |
| 823 | types->i32_type()}; // int pattern_len |
| 824 | |
| 825 | engine->AddGlobalMappingForFunc("gdv_fn_ilike_utf8_utf8", |
| 826 | types->i1_type() /*return_type*/, args, |
| 827 | reinterpret_cast<void*>(gdv_fn_ilike_utf8_utf8)); |
| 828 | |
| 829 | // gdv_fn_regexp_replace_utf8_utf8 |
| 830 | args = {types->i64_type(), // int64_t ptr |
| 831 | types->i64_type(), // int64_t holder_ptr |
| 832 | types->i8_ptr_type(), // const char* data |
| 833 | types->i32_type(), // int data_len |
| 834 | types->i8_ptr_type(), // const char* pattern |
| 835 | types->i32_type(), // int pattern_len |
| 836 | types->i8_ptr_type(), // const char* replace_string |
| 837 | types->i32_type(), // int32_t replace_string_len |
| 838 | types->i32_ptr_type()}; // int32_t* out_length |
| 839 | |
| 840 | engine->AddGlobalMappingForFunc( |
| 841 | "gdv_fn_regexp_replace_utf8_utf8", types->i8_ptr_type() /*return_type*/, args, |
| 842 | reinterpret_cast<void*>(gdv_fn_regexp_replace_utf8_utf8)); |
| 843 | |
| 844 | // gdv_fn_regexp_extract_utf8_utf8_int32 |
| 845 | args = {types->i64_type(), // int64_t ptr |
| 846 | types->i64_type(), // int64_t holder_ptr |
| 847 | types->i8_ptr_type(), // const char* data |
nothing calls this directly
no test coverage detected