Deleted Added
full compact
dt_parser.c (256281) dt_parser.c (268578)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 8 unchanged lines hidden (view full) ---

17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22
23/*
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 8 unchanged lines hidden (view full) ---

17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22
23/*
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Copyright (c) 2011, Joyent Inc. All rights reserved.
26 * Copyright (c) 2012 by Delphix. All rights reserved.
25 * Copyright (c) 2013, Joyent Inc. All rights reserved.
26 * Copyright (c) 2013 by Delphix. All rights reserved.
27 */
28
29#pragma ident "%Z%%M% %I% %E% SMI"
30
31/*
32 * DTrace D Language Parser
33 *
34 * The D Parser is a lex/yacc parser consisting of the lexer dt_lex.l, the

--- 157 unchanged lines hidden (view full) ---

192 }
193}
194
195int
196dt_type_lookup(const char *s, dtrace_typeinfo_t *tip)
197{
198 static const char delimiters[] = " \t\n\r\v\f*`";
199 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
27 */
28
29#pragma ident "%Z%%M% %I% %E% SMI"
30
31/*
32 * DTrace D Language Parser
33 *
34 * The D Parser is a lex/yacc parser consisting of the lexer dt_lex.l, the

--- 157 unchanged lines hidden (view full) ---

192 }
193}
194
195int
196dt_type_lookup(const char *s, dtrace_typeinfo_t *tip)
197{
198 static const char delimiters[] = " \t\n\r\v\f*`";
199 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
200 const char *p, *q, *end, *obj;
200 const char *p, *q, *r, *end, *obj;
201
202 for (p = s, end = s + strlen(s); *p != '\0'; p = q) {
203 while (isspace(*p))
204 p++; /* skip leading whitespace prior to token */
205
206 if (p == end || (q = strpbrk(p + 1, delimiters)) == NULL)
207 break; /* empty string or single token remaining */
208

--- 11 unchanged lines hidden (view full) ---

220 /*
221 * Copy the original string up to the start of this
222 * token (p) into type, and then concatenate everything
223 * after q. This is the type name without the object.
224 */
225 bcopy(s, type, (size_t)(p - s));
226 bcopy(q + 1, type + (size_t)(p - s), strlen(q + 1) + 1);
227
201
202 for (p = s, end = s + strlen(s); *p != '\0'; p = q) {
203 while (isspace(*p))
204 p++; /* skip leading whitespace prior to token */
205
206 if (p == end || (q = strpbrk(p + 1, delimiters)) == NULL)
207 break; /* empty string or single token remaining */
208

--- 11 unchanged lines hidden (view full) ---

220 /*
221 * Copy the original string up to the start of this
222 * token (p) into type, and then concatenate everything
223 * after q. This is the type name without the object.
224 */
225 bcopy(s, type, (size_t)(p - s));
226 bcopy(q + 1, type + (size_t)(p - s), strlen(q + 1) + 1);
227
228 if (strchr(q + 1, '`') != NULL)
229 return (dt_set_errno(dtp, EDT_BADSCOPE));
228 /*
229 * There may be at most three delimeters. The second
230 * delimeter is usually used to distinguish the type
231 * within a given module, however, there could be a link
232 * map id on the scene in which case that delimeter
233 * would be the third. We determine presence of the lmid
234 * if it rouglhly meets the from LM[0-9]
235 */
236 if ((r = strchr(q + 1, '`')) != NULL &&
237 ((r = strchr(r + 1, '`')) != NULL)) {
238 if (strchr(r + 1, '`') != NULL)
239 return (dt_set_errno(dtp,
240 EDT_BADSCOPE));
241 if (q[1] != 'L' || q[2] != 'M')
242 return (dt_set_errno(dtp,
243 EDT_BADSCOPE));
244 }
230
231 return (dtrace_lookup_by_type(dtp, object, type, tip));
232 }
233 }
234
235 if (yypcb->pcb_idepth != 0)
236 obj = DTRACE_OBJ_CDEFS;
237 else

--- 13 unchanged lines hidden (view full) ---

251 */
252int
253dt_type_pointer(dtrace_typeinfo_t *tip)
254{
255 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
256 ctf_file_t *ctfp = tip->dtt_ctfp;
257 ctf_id_t type = tip->dtt_type;
258 ctf_id_t base = ctf_type_resolve(ctfp, type);
245
246 return (dtrace_lookup_by_type(dtp, object, type, tip));
247 }
248 }
249
250 if (yypcb->pcb_idepth != 0)
251 obj = DTRACE_OBJ_CDEFS;
252 else

--- 13 unchanged lines hidden (view full) ---

