Lines Matching defs:mcd

430 	merge_cb_data_t *mcd = private;
432 if (get_mapping(mcd->md_ta, ctdp->t_id) > 0)
442 merge_cb_data_t *mcd = private;
445 ed.ed_ta = mcd->md_ta;
446 ed.ed_clear_mark = mcd->md_parent->td_curemark;
447 ed.ed_cur_mark = mcd->md_parent->td_curemark + 1;
453 if (hash_find_iter(mcd->md_parent->td_layouthash, ctdp,
457 int id = mcd->md_tgt->td_nextid++;
460 add_mapping(mcd->md_ta, ctdp->t_id, id);
461 alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt,
463 hash_add(mcd->md_tdtba, ctdp);
465 add_mapping(mcd->md_ta, ctdp->t_id, ed.ed_tgt->t_id);
467 } else if (debug_level > 1 && hash_iter(mcd->md_parent->td_idhash,
478 int id = mcd->md_tgt->td_nextid++;
481 add_mapping(mcd->md_ta, ctdp->t_id, id);
482 hash_add(mcd->md_tdtba, ctdp);
485 mcd->md_parent->td_curemark = ed.ed_cur_mark + 1;
494 merge_cb_data_t *mcd = private;
497 ed.ed_ta = mcd->md_ta;
498 ed.ed_clear_mark = mcd->md_parent->td_curemark;
499 ed.ed_cur_mark = mcd->md_parent->td_curemark + 1;
504 if (hash_find_iter(mcd->md_tdtba, ctdp, equiv_cb, &ed) < 0) {
507 add_mapping(mcd->md_ta, ctdp->t_id,
508 get_mapping(mcd->md_ta, ed.ed_tgt->t_id));
509 } else if (debug_level > 1 && hash_iter(mcd->md_tdtba,
521 int id = mcd->md_tgt->td_nextid++;
524 add_mapping(mcd->md_ta, ctdp->t_id, id);
525 hash_add(mcd->md_tdtba, ctdp);
528 mcd->md_parent->td_curemark = ed.ed_cur_mark + 1;
659 merge_cb_data_t *mcd = arg;
663 post = (mcd->md_flags & MCD_F_SELFUNIQUIFY ? map_self_post : map_post);
666 (void) iitraverse(sii, &mcd->md_parent->td_curvgen, NULL, map_pre, post,
667 mcd);
671 iif.iif_ta = mcd->md_ta;
672 iif.iif_newidx = get_mapping(mcd->md_ta, sii->ii_dtype->t_id);
673 iif.iif_refmerge = (mcd->md_flags & MCD_F_REFMERGE);
675 if (hash_match(mcd->md_parent->td_iihash, sii, iidesc_match,
683 list_add(mcd->md_iitba, sii);
690 merge_cb_data_t *mcd)
701 if ((template.t_id = get_mapping(mcd->md_ta, oldid)) == 0)
705 if (!hash_find(mcd->md_parent->td_idhash, (void *)&template,
706 (void *)&tgt) && (!(mcd->md_flags & MCD_F_REFMERGE) ||
707 !hash_find(mcd->md_tgt->td_idhash, (void *)&template,
712 list_add(mcd->md_tdtbr, tgtp);
736 conjure_intrinsic(tdesc_t *old, int newselfid, merge_cb_data_t *mcd __unused)
747 conjure_plain(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
751 (void) remap_node(&new->t_tdesc, old->t_tdesc, old->t_id, new, mcd);
757 conjure_function(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
764 (void) remap_node(&nfn->fn_ret, ofn->fn_ret, old->t_id, new, mcd);
774 new, mcd);
783 conjure_array(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
790 mcd);
792 mcd);
802 conjure_su(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
814 old->t_id, new, mcd);
823 conjure_enum(tdesc_t *old, int newselfid, merge_cb_data_t *mcd __unused)
841 conjure_forward(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
845 list_add(&mcd->md_tgt->td_fwdlist, new);
852 conjure_assert(tdesc_t *old __unused, int newselfid __unused, merge_cb_data_t *mcd __unused)
859 conjure_iidesc(iidesc_t *old, merge_cb_data_t *mcd)
864 (void) remap_node(&new->ii_dtype, old->ii_dtype, -1, NULL, mcd);
867 mcd);
938 redir_mstr_fwds(merge_cb_data_t *mcd)
943 rmd.rmd_tgt = mcd->md_tgt;
946 if (alist_iter(mcd->md_fdida, redir_mstr_fwd_cb, &rmd)) {
947 (void) iitraverse_hash(mcd->md_tgt->td_iihash,
948 &mcd->md_tgt->td_curvgen, fwd_redir_cbs, NULL, NULL, map);
957 merge_cb_data_t *mcd = private;
963 newidx = get_mapping(mcd->md_ta, tba->ii_dtype->t_id);
966 (void) list_remove(mcd->md_iitba, data, NULL, NULL);
969 iif.iif_ta = mcd->md_ta;
971 iif.iif_refmerge = (mcd->md_flags & MCD_F_REFMERGE);
973 if (hash_match(mcd->md_parent->td_iihash, tba, iidesc_match,
980 new = conjure_iidesc(tba, mcd);
981 hash_add(mcd->md_tgt->td_iihash, new);
987 add_tdesc(tdesc_t *oldtdp, int newid, merge_cb_data_t *mcd)
993 assert(hash_find(mcd->md_parent->td_idhash,
1001 mcd)) == NULL)
1007 hash_add(mcd->md_tgt->td_idhash, newtdp);
1008 hash_add(mcd->md_tgt->td_layouthash, newtdp);
1017 merge_cb_data_t *mcd = arg;
1021 newid = get_mapping(mcd->md_ta, tdp->t_id);
1024 if ((rc = add_tdesc(tdp, newid, mcd)))
1025 hash_remove(mcd->md_tdtba, (void *)tdp);
1034 merge_cb_data_t *mcd = arg;
1038 if (!remap_node(tdpp, *tdpp, -1, NULL, mcd))
1041 (void) list_remove(mcd->md_tdtbr, (void *)tdpp, NULL, NULL);
1046 merge_types(hash_t *src, merge_cb_data_t *mcd)
1052 mcd->md_iitba = &iitba;
1053 mcd->md_tdtba = hash_new(TDATA_LAYOUT_HASH_SIZE, tdesc_layouthash,
1055 mcd->md_tdtbr = &tdtbr;
1057 (void) hash_iter(src, merge_type_cb, mcd);
1059 tdrc = hash_iter(mcd->md_tdtba, add_tdtba_cb, mcd);
1062 iirc = list_iter(*mcd->md_iitba, add_iitba_cb, mcd);
1065 assert(list_count(*mcd->md_iitba) == 0 &&
1066 hash_count(mcd->md_tdtba) == 0);
1068 tdrc = list_iter(*mcd->md_tdtbr, add_tdtbr_cb, mcd);
1071 if (list_count(*mcd->md_tdtbr) != 0)
1076 * definitions for those forwards in mcd->md_fdida. By this point,
1082 if (mcd->md_parent == mcd->md_tgt) {
1083 redir_mstr_fwds(mcd);
1090 merge_cb_data_t mcd;
1100 mcd.md_parent = mstr;
1101 mcd.md_tgt = (tgt ? tgt : mstr);
1102 mcd.md_ta = alist_new(NULL, NULL);
1103 mcd.md_fdida = alist_new(NULL, NULL);
1104 mcd.md_flags = 0;
1107 mcd.md_flags |= MCD_F_SELFUNIQUIFY;
1109 mcd.md_flags |= MCD_F_REFMERGE;
1114 merge_types(cur->td_iihash, &mcd);
1118 alist_stats(mcd.md_ta, 0);
1120 hash_stats(mcd.md_tgt->td_layouthash, 1);
1123 alist_free(mcd.md_fdida);
1124 alist_free(mcd.md_ta);