diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2022-08-15 11:25:49 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:11 -0700 |
commit | 2f9df466546263028ece7757cb6f813800d2d6b5 (patch) | |
tree | 443e450af8a249a8a94b86785fd0a589d2b8bd4f /yjit/bindgen | |
parent | ff3f1d15d2244dcafe5d7a748922e7c8b6b0f3bd (diff) |
Use bindgen for old manual extern declarations (https://github.com/Shopify/ruby/pull/404)
We have a large extern block in cruby.rs leftover from the port. We can
use bindgen for it now and reserve the manual declaration for just a
handful of vm_insnhelper.c functions.
Fixup a few minor discrepencies bindgen found between the C declaration
and the manual declaration. Mostly missing `const` on the C side.
Diffstat (limited to 'yjit/bindgen')
-rw-r--r-- | yjit/bindgen/src/main.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs index f8d87aeec8..a4c0b98504 100644 --- a/yjit/bindgen/src/main.rs +++ b/yjit/bindgen/src/main.rs @@ -311,6 +311,62 @@ fn main() { // From include/ruby/debug.h .allowlist_function("rb_profile_frames") + // Functions used for code generation + .allowlist_function("rb_insn_name") + .allowlist_function("rb_insn_len") + .allowlist_function("rb_yarv_class_of") + .allowlist_function("rb_get_ec_cfp") + .allowlist_function("rb_get_cfp_pc") + .allowlist_function("rb_get_cfp_sp") + .allowlist_function("rb_get_cfp_self") + .allowlist_function("rb_get_cfp_ep") + .allowlist_function("rb_get_cfp_ep_level") + .allowlist_function("rb_get_cme_def_type") + .allowlist_function("rb_get_cme_def_body_attr_id") + .allowlist_function("rb_get_cme_def_body_optimized_type") + .allowlist_function("rb_get_cme_def_body_optimized_index") + .allowlist_function("rb_get_cme_def_body_cfunc") + .allowlist_function("rb_get_def_method_serial") + .allowlist_function("rb_get_def_original_id") + .allowlist_function("rb_get_mct_argc") + .allowlist_function("rb_get_mct_func") + .allowlist_function("rb_get_def_iseq_ptr") + .allowlist_function("rb_iseq_encoded_size") + .allowlist_function("rb_get_iseq_body_local_iseq") + .allowlist_function("rb_get_iseq_body_iseq_encoded") + .allowlist_function("rb_get_iseq_body_stack_max") + .allowlist_function("rb_get_iseq_flags_has_opt") + .allowlist_function("rb_get_iseq_flags_has_kw") + .allowlist_function("rb_get_iseq_flags_has_rest") + .allowlist_function("rb_get_iseq_flags_has_post") + .allowlist_function("rb_get_iseq_flags_has_kwrest") + .allowlist_function("rb_get_iseq_flags_has_block") + .allowlist_function("rb_get_iseq_flags_has_accepts_no_kwarg") + .allowlist_function("rb_get_iseq_body_local_table_size") + .allowlist_function("rb_get_iseq_body_param_keyword") + .allowlist_function("rb_get_iseq_body_param_size") + .allowlist_function("rb_get_iseq_body_param_lead_num") + .allowlist_function("rb_get_iseq_body_param_opt_num") + .allowlist_function("rb_get_iseq_body_param_opt_table") + .allowlist_function("rb_get_cikw_keyword_len") + .allowlist_function("rb_get_cikw_keywords_idx") + .allowlist_function("rb_get_call_data_ci") + .allowlist_function("rb_yarv_str_eql_internal") + .allowlist_function("rb_yarv_ary_entry_internal") + .allowlist_function("rb_yarv_fix_mod_fix") + .allowlist_function("rb_FL_TEST") + .allowlist_function("rb_FL_TEST_RAW") + .allowlist_function("rb_RB_TYPE_P") + .allowlist_function("rb_BASIC_OP_UNREDEFINED_P") + .allowlist_function("rb_RSTRUCT_LEN") + .allowlist_function("rb_RSTRUCT_SET") + .allowlist_function("rb_vm_ci_argc") + .allowlist_function("rb_vm_ci_mid") + .allowlist_function("rb_vm_ci_flag") + .allowlist_function("rb_vm_ci_kwarg") + .allowlist_function("rb_METHOD_ENTRY_VISI") + .allowlist_function("rb_RCLASS_ORIGIN") + // We define VALUE manually, don't import it .blocklist_type("VALUE") |