266 */
267int
268dt_type_pointer(dtrace_typeinfo_t *tip)
269{
270 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
271 ctf_file_t *ctfp = tip->dtt_ctfp;
272 ctf_id_t type = tip->dtt_type;
273 ctf_id_t base = ctf_type_resolve(ctfp, type);
274 uint_t bflags = tip->dtt_flags;
259
260 dt_module_t *dmp;
261 ctf_id_t ptr;
262
263 if ((ptr = ctf_type_pointer(ctfp, type)) != CTF_ERR ||
264 (ptr = ctf_type_pointer(ctfp, base)) != CTF_ERR) {
265 tip->dtt_type = ptr;
266 return (0);

--- 15 unchanged lines hidden (view full) ---

282 if (ptr == CTF_ERR || ctf_update(dmp->dm_ctfp) == CTF_ERR) {
283 dtp->dt_ctferr = ctf_errno(dmp->dm_ctfp);
284 return (dt_set_errno(dtp, EDT_CTF));
285 }
286
287 tip->dtt_object = dmp->dm_name;
288 tip->dtt_ctfp = dmp->dm_ctfp;
289 tip->dtt_type = ptr;
275
276 dt_module_t *dmp;
277 ctf_id_t ptr;
278
279 if ((ptr = ctf_type_pointer(ctfp, type)) != CTF_ERR ||
280 (ptr = ctf_type_pointer(ctfp, base)) != CTF_ERR) {
281 tip->dtt_type = ptr;
282 return (0);

--- 15 unchanged lines hidden (view full) ---

298 if (ptr == CTF_ERR || ctf_update(dmp->dm_ctfp) == CTF_ERR) {
299 dtp->dt_ctferr = ctf_errno(dmp->dm_ctfp);
300 return (dt_set_errno(dtp, EDT_CTF));
301 }
302
303 tip->dtt_object = dmp->dm_name;
304 tip->dtt_ctfp = dmp->dm_ctfp;
305 tip->dtt_type = ptr;
306 tip->dtt_flags = bflags;
290
291 return (0);
292}
293
294const char *
295dt_type_name(ctf_file_t *ctfp, ctf_id_t type, char *buf, size_t len)
296{
297 dtrace_hdl_t *dtp = yypcb->pcb_hdl;

--- 87 unchanged lines hidden (view full) ---

385 *ofp = rfp;
386 *otype = rtype;
387}
388
389void
390dt_node_promote(dt_node_t *lp, dt_node_t *rp, dt_node_t *dnp)
391{
392 dt_type_promote(lp, rp, &dnp->dn_ctfp, &dnp->dn_type);
307
308 return (0);
309}
310
311const char *
312dt_type_name(ctf_file_t *ctfp, ctf_id_t type, char *buf, size_t len)
313{
314 dtrace_hdl_t *dtp = yypcb->pcb_hdl;

--- 87 unchanged lines hidden (view full) ---

402 *ofp = rfp;
403 *otype = rtype;
404}
405
406void
407dt_node_promote(dt_node_t *lp, dt_node_t *rp, dt_node_t *dnp)
408{
409 dt_type_promote(lp, rp, &dnp->dn_ctfp, &dnp->dn_type);
393 dt_node_type_assign(dnp, dnp->dn_ctfp, dnp->dn_type);
410 dt_node_type_assign(dnp, dnp->dn_ctfp, dnp->dn_type, B_FALSE);
394 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
395}
396
397const char *
398dt_node_name(const dt_node_t *dnp, char *buf, size_t len)
399{
400 char n1[DT_TYPE_NAMELEN];
401 char n2[DT_TYPE_NAMELEN];

--- 252 unchanged lines hidden (view full) ---

654 "predefined minimum\n", dt_node_name(dnp, s, sizeof (s)),
655 dtrace_attr2str(attr, a, sizeof (a)));
656 }
657
658 dnp->dn_attr = attr;
659}
660
661void
411 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
412}
413
414const char *
415dt_node_name(const dt_node_t *dnp, char *buf, size_t len)
416{
417 char n1[DT_TYPE_NAMELEN];
418 char n2[DT_TYPE_NAMELEN];

--- 252 unchanged lines hidden (view full) ---

671 "predefined minimum\n", dt_node_name(dnp, s, sizeof (s)),
672 dtrace_attr2str(attr, a, sizeof (a)));
673 }
674
675 dnp->dn_attr = attr;
676}
677
678void
662dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type)
679dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type,
680 boolean_t user)
663{
664 ctf_id_t base = ctf_type_resolve(fp, type);
665 uint_t kind = ctf_type_kind(fp, base);
666 ctf_encoding_t e;
667
668 dnp->dn_flags &=
669 ~(DT_NF_SIGNED | DT_NF_REF | DT_NF_BITFIELD | DT_NF_USERLAND);
670

--- 15 unchanged lines hidden (view full) ---

686 if (kind == CTF_K_STRUCT || kind == CTF_K_UNION ||
687 kind == CTF_K_FORWARD ||
688 kind == CTF_K_ARRAY || kind == CTF_K_FUNCTION)
689 dnp->dn_flags |= DT_NF_REF;
690 else if (yypcb != NULL && fp == DT_DYN_CTFP(yypcb->pcb_hdl) &&
691 type == DT_DYN_TYPE(yypcb->pcb_hdl))
692 dnp->dn_flags |= DT_NF_REF;
693
681{
682 ctf_id_t base = ctf_type_resolve(fp, type);
683 uint_t kind = ctf_type_kind(fp, base);
684 ctf_encoding_t e;
685
686 dnp->dn_flags &=
687 ~(DT_NF_SIGNED | DT_NF_REF | DT_NF_BITFIELD | DT_NF_USERLAND);
688

--- 15 unchanged lines hidden (view full) ---

704 if (kind == CTF_K_STRUCT || kind == CTF_K_UNION ||
705 kind == CTF_K_FORWARD ||
706 kind == CTF_K_ARRAY || kind == CTF_K_FUNCTION)
707 dnp->dn_flags |= DT_NF_REF;
708 else if (yypcb != NULL && fp == DT_DYN_CTFP(yypcb->pcb_hdl) &&
709 type == DT_DYN_TYPE(yypcb->pcb_hdl))
710 dnp->dn_flags |= DT_NF_REF;
711
712 if (user)
713 dnp->dn_flags |= DT_NF_USERLAND;
714
694 dnp->dn_flags |= DT_NF_COOKED;
695 dnp->dn_ctfp = fp;
696 dnp->dn_type = type;
697}
698
699void
700dt_node_type_propagate(const dt_node_t *src, dt_node_t *dst)
701{

--- 21 unchanged lines hidden (view full) ---

723
724 return (dt_type_name(dnp->dn_ctfp, dnp->dn_type, buf, len));
725}
726
727size_t
728dt_node_type_size(const dt_node_t *dnp)
729{
730 ctf_id_t base;
715 dnp->dn_flags |= DT_NF_COOKED;
716 dnp->dn_ctfp = fp;
717 dnp->dn_type = type;
718}
719
720void
721dt_node_type_propagate(const dt_node_t *src, dt_node_t *dst)
722{

--- 21 unchanged lines hidden (view full) ---

744
745 return (dt_type_name(dnp->dn_ctfp, dnp->dn_type, buf, len));
746}
747
748size_t
749dt_node_type_size(const dt_node_t *dnp)
750{
751 ctf_id_t base;
752 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
731
732 if (dnp->dn_kind == DT_NODE_STRING)
733 return (strlen(dnp->dn_string) + 1);
734
735 if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL)
736 return (dt_ident_size(dnp->dn_ident));
737
738 base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type);
739
740 if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD)
741 return (0);
742
753
754 if (dnp->dn_kind == DT_NODE_STRING)
755 return (strlen(dnp->dn_string) + 1);
756
757 if (dt_node_is_dynamic(dnp) && dnp->dn_ident != NULL)
758 return (dt_ident_size(dnp->dn_ident));
759
760 base = ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type);
761
762 if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_FORWARD)
763 return (0);
764
765 /*
766 * Here we have a 32-bit user pointer that is being used with a 64-bit
767 * kernel. When we're using it and its tagged as a userland reference --
768 * then we need to keep it as a 32-bit pointer. However, if we are
769 * referring to it as a kernel address, eg. being used after a copyin()
770 * then we need to make sure that we actually return the kernel's size
771 * of a pointer, 8 bytes.
772 */
773 if (ctf_type_kind(dnp->dn_ctfp, base) == CTF_K_POINTER &&
774 ctf_getmodel(dnp->dn_ctfp) == CTF_MODEL_ILP32 &&
775 !(dnp->dn_flags & DT_NF_USERLAND) &&
776 dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64)
777 return (8);
778
743 return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type));
744}
745
746/*
747 * Determine if the specified parse tree node references an identifier of the
748 * specified kind, and if so return a pointer to it; otherwise return NULL.
749 * This function resolves the identifier itself, following through any inlines.
750 */

--- 470 unchanged lines hidden (view full) ---

1221 else if (c == 'L' || c == 'l')
1222 i += 2;
1223 }
1224
1225 for (; i < sizeof (dtp->dt_ints) / sizeof (dtp->dt_ints[0]); i += n) {
1226 if (value <= dtp->dt_ints[i].did_limit) {
1227 dt_node_type_assign(dnp,
1228 dtp->dt_ints[i].did_ctfp,
779 return (ctf_type_size(dnp->dn_ctfp, dnp->dn_type));
780}
781
782/*
783 * Determine if the specified parse tree node references an identifier of the
784 * specified kind, and if so return a pointer to it; otherwise return NULL.
785 * This function resolves the identifier itself, following through any inlines.
786 */

--- 470 unchanged lines hidden (view full) ---

1257 else if (c == 'L' || c == 'l')
1258 i += 2;
1259 }
1260
1261 for (; i < sizeof (dtp->dt_ints) / sizeof (dtp->dt_ints[0]); i += n) {
1262 if (value <= dtp->dt_ints[i].did_limit) {
1263 dt_node_type_assign(dnp,
1264 dtp->dt_ints[i].did_ctfp,
1229 dtp->dt_ints[i].did_type);
1265 dtp->dt_ints[i].did_type, B_FALSE);
1230
1231 /*
1232 * If a prefix character is present in macro text, add
1233 * in the corresponding operator node (see dt_lex.l).
1234 */
1235 switch (yyintprefix) {
1236 case '+':
1237 return (dt_node_op1(DT_TOK_IPOS, dnp));

--- 18 unchanged lines hidden (view full) ---

1256 dt_node_t *dnp;
1257
1258 if (string == NULL)
1259 longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
1260
1261 dnp = dt_node_alloc(DT_NODE_STRING);
1262 dnp->dn_op = DT_TOK_STRING;
1263 dnp->dn_string = string;
1266
1267 /*
1268 * If a prefix character is present in macro text, add
1269 * in the corresponding operator node (see dt_lex.l).
1270 */
1271 switch (yyintprefix) {
1272 case '+':
1273 return (dt_node_op1(DT_TOK_IPOS, dnp));

--- 18 unchanged lines hidden (view full) ---

1292 dt_node_t *dnp;
1293
1294 if (string == NULL)
1295 longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
1296
1297 dnp = dt_node_alloc(DT_NODE_STRING);
1298 dnp->dn_op = DT_TOK_STRING;
1299 dnp->dn_string = string;
1264 dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp));
1300 dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp), B_FALSE);
1265
1266 return (dnp);
1267}
1268
1269dt_node_t *
1270dt_node_ident(char *name)
1271{
1272 dt_ident_t *idp;

--- 59 unchanged lines hidden (view full) ---

1332 if (err != 0) {
1333 free(name);
1334 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER);
1335 }
1336
1337 dnp = dt_node_alloc(DT_NODE_TYPE);
1338 dnp->dn_op = DT_TOK_IDENT;
1339 dnp->dn_string = name;
1301
1302 return (dnp);
1303}
1304
1305dt_node_t *
1306dt_node_ident(char *name)
1307{
1308 dt_ident_t *idp;

--- 59 unchanged lines hidden (view full) ---

1368 if (err != 0) {
1369 free(name);
1370 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER);
1371 }
1372
1373 dnp = dt_node_alloc(DT_NODE_TYPE);
1374 dnp->dn_op = DT_TOK_IDENT;
1375 dnp->dn_string = name;
1340 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
1341
1376
1377 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, dtt.dtt_flags);
1378
1342 if (dtt.dtt_ctfp == dtp->dt_cdefs->dm_ctfp ||
1343 dtt.dtt_ctfp == dtp->dt_ddefs->dm_ctfp)
1344 dt_node_attr_assign(dnp, _dtrace_defattr);
1345 else
1346 dt_node_attr_assign(dnp, _dtrace_typattr);
1347
1348 return (dnp);
1349}

