FreeBSD/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
/*
 * Used for creating bitfield types.  We create a copy of an existing intrinsic,
 * adjusting the size of the copy to match what the caller requested.  The
 * caller can then use the copy as the type for a bitfield structure member.
 */
Used for creating bitfield types.  We create a copy of an existing intrinsic,
adjusting the size of the copy to match what the caller requested.  The
caller can then use the copy as the type for a bitfield structure member.
Used for creating bitfield types . We create a copy of an existing intrinsic adjusting the size of the copy to match what the caller requested . The caller can then use the copy as the type for a bitfield structure member .
static tdesc_t *
tdesc_intr_clone(dwarf_t *dw, tdesc_t *old, size_t bitsz)
{
	tdesc_t *new = xcalloc(sizeof (tdesc_t));
	if (!(old->t_flags & TDESC_F_RESOLVED)) {
		terminate("tdp %u: attempt to make a bit field from an "
		    "unresolved type\n", old->t_id);
	}
	new->t_name = xstrdup(old->t_name);
	new->t_size = old->t_size;
	new->t_id = mfgtid_next(dw);
	new->t_type = INTRINSIC;
	new->t_flags = TDESC_F_RESOLVED;
	new->t_intr = xcalloc(sizeof (intr_t));
	bcopy(old->t_intr, new->t_intr, sizeof (intr_t));
	new->t_intr->intr_nbits = bitsz;
	tdesc_add(dw, new);
	return (new);
}
static tdesc_t * tdesc_intr_clone ( dwarf_t * dw , tdesc_t * old , size_t bitsz ) { tdesc_t * new = xcalloc ( sizeof ( tdesc_t ) ) ; if ( ! ( old -> t_flags & TDESC_F_RESOLVED ) ) { terminate ( " " " \n " , old -> t_id ) ; } new -> t_name = xstrdup ( old -> t_name ) ; new -> t_size = old -> t_size ; new -> t_id = mfgtid_next ( dw ) ; new -> t_type = INTRINSIC ; new -> t_flags = TDESC_F_RESOLVED ; new -> t_intr = xcalloc ( sizeof ( intr_t ) ) ; bcopy ( old -> t_intr , new -> t_intr , sizeof ( intr_t ) ) ; new -> t_intr -> intr_nbits = bitsz ; tdesc_add ( dw , new ) ; return ( new ) ; }
Used for creating bitfield types.
Used for creating bitfield types .