summaryrefslogtreecommitdiff
path: root/lib/libdtrace/common/dt_cg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libdtrace/common/dt_cg.c')
-rw-r--r--lib/libdtrace/common/dt_cg.c54
1 files changed, 4 insertions, 50 deletions
diff --git a/lib/libdtrace/common/dt_cg.c b/lib/libdtrace/common/dt_cg.c
index a33cccd676d29..4557c6f85cfad 100644
--- a/lib/libdtrace/common/dt_cg.c
+++ b/lib/libdtrace/common/dt_cg.c
@@ -267,7 +267,7 @@ dt_cg_field_get(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp,
* properties are used to compute shift as USHIFT or SSHIFT, below.
*/
if (dnp->dn_flags & DT_NF_SIGNED) {
-#if BYTE_ORDER == _BIG_ENDIAN
+#ifdef _BIG_ENDIAN
shift = clp2(P2ROUNDUP(e.cte_bits, NBBY) / NBBY) * NBBY -
mp->ctm_offset % NBBY;
#else
@@ -281,7 +281,7 @@ dt_cg_field_get(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp,
instr = DIF_INSTR_FMT(DIF_OP_SRA, r1, r2, r1);
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
} else {
-#if BYTE_ORDER == _BIG_ENDIAN
+#ifdef _BIG_ENDIAN
shift = clp2(P2ROUNDUP(e.cte_bits, NBBY) / NBBY) * NBBY -
(mp->ctm_offset % NBBY + e.cte_bits);
#else
@@ -369,7 +369,7 @@ dt_cg_field_set(dt_node_t *src, dt_irlist_t *dlp,
* input register to width cte_bits, and cmask as the mask used to
* pass through the containing bits and zero the field bits.
*/
-#if BYTE_ORDER == _BIG_ENDIAN
+#ifdef _BIG_ENDIAN
shift = clp2(P2ROUNDUP(e.cte_bits, NBBY) / NBBY) * NBBY -
(m.ctm_offset % NBBY + e.cte_bits);
#else
@@ -1339,40 +1339,6 @@ dt_cg_inline(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
}
static void
-dt_cg_func_typeref(dtrace_hdl_t *dtp, dt_node_t *dnp)
-{
- dtrace_typeinfo_t dtt;
- dt_node_t *addr = dnp->dn_args;
- dt_node_t *nelm = addr->dn_list;
- dt_node_t *strp = nelm->dn_list;
- dt_node_t *typs = strp->dn_list;
- char buf[DT_TYPE_NAMELEN];
- char *p;
-
- ctf_type_name(addr->dn_ctfp, addr->dn_type, buf, sizeof (buf));
-
- /*
- * XXX Hack alert! XXX
- * The prototype has two dummy args that we munge to represent
- * the type string and the type size.
- *
- * Yes, I hear your grumble, but it works for now. We'll come
- * up with a more elegant implementation later. :-)
- */
- free(strp->dn_string);
-
- if ((p = strchr(buf, '*')) != NULL)
- *p = '\0';
-
- strp->dn_string = strdup(buf);
-
- if (dtrace_lookup_by_type(dtp, DTRACE_OBJ_EVERY, buf, &dtt) < 0)
- return;
-
- typs->dn_value = ctf_type_size(dtt.dtt_ctfp, dtt.dtt_type);
-}
-
-static void
dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
{
ctf_file_t *ctfp = dnp->dn_ctfp;
@@ -1827,9 +1793,7 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
}
switch (dnp->dn_kind) {
- case DT_NODE_FUNC: {
- dtrace_hdl_t *dtp = yypcb->pcb_hdl;
-
+ case DT_NODE_FUNC:
if ((idp = dnp->dn_ident)->di_kind != DT_IDENT_FUNC) {
dnerror(dnp, D_CG_EXPR, "%s %s( ) may not be "
"called from a D expression (D program "
@@ -1837,15 +1801,6 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
dt_idkind_name(idp->di_kind), idp->di_name);
}
- switch (idp->di_id) {
- case DIF_SUBR_TYPEREF:
- dt_cg_func_typeref(dtp, dnp);
- break;
-
- default:
- break;
- }
-
dt_cg_arglist(dnp->dn_ident, dnp->dn_args, dlp, drp);
if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1)
@@ -1858,7 +1813,6 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
dt_cg_node_alloc(DT_LBL_NONE, instr));
break;
- }
case DT_NODE_VAR:
if (dnp->dn_ident->di_kind == DT_IDENT_XLSOU ||