--- 226 unchanged lines hidden (view full) ---

1576 * If the pre-existing ident has its di_type set, propagate
1577 * the type by hand so as not to trigger a prototype check for
1578 * arrays (yet); otherwise we use dt_ident_cook() on the ident
1579 * to ensure it is fully initialized before looking at it.
1580 */
1581 bzero(&idn, sizeof (dt_node_t));
1582
1583 if (idp != NULL && idp->di_type != CTF_ERR)
1379 if (dtt.dtt_ctfp == dtp->dt_cdefs->dm_ctfp ||
1380 dtt.dtt_ctfp == dtp->dt_ddefs->dm_ctfp)
1381 dt_node_attr_assign(dnp, _dtrace_defattr);
1382 else
1383 dt_node_attr_assign(dnp, _dtrace_typattr);
1384
1385 return (dnp);
1386}

--- 226 unchanged lines hidden (view full) ---

1613 * If the pre-existing ident has its di_type set, propagate
1614 * the type by hand so as not to trigger a prototype check for
1615 * arrays (yet); otherwise we use dt_ident_cook() on the ident
1616 * to ensure it is fully initialized before looking at it.
1617 */
1618 bzero(&idn, sizeof (dt_node_t));
1619
1620 if (idp != NULL && idp->di_type != CTF_ERR)
1584 dt_node_type_assign(&idn, idp->di_ctfp, idp->di_type);
1621 dt_node_type_assign(&idn, idp->di_ctfp, idp->di_type,
1622 B_FALSE);
1585 else if (idp != NULL)
1586 (void) dt_ident_cook(&idn, idp, NULL);
1587
1588 if (assc) {
1589 if (class == DT_DC_THIS) {
1590 xyerror(D_DECL_LOCASSC, "associative arrays "
1591 "may not be declared as local variables:"
1592 " %s\n", dsp->ds_ident);

--- 193 unchanged lines hidden (view full) ---

1786 }
1787
1788 if (ctf_member_info(dtt.dtt_ctfp, type, name, &ctm) == CTF_ERR) {
1789 xyerror(D_UNKNOWN, "failed to determine offset of %s: %s\n",
1790 name, ctf_errmsg(ctf_errno(dtt.dtt_ctfp)));
1791 }
1792
1793 bzero(&dn, sizeof (dn));
1623 else if (idp != NULL)
1624 (void) dt_ident_cook(&idn, idp, NULL);
1625
1626 if (assc) {
1627 if (class == DT_DC_THIS) {
1628 xyerror(D_DECL_LOCASSC, "associative arrays "
1629 "may not be declared as local variables:"
1630 " %s\n", dsp->ds_ident);

--- 193 unchanged lines hidden (view full) ---

1824 }
1825
1826 if (ctf_member_info(dtt.dtt_ctfp, type, name, &ctm) == CTF_ERR) {
1827 xyerror(D_UNKNOWN, "failed to determine offset of %s: %s\n",
1828 name, ctf_errmsg(ctf_errno(dtt.dtt_ctfp)));
1829 }
1830
1831 bzero(&dn, sizeof (dn));
1794 dt_node_type_assign(&dn, dtt.dtt_ctfp, ctm.ctm_type);
1832 dt_node_type_assign(&dn, dtt.dtt_ctfp, ctm.ctm_type, B_FALSE);
1795
1796 if (dn.dn_flags & DT_NF_BITFIELD) {
1797 xyerror(D_OFFSETOF_BITFIELD,
1798 "cannot take offset of a bit-field: %s\n", name);
1799 }
1800
1801 return (dt_node_int(ctm.ctm_offset / NBBY));
1802}

--- 39 unchanged lines hidden (view full) ---

1842 size_t size = dt_node_type_size(cp);
1843
1844 if (size == 0) {
1845 xyerror(D_SIZEOF_TYPE, "cannot apply sizeof to an "
1846 "operand of unknown size\n");
1847 }
1848
1849 dt_node_type_assign(cp, dtp->dt_ddefs->dm_ctfp,
1833
1834 if (dn.dn_flags & DT_NF_BITFIELD) {
1835 xyerror(D_OFFSETOF_BITFIELD,
1836 "cannot take offset of a bit-field: %s\n", name);
1837 }
1838
1839 return (dt_node_int(ctm.ctm_offset / NBBY));
1840}

--- 39 unchanged lines hidden (view full) ---

1880 size_t size = dt_node_type_size(cp);
1881
1882 if (size == 0) {
1883 xyerror(D_SIZEOF_TYPE, "cannot apply sizeof to an "
1884 "operand of unknown size\n");
1885 }
1886
1887 dt_node_type_assign(cp, dtp->dt_ddefs->dm_ctfp,
1850 ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"));
1888 ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"),
1889 B_FALSE);
1851
1852 cp->dn_kind = DT_NODE_INT;
1853 cp->dn_op = DT_TOK_INT;
1854 cp->dn_value = size;
1855
1856 return (cp);
1857 }
1858

--- 61 unchanged lines hidden (view full) ---

