Lines Matching defs:mcd

435 	merge_cb_data_t *mcd = private;
437 if (get_mapping(mcd->md_ta, ctdp->t_id) > 0)
447 merge_cb_data_t *mcd = private;
450 ed.ed_ta = mcd->md_ta;
451 ed.ed_clear_mark = mcd->md_parent->td_curemark;
452 ed.ed_cur_mark = mcd->md_parent->td_curemark + 1;
458 if (hash_find_iter(mcd->md_parent->td_layouthash, ctdp,
462 int id = mcd->md_tgt->td_nextid++;
465 add_mapping(mcd->md_ta, ctdp->t_id, id);
466 alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt,
468 hash_add(mcd->md_tdtba, ctdp);
470 add_mapping(mcd->md_ta, ctdp->t_id, ed.ed_tgt->t_id);
472 } else if (debug_level > 1 && hash_iter(mcd->md_parent->td_idhash,
483 int id = mcd->md_tgt->td_nextid++;
486 add_mapping(mcd->md_ta, ctdp->t_id, id);
487 hash_add(mcd->md_tdtba, ctdp);
490 mcd->md_parent->td_curemark = ed.ed_cur_mark + 1;
499 merge_cb_data_t *mcd = private;
502 ed.ed_ta = mcd->md_ta;
503 ed.ed_clear_mark = mcd->md_parent->td_curemark;
504 ed.ed_cur_mark = mcd->md_parent->td_curemark + 1;
509 if (hash_find_iter(mcd->md_tdtba, ctdp, equiv_cb, &ed) < 0) {
512 add_mapping(mcd->md_ta, ctdp->t_id,
513 get_mapping(mcd->md_ta, ed.ed_tgt->t_id));
514 } else if (debug_level > 1 && hash_iter(mcd->md_tdtba,
526 int id = mcd->md_tgt->td_nextid++;
529 add_mapping(mcd->md_ta, ctdp->t_id, id);
530 hash_add(mcd->md_tdtba, ctdp);
533 mcd->md_parent->td_curemark = ed.ed_cur_mark + 1;
658 merge_cb_data_t *mcd = arg;
662 post = (mcd->md_flags & MCD_F_SELFUNIQUIFY ? map_self_post : map_post);
665 (void) iitraverse(sii, &mcd->md_parent->td_curvgen, NULL, map_pre, post,
666 mcd);
670 iif.iif_ta = mcd->md_ta;
671 iif.iif_newidx = get_mapping(mcd->md_ta, sii->ii_dtype->t_id);
672 iif.iif_refmerge = (mcd->md_flags & MCD_F_REFMERGE);
674 if (hash_match(mcd->md_parent->td_iihash, sii, iidesc_match,
682 list_add(mcd->md_iitba, sii);
689 merge_cb_data_t *mcd)
700 if ((template.t_id = get_mapping(mcd->md_ta, oldid)) == 0)
703 if (!hash_find(mcd->md_parent->td_idhash, (void *)&template,
704 (void *)&tgt) && (!(mcd->md_flags & MCD_F_REFMERGE) ||
705 !hash_find(mcd->md_tgt->td_idhash, (void *)&template,
710 list_add(mcd->md_tdtbr, tgtp);
734 conjure_intrinsic(tdesc_t *old, int newselfid, merge_cb_data_t *mcd __unused)
745 conjure_plain(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
749 (void) remap_node(&new->t_tdesc, old->t_tdesc, old->t_id, new, mcd);
755 conjure_function(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
762 (void) remap_node(&nfn->fn_ret, ofn->fn_ret, old->t_id, new, mcd);
772 new, mcd);
781 conjure_array(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
788 mcd);
790 mcd);
800 conjure_su(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
812 old->t_id, new, mcd);
821 conjure_enum(tdesc_t *old, int newselfid, merge_cb_data_t *mcd __unused)
839 conjure_forward(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
843 list_add(&mcd->md_tgt->td_fwdlist, new);
850 conjure_assert(tdesc_t *old __unused, int newselfid __unused, merge_cb_data_t *mcd __unused)
857 conjure_iidesc(iidesc_t *old, merge_cb_data_t *mcd)
862 (void) remap_node(&new->ii_dtype, old->ii_dtype, -1, NULL, mcd);
865 mcd);
934 redir_mstr_fwds(merge_cb_data_t *mcd)
939 rmd.rmd_tgt = mcd->md_tgt;
942 if (alist_iter(mcd->md_fdida, redir_mstr_fwd_cb, &rmd)) {
943 (void) iitraverse_hash(mcd->md_tgt->td_iihash,
944 &mcd->md_tgt->td_curvgen, fwd_redir_cbs, NULL, NULL, map);
953 merge_cb_data_t *mcd = private;
959 newidx = get_mapping(mcd->md_ta, tba->ii_dtype->t_id);
962 (void) list_remove(mcd->md_iitba, data, NULL, NULL);
965 iif.iif_ta = mcd->md_ta;
967 iif.iif_refmerge = (mcd->md_flags & MCD_F_REFMERGE);
969 if (hash_match(mcd->md_parent->td_iihash, tba, iidesc_match,
976 new = conjure_iidesc(tba, mcd);
977 hash_add(mcd->md_tgt->td_iihash, new);
983 add_tdesc(tdesc_t *oldtdp, int newid, merge_cb_data_t *mcd)
989 assert(hash_find(mcd->md_parent->td_idhash,
997 mcd)) == NULL)
1003 hash_add(mcd->md_tgt->td_idhash, newtdp);
1004 hash_add(mcd->md_tgt->td_layouthash, newtdp);
1013 merge_cb_data_t *mcd = arg;
1017 newid = get_mapping(mcd->md_ta, tdp->t_id);
1020 if ((rc = add_tdesc(tdp, newid, mcd)))
1021 hash_remove(mcd->md_tdtba, (void *)tdp);
1030 merge_cb_data_t *mcd = arg;
1034 if (!remap_node(tdpp, *tdpp, -1, NULL, mcd))
1037 (void) list_remove(mcd->md_tdtbr, (void *)tdpp, NULL, NULL);
1042 merge_types(hash_t *src, merge_cb_data_t *mcd)
1048 mcd->md_iitba = &iitba;
1049 mcd->md_tdtba = hash_new(TDATA_LAYOUT_HASH_SIZE, tdesc_layouthash,
1051 mcd->md_tdtbr = &tdtbr;
1053 (void) hash_iter(src, merge_type_cb, mcd);
1055 tdrc = hash_iter(mcd->md_tdtba, add_tdtba_cb, mcd);
1058 iirc = list_iter(*mcd->md_iitba, add_iitba_cb, mcd);
1061 assert(list_count(*mcd->md_iitba) == 0 &&
1062 hash_count(mcd->md_tdtba) == 0);
1064 tdrc = list_iter(*mcd->md_tdtbr, add_tdtbr_cb, mcd);
1067 if (list_count(*mcd->md_tdtbr) != 0)
1072 * definitions for those forwards in mcd->md_fdida. By this point,
1078 if (mcd->md_parent == mcd->md_tgt) {
1079 redir_mstr_fwds(mcd);
1086 merge_cb_data_t mcd;
1096 mcd.md_parent = mstr;
1097 mcd.md_tgt = (tgt ? tgt : mstr);
1098 mcd.md_ta = alist_new(NULL, NULL);
1099 mcd.md_fdida = alist_new(NULL, NULL);
1100 mcd.md_flags = 0;
1103 mcd.md_flags |= MCD_F_SELFUNIQUIFY;
1105 mcd.md_flags |= MCD_F_REFMERGE;
1110 merge_types(cur->td_iihash, &mcd);
1114 alist_stats(mcd.md_ta, 0);
1116 hash_stats(mcd.md_tgt->td_layouthash, 1);
1119 alist_free(mcd.md_fdida);
1120 alist_free(mcd.md_ta);