Lines Matching defs:mcd

434 	merge_cb_data_t *mcd = private;
436 if (get_mapping(mcd->md_ta, ctdp->t_id) > 0)
446 merge_cb_data_t *mcd = private;
449 ed.ed_ta = mcd->md_ta;
450 ed.ed_clear_mark = mcd->md_parent->td_curemark;
451 ed.ed_cur_mark = mcd->md_parent->td_curemark + 1;
457 if (hash_find_iter(mcd->md_parent->td_layouthash, ctdp,
461 int id = mcd->md_tgt->td_nextid++;
464 add_mapping(mcd->md_ta, ctdp->t_id, id);
465 alist_add(mcd->md_fdida, (void *)(ulong_t)ed.ed_tgt,
467 hash_add(mcd->md_tdtba, ctdp);
469 add_mapping(mcd->md_ta, ctdp->t_id, ed.ed_tgt->t_id);
471 } else if (debug_level > 1 && hash_iter(mcd->md_parent->td_idhash,
482 int id = mcd->md_tgt->td_nextid++;
485 add_mapping(mcd->md_ta, ctdp->t_id, id);
486 hash_add(mcd->md_tdtba, ctdp);
489 mcd->md_parent->td_curemark = ed.ed_cur_mark + 1;
498 merge_cb_data_t *mcd = private;
501 ed.ed_ta = mcd->md_ta;
502 ed.ed_clear_mark = mcd->md_parent->td_curemark;
503 ed.ed_cur_mark = mcd->md_parent->td_curemark + 1;
508 if (hash_find_iter(mcd->md_tdtba, ctdp, equiv_cb, &ed) < 0) {
511 add_mapping(mcd->md_ta, ctdp->t_id,
512 get_mapping(mcd->md_ta, ed.ed_tgt->t_id));
513 } else if (debug_level > 1 && hash_iter(mcd->md_tdtba,
524 int id = mcd->md_tgt->td_nextid++;
527 add_mapping(mcd->md_ta, ctdp->t_id, id);
528 hash_add(mcd->md_tdtba, ctdp);
531 mcd->md_parent->td_curemark = ed.ed_cur_mark + 1;
656 merge_cb_data_t *mcd = arg;
660 post = (mcd->md_flags & MCD_F_SELFUNIQUIFY ? map_self_post : map_post);
663 (void) iitraverse(sii, &mcd->md_parent->td_curvgen, NULL, map_pre, post,
664 mcd);
668 iif.iif_ta = mcd->md_ta;
669 iif.iif_newidx = get_mapping(mcd->md_ta, sii->ii_dtype->t_id);
670 iif.iif_refmerge = (mcd->md_flags & MCD_F_REFMERGE);
672 if (hash_match(mcd->md_parent->td_iihash, sii, iidesc_match,
680 list_add(mcd->md_iitba, sii);
687 merge_cb_data_t *mcd)
698 if ((template.t_id = get_mapping(mcd->md_ta, oldid)) == 0)
701 if (!hash_find(mcd->md_parent->td_idhash, (void *)&template,
702 (void *)&tgt) && (!(mcd->md_flags & MCD_F_REFMERGE) ||
703 !hash_find(mcd->md_tgt->td_idhash, (void *)&template,
708 list_add(mcd->md_tdtbr, tgtp);
732 conjure_intrinsic(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
743 conjure_plain(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
747 (void) remap_node(&new->t_tdesc, old->t_tdesc, old->t_id, new, mcd);
753 conjure_function(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
760 (void) remap_node(&nfn->fn_ret, ofn->fn_ret, old->t_id, new, mcd);
770 new, mcd);
779 conjure_array(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
786 mcd);
788 mcd);
798 conjure_su(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
810 old->t_id, new, mcd);
819 conjure_enum(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
837 conjure_forward(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
841 list_add(&mcd->md_tgt->td_fwdlist, new);
848 conjure_assert(tdesc_t *old, int newselfid, merge_cb_data_t *mcd)
855 conjure_iidesc(iidesc_t *old, merge_cb_data_t *mcd)
860 (void) remap_node(&new->ii_dtype, old->ii_dtype, -1, NULL, mcd);
863 mcd);
932 redir_mstr_fwds(merge_cb_data_t *mcd)
937 rmd.rmd_tgt = mcd->md_tgt;
940 if (alist_iter(mcd->md_fdida, redir_mstr_fwd_cb, &rmd)) {
941 (void) iitraverse_hash(mcd->md_tgt->td_iihash,
942 &mcd->md_tgt->td_curvgen, fwd_redir_cbs, NULL, NULL, map);
951 merge_cb_data_t *mcd = private;
957 newidx = get_mapping(mcd->md_ta, tba->ii_dtype->t_id);
960 (void) list_remove(mcd->md_iitba, data, NULL, NULL);
963 iif.iif_ta = mcd->md_ta;
965 iif.iif_refmerge = (mcd->md_flags & MCD_F_REFMERGE);
967 if (hash_match(mcd->md_parent->td_iihash, tba, iidesc_match,
974 new = conjure_iidesc(tba, mcd);
975 hash_add(mcd->md_tgt->td_iihash, new);
981 add_tdesc(tdesc_t *oldtdp, int newid, merge_cb_data_t *mcd)
987 assert(hash_find(mcd->md_parent->td_idhash,
994 mcd)) == NULL)
1000 hash_add(mcd->md_tgt->td_idhash, newtdp);
1001 hash_add(mcd->md_tgt->td_layouthash, newtdp);
1010 merge_cb_data_t *mcd = arg;
1014 newid = get_mapping(mcd->md_ta, tdp->t_id);
1017 if ((rc = add_tdesc(tdp, newid, mcd)))
1018 hash_remove(mcd->md_tdtba, (void *)tdp);
1027 merge_cb_data_t *mcd = arg;
1031 if (!remap_node(tdpp, *tdpp, -1, NULL, mcd))
1034 (void) list_remove(mcd->md_tdtbr, (void *)tdpp, NULL, NULL);
1039 merge_types(hash_t *src, merge_cb_data_t *mcd)
1045 mcd->md_iitba = &iitba;
1046 mcd->md_tdtba = hash_new(TDATA_LAYOUT_HASH_SIZE, tdesc_layouthash,
1048 mcd->md_tdtbr = &tdtbr;
1050 (void) hash_iter(src, merge_type_cb, mcd);
1052 tdrc = hash_iter(mcd->md_tdtba, add_tdtba_cb, (void *)mcd);
1055 iirc = list_iter(*mcd->md_iitba, add_iitba_cb, (void *)mcd);
1058 assert(list_count(*mcd->md_iitba) == 0 &&
1059 hash_count(mcd->md_tdtba) == 0);
1061 tdrc = list_iter(*mcd->md_tdtbr, add_tdtbr_cb, (void *)mcd);
1064 if (list_count(*mcd->md_tdtbr) != 0)
1069 * definitions for those forwards in mcd->md_fdida. By this point,
1075 if (mcd->md_parent == mcd->md_tgt) {
1076 redir_mstr_fwds(mcd);
1083 merge_cb_data_t mcd;
1093 mcd.md_parent = mstr;
1094 mcd.md_tgt = (tgt ? tgt : mstr);
1095 mcd.md_ta = alist_new(NULL, NULL);
1096 mcd.md_fdida = alist_new(NULL, NULL);
1097 mcd.md_flags = 0;
1100 mcd.md_flags |= MCD_F_SELFUNIQUIFY;
1102 mcd.md_flags |= MCD_F_REFMERGE;
1107 merge_types(cur->td_iihash, &mcd);
1111 alist_stats(mcd.md_ta, 0);
1113 hash_stats(mcd.md_tgt->td_layouthash, 1);
1116 alist_free(mcd.md_fdida);
1117 alist_free(mcd.md_ta);