1920 uintmax_t r = rp->dn_value;
1921
1922 dnp = dt_node_int(0); /* allocate new integer node for result */
1923
1924 switch (op) {
1925 case DT_TOK_LOR:
1926 dnp->dn_value = l || r;
1927 dt_node_type_assign(dnp,
1890
1891 cp->dn_kind = DT_NODE_INT;
1892 cp->dn_op = DT_TOK_INT;
1893 cp->dn_value = size;
1894
1895 return (cp);
1896 }
1897

--- 61 unchanged lines hidden (view full) ---

1959 uintmax_t r = rp->dn_value;
1960
1961 dnp = dt_node_int(0); /* allocate new integer node for result */
1962
1963 switch (op) {
1964 case DT_TOK_LOR:
1965 dnp->dn_value = l || r;
1966 dt_node_type_assign(dnp,
1928 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
1967 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1929 break;
1930 case DT_TOK_LXOR:
1931 dnp->dn_value = (l != 0) ^ (r != 0);
1932 dt_node_type_assign(dnp,
1968 break;
1969 case DT_TOK_LXOR:
1970 dnp->dn_value = (l != 0) ^ (r != 0);
1971 dt_node_type_assign(dnp,
1933 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
1972 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1934 break;
1935 case DT_TOK_LAND:
1936 dnp->dn_value = l && r;
1937 dt_node_type_assign(dnp,
1973 break;
1974 case DT_TOK_LAND:
1975 dnp->dn_value = l && r;
1976 dt_node_type_assign(dnp,
1938 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
1977 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1939 break;
1940 case DT_TOK_BOR:
1941 dnp->dn_value = l | r;
1942 dt_node_promote(lp, rp, dnp);
1943 break;
1944 case DT_TOK_XOR:
1945 dnp->dn_value = l ^ r;
1946 dt_node_promote(lp, rp, dnp);
1947 break;
1948 case DT_TOK_BAND:
1949 dnp->dn_value = l & r;
1950 dt_node_promote(lp, rp, dnp);
1951 break;
1952 case DT_TOK_EQU:
1953 dnp->dn_value = l == r;
1954 dt_node_type_assign(dnp,
1978 break;
1979 case DT_TOK_BOR:
1980 dnp->dn_value = l | r;
1981 dt_node_promote(lp, rp, dnp);
1982 break;
1983 case DT_TOK_XOR:
1984 dnp->dn_value = l ^ r;
1985 dt_node_promote(lp, rp, dnp);
1986 break;
1987 case DT_TOK_BAND:
1988 dnp->dn_value = l & r;
1989 dt_node_promote(lp, rp, dnp);
1990 break;
1991 case DT_TOK_EQU:
1992 dnp->dn_value = l == r;
1993 dt_node_type_assign(dnp,
1955 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
1994 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1956 break;
1957 case DT_TOK_NEQ:
1958 dnp->dn_value = l != r;
1959 dt_node_type_assign(dnp,
1995 break;
1996 case DT_TOK_NEQ:
1997 dnp->dn_value = l != r;
1998 dt_node_type_assign(dnp,
1960 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
1999 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1961 break;
1962 case DT_TOK_LT:
1963 dt_node_promote(lp, rp, dnp);
1964 if (dnp->dn_flags & DT_NF_SIGNED)
1965 dnp->dn_value = (intmax_t)l < (intmax_t)r;
1966 else
1967 dnp->dn_value = l < r;
1968 dt_node_type_assign(dnp,
2000 break;
2001 case DT_TOK_LT:
2002 dt_node_promote(lp, rp, dnp);
2003 if (dnp->dn_flags & DT_NF_SIGNED)
2004 dnp->dn_value = (intmax_t)l < (intmax_t)r;
2005 else
2006 dnp->dn_value = l < r;
2007 dt_node_type_assign(dnp,
1969 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
2008 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1970 break;
1971 case DT_TOK_LE:
1972 dt_node_promote(lp, rp, dnp);
1973 if (dnp->dn_flags & DT_NF_SIGNED)
1974 dnp->dn_value = (intmax_t)l <= (intmax_t)r;
1975 else
1976 dnp->dn_value = l <= r;
1977 dt_node_type_assign(dnp,
2009 break;
2010 case DT_TOK_LE:
2011 dt_node_promote(lp, rp, dnp);
2012 if (dnp->dn_flags & DT_NF_SIGNED)
2013 dnp->dn_value = (intmax_t)l <= (intmax_t)r;
2014 else
2015 dnp->dn_value = l <= r;
2016 dt_node_type_assign(dnp,
1978 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
2017 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1979 break;
1980 case DT_TOK_GT:
1981 dt_node_promote(lp, rp, dnp);
1982 if (dnp->dn_flags & DT_NF_SIGNED)
1983 dnp->dn_value = (intmax_t)l > (intmax_t)r;
1984 else
1985 dnp->dn_value = l > r;
1986 dt_node_type_assign(dnp,
2018 break;
2019 case DT_TOK_GT:
2020 dt_node_promote(lp, rp, dnp);
2021 if (dnp->dn_flags & DT_NF_SIGNED)
2022 dnp->dn_value = (intmax_t)l > (intmax_t)r;
2023 else
2024 dnp->dn_value = l > r;
2025 dt_node_type_assign(dnp,
1987 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
2026 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1988 break;
1989 case DT_TOK_GE:
1990 dt_node_promote(lp, rp, dnp);
1991 if (dnp->dn_flags & DT_NF_SIGNED)
1992 dnp->dn_value = (intmax_t)l >= (intmax_t)r;
1993 else
1994 dnp->dn_value = l >= r;
1995 dt_node_type_assign(dnp,
2027 break;
2028 case DT_TOK_GE:
2029 dt_node_promote(lp, rp, dnp);
2030 if (dnp->dn_flags & DT_NF_SIGNED)
2031 dnp->dn_value = (intmax_t)l >= (intmax_t)r;
2032 else
2033 dnp->dn_value = l >= r;
2034 dt_node_type_assign(dnp,
1996 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
2035 DT_INT_CTFP(dtp), DT_INT_TYPE(dtp), B_FALSE);
1997 break;
1998 case DT_TOK_LSH:
1999 dnp->dn_value = l << r;
2000 dt_node_type_propagate(lp, dnp);
2001 dt_node_attr_assign(rp,
2002 dt_attr_min(lp->dn_attr, rp->dn_attr));
2003 break;
2004 case DT_TOK_RSH:

--- 224 unchanged lines hidden (view full) ---

2229 }
2230
2231 /*
2232 * If the inline identifier is not defined, then create it with the
2233 * orphan flag set. We do not insert the identifier into dt_globals
2234 * until we have successfully cooked the right-hand expression, below.
2235 */
2236 dnp = dt_node_alloc(DT_NODE_INLINE);
2036 break;
2037 case DT_TOK_LSH:
2038 dnp->dn_value = l << r;
2039 dt_node_type_propagate(lp, dnp);
2040 dt_node_attr_assign(rp,
2041 dt_attr_min(lp->dn_attr, rp->dn_attr));
2042 break;
2043 case DT_TOK_RSH:

--- 224 unchanged lines hidden (view full) ---

2268 }
2269
2270 /*
2271 * If the inline identifier is not defined, then create it with the
2272 * orphan flag set. We do not insert the identifier into dt_globals
2273 * until we have successfully cooked the right-hand expression, below.
2274 */
2275 dnp = dt_node_alloc(DT_NODE_INLINE);
2237 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
2276 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
2238 dt_node_attr_assign(dnp, _dtrace_defattr);
2239
2240 if (dt_node_is_void(dnp)) {
2241 xyerror(D_DECL_VOIDOBJ,
2242 "cannot declare void inline: %s\n", dsp->ds_ident);
2243 }
2244
2245 if (ctf_type_kind(dnp->dn_ctfp, ctf_type_resolve(

--- 138 unchanged lines hidden (view full) ---

2384 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER);
2385 }
2386
2387 dnp = dt_node_alloc(DT_NODE_MEMBER);
2388 dnp->dn_membname = name;
2389 dnp->dn_membexpr = expr;
2390
2391 if (ddp != NULL)
2277 dt_node_attr_assign(dnp, _dtrace_defattr);
2278
2279 if (dt_node_is_void(dnp)) {
2280 xyerror(D_DECL_VOIDOBJ,
2281 "cannot declare void inline: %s\n", dsp->ds_ident);
2282 }
2283
2284 if (ctf_type_kind(dnp->dn_ctfp, ctf_type_resolve(

--- 138 unchanged lines hidden (view full) ---

2423 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER);
2424 }
2425
2426 dnp = dt_node_alloc(DT_NODE_MEMBER);
2427 dnp->dn_membname = name;
2428 dnp->dn_membexpr = expr;
2429
2430 if (ddp != NULL)
2392 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
2431 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
2432 dtt.dtt_flags);
2393
2394 return (dnp);
2395}
2396
2397dt_node_t *
2398dt_node_xlator(dt_decl_t *ddp, dt_decl_t *sdp, char *name, dt_node_t *members)
2399{
2400 dtrace_hdl_t *dtp = yypcb->pcb_hdl;

--- 14 unchanged lines hidden (view full) ---

2415 dt_decl_free(sdp);
2416
2417 if (edst != 0 || esrc != 0) {
2418 free(name);
2419 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER);
2420 }
2421
2422 bzero(&sn, sizeof (sn));
2433
2434 return (dnp);
2435}
2436
2437dt_node_t *
2438dt_node_xlator(dt_decl_t *ddp, dt_decl_t *sdp, char *name, dt_node_t *members)
2439{
2440 dtrace_hdl_t *dtp = yypcb->pcb_hdl;

--- 14 unchanged lines hidden (view full) ---

2455 dt_decl_free(sdp);
2456
2457 if (edst != 0 || esrc != 0) {
2458 free(name);
2459 longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER);
2460 }
2461
2462 bzero(&sn, sizeof (sn));
2423 dt_node_type_assign(&sn, src.dtt_ctfp, src.dtt_type);
2463 dt_node_type_assign(&sn, src.dtt_ctfp, src.dtt_type, B_FALSE);
2424
2425 bzero(&dn, sizeof (dn));
2464
2465 bzero(&dn, sizeof (dn));
2426 dt_node_type_assign(&dn, dst.dtt_ctfp, dst.dtt_type);
2466 dt_node_type_assign(&dn, dst.dtt_ctfp, dst.dtt_type, B_FALSE);
2427
2428 if (dt_xlator_lookup(dtp, &sn, &dn, DT_XLATE_EXACT) != NULL) {
2429 xyerror(D_XLATE_REDECL,
2430 "translator from %s to %s has already been declared\n",
2431 dt_node_type_name(&sn, n1, sizeof (n1)),
2432 dt_node_type_name(&dn, n2, sizeof (n2)));
2433 }
2434

--- 229 unchanged lines hidden (view full) ---

2664 * have dynamic types and must be referenced using operator [].
2665 * This is handled explicitly by the code for DT_TOK_LBRAC.
2666 */
2667 if (idp->di_kind != DT_IDENT_ARRAY &&
2668 idp->di_kind != DT_IDENT_AGG)
2669 attr = dt_ident_cook(dnp, idp, NULL);
2670 else {
2671 dt_node_type_assign(dnp,
2467
2468 if (dt_xlator_lookup(dtp, &sn, &dn, DT_XLATE_EXACT) != NULL) {
2469 xyerror(D_XLATE_REDECL,
2470 "translator from %s to %s has already been declared\n",
2471 dt_node_type_name(&sn, n1, sizeof (n1)),
2472 dt_node_type_name(&dn, n2, sizeof (n2)));
2473 }
2474

--- 229 unchanged lines hidden (view full) ---

2704 * have dynamic types and must be referenced using operator [].
2705 * This is handled explicitly by the code for DT_TOK_LBRAC.
2706 */
2707 if (idp->di_kind != DT_IDENT_ARRAY &&
2708 idp->di_kind != DT_IDENT_AGG)
2709 attr = dt_ident_cook(dnp, idp, NULL);
2710 else {
2711 dt_node_type_assign(dnp,
2672 DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
2712 DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
2673 attr = idp->di_attr;
2674 }
2675
2676 free(dnp->dn_string);
2677 dnp->dn_string = NULL;
2678 dnp->dn_kind = dnkind;
2679 dnp->dn_ident = idp;
2680 dnp->dn_flags |= DT_NF_LVALUE;

--- 59 unchanged lines hidden (view full) ---

2740 idp->di_type = dtt.dtt_type;
2741
2742 free(dnp->dn_string);
2743 dnp->dn_string = NULL;
2744 dnp->dn_kind = DT_NODE_SYM;
2745 dnp->dn_ident = idp;
2746 dnp->dn_flags |= DT_NF_LVALUE;
2747
2713 attr = idp->di_attr;
2714 }
2715
2716 free(dnp->dn_string);
2717 dnp->dn_string = NULL;
2718 dnp->dn_kind = dnkind;
2719 dnp->dn_ident = idp;
2720 dnp->dn_flags |= DT_NF_LVALUE;

--- 59 unchanged lines hidden (view full) ---

2780 idp->di_type = dtt.dtt_type;
2781
2782 free(dnp->dn_string);
2783 dnp->dn_string = NULL;
2784 dnp->dn_kind = DT_NODE_SYM;
2785 dnp->dn_ident = idp;
2786 dnp->dn_flags |= DT_NF_LVALUE;
2787
2748 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
2788 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
2789 dtt.dtt_flags);
2749 dt_node_attr_assign(dnp, _dtrace_symattr);
2750
2751 if (uref) {
2752 idp->di_flags |= DT_IDFLG_USER;
2753 dnp->dn_flags |= DT_NF_USERLAND;
2754 }
2755
2756 } else if (scope == DTRACE_OBJ_EXEC && create == B_TRUE) {

--- 31 unchanged lines hidden (view full) ---

2788 * have dynamic types and must be referenced using operator [].
2789 * This is handled explicitly by the code for DT_TOK_LBRAC.
2790 */
2791 if (idp->di_kind != DT_IDENT_ARRAY &&
2792 idp->di_kind != DT_IDENT_AGG)
2793 attr = dt_ident_cook(dnp, idp, NULL);
2794 else {
2795 dt_node_type_assign(dnp,
2790 dt_node_attr_assign(dnp, _dtrace_symattr);
2791
2792 if (uref) {
2793 idp->di_flags |= DT_IDFLG_USER;
2794 dnp->dn_flags |= DT_NF_USERLAND;
2795 }
2796
2797 } else if (scope == DTRACE_OBJ_EXEC && create == B_TRUE) {

--- 31 unchanged lines hidden (view full) ---

2829 * have dynamic types and must be referenced using operator [].
2830 * This is handled explicitly by the code for DT_TOK_LBRAC.
2831 */
2832 if (idp->di_kind != DT_IDENT_ARRAY &&
2833 idp->di_kind != DT_IDENT_AGG)
2834 attr = dt_ident_cook(dnp, idp, NULL);
2835 else {
2836 dt_node_type_assign(dnp,
2796 DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
2837 DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
2797 attr = idp->di_attr;
2798 }
2799
2800 free(dnp->dn_string);
2801 dnp->dn_string = NULL;
2802 dnp->dn_kind = dnkind;
2803 dnp->dn_ident = idp;
2804 dnp->dn_flags |= DT_NF_LVALUE | DT_NF_WRITABLE;

--- 86 unchanged lines hidden (view full) ---

2891
2892 cp = dnp->dn_child = dt_node_cook(cp, 0); /* don't set idflags yet */
2893
2894 if (cp->dn_kind == DT_NODE_VAR && dt_ident_unref(cp->dn_ident)) {
2895 if (dt_type_lookup("int64_t", &dtt) != 0)
2896 xyerror(D_TYPE_ERR, "failed to lookup int64_t\n");
2897
2898 dt_ident_type_assign(cp->dn_ident, dtt.dtt_ctfp, dtt.dtt_type);
2838 attr = idp->di_attr;
2839 }
2840
2841 free(dnp->dn_string);
2842 dnp->dn_string = NULL;
2843 dnp->dn_kind = dnkind;
2844 dnp->dn_ident = idp;
2845 dnp->dn_flags |= DT_NF_LVALUE | DT_NF_WRITABLE;

--- 86 unchanged lines hidden (view full) ---

2932
2933 cp = dnp->dn_child = dt_node_cook(cp, 0); /* don't set idflags yet */
2934
2935 if (cp->dn_kind == DT_NODE_VAR && dt_ident_unref(cp->dn_ident)) {
2936 if (dt_type_lookup("int64_t", &dtt) != 0)
2937 xyerror(D_TYPE_ERR, "failed to lookup int64_t\n");
2938
2939 dt_ident_type_assign(cp->dn_ident, dtt.dtt_ctfp, dtt.dtt_type);
2899 dt_node_type_assign(cp, dtt.dtt_ctfp, dtt.dtt_type);
2940 dt_node_type_assign(cp, dtt.dtt_ctfp, dtt.dtt_type,
2941 dtt.dtt_flags);
2900 }
2901
2902 if (cp->dn_kind == DT_NODE_VAR)
2903 cp->dn_ident->di_flags |= idflags;
2904
2905 switch (dnp->dn_op) {
2906 case DT_TOK_DEREF:
2907 /*
2908 * If the deref operator is applied to a translated pointer,
2909 * we set our output type to the output of the translation.
2910 */
2911 if ((idp = dt_node_resolve(cp, DT_IDENT_XLPTR)) != NULL) {
2912 dt_xlator_t *dxp = idp->di_data;
2913
2914 dnp->dn_ident = &dxp->dx_souid;
2915 dt_node_type_assign(dnp,
2942 }
2943
2944 if (cp->dn_kind == DT_NODE_VAR)
2945 cp->dn_ident->di_flags |= idflags;
2946
2947 switch (dnp->dn_op) {
2948 case DT_TOK_DEREF:
2949 /*
2950 * If the deref operator is applied to a translated pointer,
2951 * we set our output type to the output of the translation.
2952 */
2953 if ((idp = dt_node_resolve(cp, DT_IDENT_XLPTR)) != NULL) {
2954 dt_xlator_t *dxp = idp->di_data;
2955
2956 dnp->dn_ident = &dxp->dx_souid;
2957 dt_node_type_assign(dnp,
2916 dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type);
2958 dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type,
2959 cp->dn_flags & DT_NF_USERLAND);
2917 break;
2918 }
2919
2920 type = ctf_type_resolve(cp->dn_ctfp, cp->dn_type);
2921 kind = ctf_type_kind(cp->dn_ctfp, type);
2922
2923 if (kind == CTF_K_ARRAY) {
2924 if (ctf_array_info(cp->dn_ctfp, type, &r) != 0) {
2925 dtp->dt_ctferr = ctf_errno(cp->dn_ctfp);
2926 longjmp(yypcb->pcb_jmpbuf, EDT_CTF);
2927 } else
2928 type = r.ctr_contents;
2929 } else if (kind == CTF_K_POINTER) {
2930 type = ctf_type_reference(cp->dn_ctfp, type);
2931 } else {
2932 xyerror(D_DEREF_NONPTR,
2933 "cannot dereference non-pointer type\n");
2934 }
2935
2960 break;
2961 }
2962
2963 type = ctf_type_resolve(cp->dn_ctfp, cp->dn_type);
2964 kind = ctf_type_kind(cp->dn_ctfp, type);
2965
2966 if (kind == CTF_K_ARRAY) {
2967 if (ctf_array_info(cp->dn_ctfp, type, &r) != 0) {
2968 dtp->dt_ctferr = ctf_errno(cp->dn_ctfp);
2969 longjmp(yypcb->pcb_jmpbuf, EDT_CTF);
2970 } else
2971 type = r.ctr_contents;
2972 } else if (kind == CTF_K_POINTER) {
2973 type = ctf_type_reference(cp->dn_ctfp, type);
2974 } else {
2975 xyerror(D_DEREF_NONPTR,
2976 "cannot dereference non-pointer type\n");
2977 }
2978
2936 dt_node_type_assign(dnp, cp->dn_ctfp, type);
2979 dt_node_type_assign(dnp, cp->dn_ctfp, type,
2980 cp->dn_flags & DT_NF_USERLAND);
2937 base = ctf_type_resolve(cp->dn_ctfp, type);
2938 kind = ctf_type_kind(cp->dn_ctfp, base);
2939
2940 if (kind == CTF_K_INTEGER && ctf_type_encoding(cp->dn_ctfp,
2941 base, &e) == 0 && IS_VOID(e)) {
2942 xyerror(D_DEREF_VOID,
2943 "cannot dereference pointer to void\n");
2944 }

--- 40 unchanged lines hidden (view full) ---

2985 dt_node_type_propagate(cp, dnp); /* see K&R[A7.4.4-6] */
2986 break;
2987
2988 case DT_TOK_LNEG:
2989 if (!dt_node_is_scalar(cp)) {
2990 xyerror(D_OP_SCALAR, "operator %s requires an operand "
2991 "of scalar type\n", opstr(dnp->dn_op));
2992 }
2981 base = ctf_type_resolve(cp->dn_ctfp, type);
2982 kind = ctf_type_kind(cp->dn_ctfp, base);
2983
2984 if (kind == CTF_K_INTEGER && ctf_type_encoding(cp->dn_ctfp,
2985 base, &e) == 0 && IS_VOID(e)) {
2986 xyerror(D_DEREF_VOID,
2987 "cannot dereference pointer to void\n");
2988 }

--- 40 unchanged lines hidden (view full) ---

3029 dt_node_type_propagate(cp, dnp); /* see K&R[A7.4.4-6] */
3030 break;
3031
3032 case DT_TOK_LNEG:
3033 if (!dt_node_is_scalar(cp)) {
3034 xyerror(D_OP_SCALAR, "operator %s requires an operand "
3035 "of scalar type\n", opstr(dnp->dn_op));
3036 }
2993 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
3037 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
3038 B_FALSE);
2994 break;
2995
2996 case DT_TOK_ADDROF:
2997 if (cp->dn_kind == DT_NODE_VAR || cp->dn_kind == DT_NODE_AGG) {
2998 xyerror(D_ADDROF_VAR,
2999 "cannot take address of dynamic variable\n");
3000 }
3001

--- 16 unchanged lines hidden (view full) ---

3018 dtt.dtt_ctfp = cp->dn_ctfp;
3019 dtt.dtt_type = cp->dn_type;
3020
3021 if (dt_type_pointer(&dtt) == -1) {
3022 xyerror(D_TYPE_ERR, "cannot find type for \"&\": %s*\n",
3023 dt_node_type_name(cp, n, sizeof (n)));
3024 }
3025
3039 break;
3040
3041 case DT_TOK_ADDROF:
3042 if (cp->dn_kind == DT_NODE_VAR || cp->dn_kind == DT_NODE_AGG) {
3043 xyerror(D_ADDROF_VAR,
3044 "cannot take address of dynamic variable\n");
3045 }
3046

--- 16 unchanged lines hidden (view full) ---

3063 dtt.dtt_ctfp = cp->dn_ctfp;
3064 dtt.dtt_type = cp->dn_type;
3065
3066 if (dt_type_pointer(&dtt) == -1) {
3067 xyerror(D_TYPE_ERR, "cannot find type for \"&\": %s*\n",
3068 dt_node_type_name(cp, n, sizeof (n)));
3069 }
3070
3026 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type);
3027
3028 if (cp->dn_flags & DT_NF_USERLAND)
3029 dnp->dn_flags |= DT_NF_USERLAND;
3071 dt_node_type_assign(dnp, dtt.dtt_ctfp, dtt.dtt_type,
3072 cp->dn_flags & DT_NF_USERLAND);
3030 break;
3031
3032 case DT_TOK_SIZEOF:
3033 if (cp->dn_flags & DT_NF_BITFIELD) {
3034 xyerror(D_SIZEOF_BITFIELD,
3035 "cannot apply sizeof to a bit-field\n");
3036 }
3037
3038 if (dt_node_sizeof(cp) == 0) {
3039 xyerror(D_SIZEOF_TYPE, "cannot apply sizeof to an "
3040 "operand of unknown size\n");
3041 }
3042
3043 dt_node_type_assign(dnp, dtp->dt_ddefs->dm_ctfp,
3073 break;
3074
3075 case DT_TOK_SIZEOF:
3076 if (cp->dn_flags & DT_NF_BITFIELD) {
3077 xyerror(D_SIZEOF_BITFIELD,
3078 "cannot apply sizeof to a bit-field\n");
3079 }
3080
3081 if (dt_node_sizeof(cp) == 0) {
3082 xyerror(D_SIZEOF_TYPE, "cannot apply sizeof to an "
3083 "operand of unknown size\n");
3084 }
3085
3086 dt_node_type_assign(dnp, dtp->dt_ddefs->dm_ctfp,
3044 ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"));
3087 ctf_lookup_by_name(dtp->dt_ddefs->dm_ctfp, "size_t"),
3088 B_FALSE);
3045 break;
3046
3047 case DT_TOK_STRINGOF:
3048 if (!dt_node_is_scalar(cp) && !dt_node_is_pointer(cp) &&
3049 !dt_node_is_strcompat(cp)) {
3050 xyerror(D_STRINGOF_TYPE,
3051 "cannot apply stringof to a value of type %s\n",
3052 dt_node_type_name(cp, n, sizeof (n)));
3053 }
3089 break;
3090
3091 case DT_TOK_STRINGOF:
3092 if (!dt_node_is_scalar(cp) && !dt_node_is_pointer(cp) &&
3093 !dt_node_is_strcompat(cp)) {
3094 xyerror(D_STRINGOF_TYPE,
3095 "cannot apply stringof to a value of type %s\n",
3096 dt_node_type_name(cp, n, sizeof (n)));
3097 }
3054 dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp));
3098 dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp),
3099 cp->dn_flags & DT_NF_USERLAND);
3055 break;
3056
3057 case DT_TOK_PREINC:
3058 case DT_TOK_POSTINC:
3059 case DT_TOK_PREDEC:
3060 case DT_TOK_POSTDEC:
3061 if (dt_node_is_scalar(cp) == 0) {
3062 xyerror(D_OP_SCALAR, "operator %s requires operand of "

--- 176 unchanged lines hidden (view full) ---

3239 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3240 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3241
3242 if (!dt_node_is_scalar(lp) || !dt_node_is_scalar(rp)) {
3243 xyerror(D_OP_SCALAR, "operator %s requires operands "
3244 "of scalar type\n", opstr(op));
3245 }
3246
3100 break;
3101
3102 case DT_TOK_PREINC:
3103 case DT_TOK_POSTINC:
3104 case DT_TOK_PREDEC:
3105 case DT_TOK_POSTDEC:
3106 if (dt_node_is_scalar(cp) == 0) {
3107 xyerror(D_OP_SCALAR, "operator %s requires operand of "

--- 176 unchanged lines hidden (view full) ---

3284 lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF);
3285 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3286
3287 if (!dt_node_is_scalar(lp) || !dt_node_is_scalar(rp)) {
3288 xyerror(D_OP_SCALAR, "operator %s requires operands "
3289 "of scalar type\n", opstr(op));
3290 }
3291
3247 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
3292 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
3293 B_FALSE);
3248 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3249 break;
3250
3251 case DT_TOK_LT:
3252 case DT_TOK_LE:
3253 case DT_TOK_GT:
3254 case DT_TOK_GE:
3255 case DT_TOK_EQU:

--- 27 unchanged lines hidden (view full) ---

3283
3284 free(rp->dn_string);
3285 rp->dn_string = NULL;
3286 rp->dn_kind = DT_NODE_INT;
3287 rp->dn_flags |= DT_NF_COOKED;
3288 rp->dn_op = DT_TOK_INT;
3289 rp->dn_value = (intmax_t)val;
3290
3294 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3295 break;
3296
3297 case DT_TOK_LT:
3298 case DT_TOK_LE:
3299 case DT_TOK_GT:
3300 case DT_TOK_GE:
3301 case DT_TOK_EQU:

--- 27 unchanged lines hidden (view full) ---

3329
3330 free(rp->dn_string);
3331 rp->dn_string = NULL;
3332 rp->dn_kind = DT_NODE_INT;
3333 rp->dn_flags |= DT_NF_COOKED;
3334 rp->dn_op = DT_TOK_INT;
3335 rp->dn_value = (intmax_t)val;
3336
3291 dt_node_type_assign(rp, lp->dn_ctfp, lp->dn_type);
3337 dt_node_type_assign(rp, lp->dn_ctfp, lp->dn_type,
3338 B_FALSE);
3292 dt_node_attr_assign(rp, _dtrace_symattr);
3293 }
3294
3295 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3296
3297 /*
3298 * The rules for type checking for the relational operators are
3299 * described in the ANSI-C spec (see K&R[A7.9-10]). We perform

--- 15 unchanged lines hidden (view full) ---

3315 /*EMPTY*/;
3316 else if (dt_node_is_ptrcompat(lp, rp, NULL, NULL) == 0) {
3317 xyerror(D_OP_INCOMPAT, "operands have "
3318 "incompatible types: \"%s\" %s \"%s\"\n",
3319 dt_node_type_name(lp, n1, sizeof (n1)), opstr(op),
3320 dt_node_type_name(rp, n2, sizeof (n2)));
3321 }
3322
3339 dt_node_attr_assign(rp, _dtrace_symattr);
3340 }
3341
3342 rp = dnp->dn_right = dt_node_cook(rp, DT_IDFLG_REF);
3343
3344 /*
3345 * The rules for type checking for the relational operators are
3346 * described in the ANSI-C spec (see K&R[A7.9-10]). We perform

--- 15 unchanged lines hidden (view full) ---

3362 /*EMPTY*/;
3363 else if (dt_node_is_ptrcompat(lp, rp, NULL, NULL) == 0) {
3364 xyerror(D_OP_INCOMPAT, "operands have "
3365 "incompatible types: \"%s\" %s \"%s\"\n",
3366 dt_node_type_name(lp, n1, sizeof (n1)), opstr(op),
3367 dt_node_type_name(rp, n2, sizeof (n2)));
3368 }
3369
3323 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp));
3370 dt_node_type_assign(dnp, DT_INT_CTFP(dtp), DT_INT_TYPE(dtp),
3371 B_FALSE);
3324 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3325 break;
3326
3327 case DT_TOK_ADD:
3328 case DT_TOK_SUB: {
3329 /*
3330 * The rules for type checking for the additive operators are
3331 * described in the ANSI-C spec (see K&R[A7.7]). Pointers and

--- 31 unchanged lines hidden (view full) ---

3363 uref = 0;
3364 } else {
3365 xyerror(D_OP_INCOMPAT, "operands have incompatible "
3366 "types: \"%s\" %s \"%s\"\n",
3367 dt_node_type_name(lp, n1, sizeof (n1)), opstr(op),
3368 dt_node_type_name(rp, n2, sizeof (n2)));
3369 }
3370
3372 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3373 break;
3374
3375 case DT_TOK_ADD:
3376 case DT_TOK_SUB: {
3377 /*
3378 * The rules for type checking for the additive operators are
3379 * described in the ANSI-C spec (see K&R[A7.7]). Pointers and

--- 31 unchanged lines hidden (view full) ---

3411 uref = 0;
3412 } else {
3413 xyerror(D_OP_INCOMPAT, "operands have incompatible "
3414 "types: \"%s\" %s \"%s\"\n",
3415 dt_node_type_name(lp, n1, sizeof (n1)), opstr(op),
3416 dt_node_type_name(rp, n2, sizeof (n2)));
3417 }
3418
3371 dt_node_type_assign(dnp, ctfp, type);
3419 dt_node_type_assign(dnp, ctfp, type, B_FALSE);
3372 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3373
3374 if (uref)
3375 dnp->dn_flags |= DT_NF_USERLAND;
3376 break;
3377 }
3378
3379 case DT_TOK_OR_EQ:

--- 124 unchanged lines hidden (view full) ---

3504
3505 /*
3506 * If the left-hand side of an assignment statement is a virgin
3507 * variable created by this compilation pass, reset the type of
3508 * this variable to the type of the right-hand side.
3509 */
3510 if (lp->dn_kind == DT_NODE_VAR &&
3511 dt_ident_unref(lp->dn_ident)) {
3420 dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
3421
3422 if (uref)
3423 dnp->dn_flags |= DT_NF_USERLAND;
3424 break;
3425 }
3426
3427 case DT_TOK_OR_EQ:

--- 124 unchanged lines hidden (view full) ---

3552
3553 /*
3554 * If the left-hand side of an assignment statement is a virgin
3555 * variable created by this compilation pass, reset the type of
3556 * this variable to the type of the right-hand side.
3557 */
3558 if (lp->dn_kind == DT_NODE_VAR &&
3559 dt_ident_unref(lp->dn_ident)) {
3512 dt_node_type_assign(lp, ctfp, type);
3560 dt_node_type_assign(lp, ctfp, type, B_FALSE);
3513 dt_ident_type_assign(lp->dn_ident, ctfp, type);
3514
3515 if (uref) {
3516 lp->dn_flags |= DT_NF_USERLAND;
3517 lp->dn_ident->di_flags |= DT_IDFLG_USER;
3518 }
3519 }
3520

--- 197 unchanged lines hidden (view full) ---

3718 xyerror(D_TYPE_MEMBER,
3719 "%s is not a member of %s\n", rp->dn_string,
3720 ctf_type_name(ctfp, type, n1, sizeof (n1)));
3721 }
3722
3723 type = ctf_type_resolve(ctfp, m.ctm_type);
3724 kind = ctf_type_kind(ctfp, type);
3725
3561 dt_ident_type_assign(lp->dn_ident, ctfp, type);
3562
3563 if (uref) {
3564 lp->dn_flags |= DT_NF_USERLAND;
3565 lp->dn_ident->di_flags |= DT_IDFLG_USER;
3566 }
3567 }
3568

--- 197 unchanged lines hidden (view full) ---

3766 xyerror(D_TYPE_MEMBER,
3767 "%s is not a member of %s\n", rp->dn_string,
3768 ctf_type_name(ctfp, type, n1, sizeof (n1)));
3769 }
3770
3771 type = ctf_type_resolve(ctfp, m.ctm_type);
3772 kind = ctf_type_kind(ctfp, type);
3773
3726 dt_node_type_assign(dnp, ctfp, m.ctm_type);
3774 dt_node_type_assign(dnp, ctfp, m.ctm_type, B_FALSE);
3727 dt_node_attr_assign(dnp, lp->dn_attr);
3728
3729 if (op == DT_TOK_PTR && (kind != CTF_K_ARRAY ||
3730 dt_node_is_string(dnp)))
3731 dnp->dn_flags |= DT_NF_LVALUE; /* see K&R[A7.3.3] */
3732
3733 if (op == DT_TOK_DOT && (lp->dn_flags & DT_NF_LVALUE) &&
3734 (kind != CTF_K_ARRAY || dt_node_is_string(dnp)))

--- 109 unchanged lines hidden (view full) ---

3844 if (dxp == NULL) {
3845 xyerror(D_XLATE_NONE,
3846 "cannot translate from \"%s\" to \"%s\"\n",
3847 dt_node_type_name(rp, n1, sizeof (n1)),
3848 dt_node_type_name(lp, n2, sizeof (n2)));
3849 }
3850
3851 dnp->dn_ident = dt_xlator_ident(dxp, lp->dn_ctfp, lp->dn_type);
3775 dt_node_attr_assign(dnp, lp->dn_attr);
3776
3777 if (op == DT_TOK_PTR && (kind != CTF_K_ARRAY ||
3778 dt_node_is_string(dnp)))
3779 dnp->dn_flags |= DT_NF_LVALUE; /* see K&R[A7.3.3] */
3780
3781 if (op == DT_TOK_DOT && (lp->dn_flags & DT_NF_LVALUE) &&
3782 (kind != CTF_K_ARRAY || dt_node_is_string(dnp)))

--- 109 unchanged lines hidden (view full) ---

3892 if (dxp == NULL) {
3893 xyerror(D_XLATE_NONE,
3894 "cannot translate from \"%s\" to \"%s\"\n",
3895 dt_node_type_name(rp, n1, sizeof (n1)),
3896 dt_node_type_name(lp, n2, sizeof (n2)));
3897 }
3898
3899 dnp->dn_ident = dt_xlator_ident(dxp, lp->dn_ctfp, lp->dn_type);
3852 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
3900 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
3901 B_FALSE);
3853 dt_node_attr_assign(dnp,
3854 dt_attr_min(rp->dn_attr, dnp->dn_ident->di_attr));
3855 break;
3856 }
3857
3858 case DT_TOK_LPAR: {
3859 ctf_id_t ltype, rtype;
3860 uint_t lkind, rkind;

--- 148 unchanged lines hidden (view full) ---

4009 "operator ?: operands must have compatible types\n");
4010 }
4011
4012 if (dt_node_is_actfunc(lp) || dt_node_is_actfunc(rp)) {
4013 xyerror(D_OP_ACT, "action cannot be "
4014 "used in a conditional context\n");
4015 }
4016
3902 dt_node_attr_assign(dnp,
3903 dt_attr_min(rp->dn_attr, dnp->dn_ident->di_attr));
3904 break;
3905 }
3906
3907 case DT_TOK_LPAR: {
3908 ctf_id_t ltype, rtype;
3909 uint_t lkind, rkind;

--- 148 unchanged lines hidden (view full) ---

4058 "operator ?: operands must have compatible types\n");
4059 }
4060
4061 if (dt_node_is_actfunc(lp) || dt_node_is_actfunc(rp)) {
4062 xyerror(D_OP_ACT, "action cannot be "
4063 "used in a conditional context\n");
4064 }
4065
4017 dt_node_type_assign(dnp, ctfp, type);
4066 dt_node_type_assign(dnp, ctfp, type, B_FALSE);
4018 dt_node_attr_assign(dnp, dt_attr_min(dnp->dn_expr->dn_attr,
4019 dt_attr_min(lp->dn_attr, rp->dn_attr)));
4020
4021 return (dnp);
4022}
4023
4024static dt_node_t *
4025dt_cook_statement(dt_node_t *dnp, uint_t idflags)

--- 16 unchanged lines hidden (view full) ---

4042{
4043 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
4044
4045 if (dnp->dn_aggfun != NULL) {
4046 dnp->dn_aggfun = dt_node_cook(dnp->dn_aggfun, DT_IDFLG_REF);
4047 dt_node_attr_assign(dnp, dt_ident_cook(dnp,
4048 dnp->dn_ident, &dnp->dn_aggtup));
4049 } else {
4067 dt_node_attr_assign(dnp, dt_attr_min(dnp->dn_expr->dn_attr,
4068 dt_attr_min(lp->dn_attr, rp->dn_attr)));
4069
4070 return (dnp);
4071}
4072
4073static dt_node_t *
4074dt_cook_statement(dt_node_t *dnp, uint_t idflags)

--- 16 unchanged lines hidden (view full) ---

4091{
4092 dtrace_hdl_t *dtp = yypcb->pcb_hdl;
4093
4094 if (dnp->dn_aggfun != NULL) {
4095 dnp->dn_aggfun = dt_node_cook(dnp->dn_aggfun, DT_IDFLG_REF);
4096 dt_node_attr_assign(dnp, dt_ident_cook(dnp,
4097 dnp->dn_ident, &dnp->dn_aggtup));
4098 } else {
4050 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
4099 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
4100 B_FALSE);
4051 dt_node_attr_assign(dnp, dnp->dn_ident->di_attr);
4052 }
4053
4054 return (dnp);
4055}
4056
4057/*
4058 * Since D permits new variable identifiers to be instantiated in any program

--- 185 unchanged lines hidden (view full) ---

4244 mnp->dn_membname, &ctm) == CTF_ERR) {
4245 xyerror(D_XLATE_MEMB,
4246 "translator member %s is not a member of %s\n",
4247 mnp->dn_membname, ctf_type_name(dxp->dx_dst_ctfp,
4248 dxp->dx_dst_type, n1, sizeof (n1)));
4249 }
4250
4251 (void) dt_node_cook(mnp, DT_IDFLG_REF);
4101 dt_node_attr_assign(dnp, dnp->dn_ident->di_attr);
4102 }
4103
4104 return (dnp);
4105}
4106
4107/*
4108 * Since D permits new variable identifiers to be instantiated in any program

--- 185 unchanged lines hidden (view full) ---

4294 mnp->dn_membname, &ctm) == CTF_ERR) {
4295 xyerror(D_XLATE_MEMB,
4296 "translator member %s is not a member of %s\n",
4297 mnp->dn_membname, ctf_type_name(dxp->dx_dst_ctfp,
4298 dxp->dx_dst_type, n1, sizeof (n1)));
4299 }
4300
4301 (void) dt_node_cook(mnp, DT_IDFLG_REF);
4252 dt_node_type_assign(mnp, dxp->dx_dst_ctfp, ctm.ctm_type);
4302 dt_node_type_assign(mnp, dxp->dx_dst_ctfp, ctm.ctm_type,
4303 B_FALSE);
4253 attr = dt_attr_min(attr, mnp->dn_attr);
4254
4255 if (dt_node_is_argcompat(mnp, mnp->dn_membexpr) == 0) {
4256 xyerror(D_XLATE_INCOMPAT,
4257 "translator member %s definition uses "
4258 "incompatible types: \"%s\" = \"%s\"\n",
4259 mnp->dn_membname,
4260 dt_node_type_name(mnp, n1, sizeof (n1)),
4261 dt_node_type_name(mnp->dn_membexpr,
4262 n2, sizeof (n2)));
4263 }
4264 }
4265
4266 dt_idstack_pop(&yypcb->pcb_globals, dxp->dx_locals);
4267
4268 dxp->dx_souid.di_attr = attr;
4269 dxp->dx_ptrid.di_attr = attr;
4270
4304 attr = dt_attr_min(attr, mnp->dn_attr);
4305
4306 if (dt_node_is_argcompat(mnp, mnp->dn_membexpr) == 0) {
4307 xyerror(D_XLATE_INCOMPAT,
4308 "translator member %s definition uses "
4309 "incompatible types: \"%s\" = \"%s\"\n",
4310 mnp->dn_membname,
4311 dt_node_type_name(mnp, n1, sizeof (n1)),
4312 dt_node_type_name(mnp->dn_membexpr,
4313 n2, sizeof (n2)));
4314 }
4315 }
4316
4317 dt_idstack_pop(&yypcb->pcb_globals, dxp->dx_locals);
4318
4319 dxp->dx_souid.di_attr = attr;
4320 dxp->dx_ptrid.di_attr = attr;
4321
4271 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
4322 dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp), B_FALSE);
4272 dt_node_attr_assign(dnp, _dtrace_defattr);
4273
4274 return (dnp);
4275}
4276
4277static void
4278dt_node_provider_cmp_argv(dt_provider_t *pvp, dt_node_t *pnp, const char *kind,
4279 uint_t old_argc, dt_node_t *old_argv, uint_t new_argc, dt_node_t *new_argv)

--- 276 unchanged lines hidden (view full) ---

4556 tp->dtdt_kind = DIF_TYPE_STRING;
4557 tp->dtdt_ckind = CTF_K_UNKNOWN;
4558 } else {
4559 tp->dtdt_kind = DIF_TYPE_CTF;
4560 tp->dtdt_ckind = ctf_type_kind(dnp->dn_ctfp,
4561 ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type));
4562 }
4563
4323 dt_node_attr_assign(dnp, _dtrace_defattr);
4324
4325 return (dnp);
4326}
4327
4328static void
4329dt_node_provider_cmp_argv(dt_provider_t *pvp, dt_node_t *pnp, const char *kind,
4330 uint_t old_argc, dt_node_t *old_argv, uint_t new_argc, dt_node_t *new_argv)

--- 276 unchanged lines hidden (view full) ---

4607 tp->dtdt_kind = DIF_TYPE_STRING;
4608 tp->dtdt_ckind = CTF_K_UNKNOWN;
4609 } else {
4610 tp->dtdt_kind = DIF_TYPE_CTF;
4611 tp->dtdt_ckind = ctf_type_kind(dnp->dn_ctfp,
4612 ctf_type_resolve(dnp->dn_ctfp, dnp->dn_type));
4613 }
4614
4564 tp->dtdt_flags = (dnp->dn_flags & DT_NF_REF) ? DIF_TF_BYREF : 0;
4615 tp->dtdt_flags = (dnp->dn_flags & DT_NF_REF) ?
4616 (dnp->dn_flags & DT_NF_USERLAND) ? DIF_TF_BYUREF :
4617 DIF_TF_BYREF : 0;
4565 tp->dtdt_pad = 0;
4566 tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type);
4567}
4568
4569void
4570dt_node_printr(dt_node_t *dnp, FILE *fp, int depth)
4571{
4572 char n[DT_TYPE_NAMELEN], buf[BUFSIZ], a[8];

--- 360 unchanged lines hidden ---
4618 tp->dtdt_pad = 0;
4619 tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type);
4620}
4621
4622void
4623dt_node_printr(dt_node_t *dnp, FILE *fp, int depth)
4624{
4625 char n[DT_TYPE_NAMELEN], buf[BUFSIZ], a[8];

--- 360 unchanged lines hidden ---