Lines Matching defs:type

51  * node type (dn_ctfp/dn_type) and attributes (dn_attr).  If dn_ctfp/dn_type
52 * are set manually (i.e. not by one of the type assignment functions), then
60 * The dn_ctfp and dn_type fields form the type of the node. This tuple can
61 * take on the following set of values, which form our type invariants:
65 * In this state, the node has unknown type and is not yet cooked. The
70 * In this state, the node is a dynamic D type. This means that generic
74 * and its type. The DT_NF_REF flag is set for all nodes of type <DYN>.
75 * At present, the D compiler uses the <DYN> type for:
77 * - associative arrays that do not yet have a value type defined
83 * In this state, the node is of type D string. The string type is really
86 * 4. dn_ctfp != NULL, dn_type = any other type ID
88 * In this state, the node is of some known D/CTF type. The normal libctf
89 * APIs can be used to learn more about the type name or structure. When
90 * the type is assigned, the DT_NF_SIGNED, DT_NF_REF, and DT_NF_BITFIELD
91 * flags cache the corresponding attributes of the underlying CTF type.
181 case DT_TOK_TNAME: return ("<type>");
203 char *type = alloca((size_t)(end - s) + 1);
214 * token (p) into type, and then concatenate everything
215 * after q. This is the type name without the object.
217 bcopy(s, type, (size_t)(p - s));
218 bcopy(q + 1, type + (size_t)(p - s), strlen(q + 1) + 1);
223 return (dtrace_lookup_by_type(dtp, object, type, tip));
236 * When we parse type expressions or parse an expression with unary "&", we
237 * need to find a type that is a pointer to a previously known type.
240 * for the compiler that attempts to compute a pointer to either the given type
242 * to potentially construct the required type on-the-fly.
249 ctf_id_t type = tip->dtt_type;
250 ctf_id_t base = ctf_type_resolve(ctfp, type);
255 if ((ptr = ctf_type_pointer(ctfp, type)) != CTF_ERR ||
267 (type = ctf_add_type(dmp->dm_ctfp, ctfp, type)) == CTF_ERR) {
272 ptr = ctf_add_pointer(dmp->dm_ctfp, CTF_ADD_ROOT, type);
287 dt_type_name(ctf_file_t *ctfp, ctf_id_t type, char *buf, size_t len)
291 if (ctfp == DT_FPTR_CTFP(dtp) && type == DT_FPTR_TYPE(dtp))
293 else if (ctfp == DT_FUNC_CTFP(dtp) && type == DT_FUNC_TYPE(dtp))
295 else if (ctfp == DT_DYN_CTFP(dtp) && type == DT_DYN_TYPE(dtp))
299 else if (ctf_type_name(ctfp, type, buf, len) == NULL)
307 * input operand types should be promoted and used as a result type. The
356 * different, pick the type with the greater rank.
437 (void) snprintf(buf, len, "type %s",
654 dt_node_type_assign(dt_node_t *dnp, ctf_file_t *fp, ctf_id_t type)
656 ctf_id_t base = ctf_type_resolve(fp, type);
683 type == DT_DYN_TYPE(yypcb->pcb_hdl))
688 dnp->dn_type = type;
771 * from the node's type. This is slightly different from C's sizeof()
774 * the function type.
793 ctf_id_t type;
798 type = ctf_type_resolve(fp, dnp->dn_type);
799 kind = ctf_type_kind(fp, type);
802 ctf_type_encoding(fp, type, &e) == 0 && IS_VOID(e))
813 ctf_id_t type;
818 type = ctf_type_resolve(fp, dnp->dn_type);
819 kind = ctf_type_kind(fp, type);
822 ctf_type_encoding(dnp->dn_ctfp, type, &e) == 0 && (
832 ctf_id_t type;
837 type = ctf_type_resolve(fp, dnp->dn_type);
838 kind = ctf_type_kind(fp, type);
841 ctf_type_encoding(fp, type, &e) == 0 && IS_VOID(e))
853 ctf_id_t type;
858 type = ctf_type_resolve(fp, dnp->dn_type);
859 kind = ctf_type_kind(fp, type);
862 return (ctf_type_encoding(fp, type, &e) == 0 && !IS_VOID(e));
872 ctf_id_t type;
877 type = ctf_type_resolve(fp, dnp->dn_type);
878 if (ctf_type_kind(fp, type) != CTF_K_POINTER)
879 return (0); /* type is not a pointer */
881 type = ctf_type_resolve(fp, ctf_type_reference(fp, type));
882 kind = ctf_type_kind(fp, type);
885 ctf_type_encoding(fp, type, &e) == 0 && IS_VOID(e)));
977 ctf_id_t type;
988 type = ctf_type_resolve(fp, dnp->dn_type);
990 return (ctf_type_kind(fp, type) == CTF_K_INTEGER &&
991 ctf_type_encoding(fp, type, &e) == 0 && IS_VOID(e));
1032 * Resolve the left-hand and right-hand types to their base type, and
1033 * then resolve the referenced type as well (assuming the base type
1063 * We know that one or the other type may still be a zero-valued
1065 * type variables equal to the non-integer types and proceed.
1083 * The types are compatible if both are pointers to the same type, or
1085 * tp to point to the more specific pointer type and return it.
1164 * The type of an integer constant is the first of the corresponding list in
1186 * even faster, we precompute the table of type information in dtrace_open().
1232 "in any built-in integral type\n", (u_longlong_t)value);
1294 * Create an empty node of type corresponding to the given declaration.
1337 * Create a type node corresponding to a varargs (...) parameter by just
1338 * assigning it type CTF_ERR. The decl processing code will handle this.
1370 ctf_id_t type;
1380 * declaration of an intrinsic type (e.g. "extern int;") or declaration
1381 * or redeclaration of a struct, union, or enum type or tag.
1388 dt_dprintf("type %s added as id %ld\n", dt_type_name(
1448 dt_dprintf("extern %s`%s type=<%s>\n",
1469 * If the source type for the typedef is not defined in the
1470 * target container or its parent, copy the type to the target
1483 "source type: %s\n", dsp->ds_ident,
1488 type = ctf_add_typedef(dmp->dm_ctfp,
1491 if (type == CTF_ERR || ctf_update(dmp->dm_ctfp) == CTF_ERR) {
1496 dt_dprintf("typedef %s added as id %ld\n", dsp->ds_ident, type);
1549 * by a type rather than an integer, then it's an associative
1560 * type of any matching identifier by assigning to this node.
1562 * the type by hand so as not to trigger a prototype check for
1612 "\t current: %s, key #%d of type %s\n"
1613 "\tprevious: %s, key #%d of type %s\n",
1635 type = ctf_type_resolve(dtt.dtt_ctfp, dtt.dtt_type);
1636 kind = ctf_type_kind(dtt.dtt_ctfp, type);
1640 if (ctf_type_encoding(dtt.dtt_ctfp, type,
1648 if (ctf_type_size(dtt.dtt_ctfp, type) != 0)
1683 * array type signature corresponding to the list of
1709 "function designator is not of function type\n");
1739 * The offsetof() function is special because it takes a type name as an
1752 ctf_id_t type;
1764 type = ctf_type_resolve(dtt.dtt_ctfp, dtt.dtt_type);
1765 kind = ctf_type_kind(dtt.dtt_ctfp, type);
1769 "offsetof operand must be a struct or union type\n");
1772 if (ctf_member_info(dtt.dtt_ctfp, type, name, &ctm) == CTF_ERR) {
1799 * the effective type determined by dt_node_int().
2001 * If an integer constant is being cast to another integer type, we can
2003 * We must take action when the integer is being cast to a smaller type
2189 * signature, and then recompute 'dtt' as the array's value type.
2199 "of scalar array type: %s\n", dsp->ds_ident);
2309 * Set the type, attributes, and flags for the inline. If the right-
2312 * associative array this will construct a type signature from 'ddp'.
2343 * visible, and then cook 'dnp' to check its type against 'expr'.
2422 "translator output type must be a struct or union\n");
2629 * matches its type if this is a global lookup. In the TLS or
2694 "no symbolic type information is available for "
2853 ctf_id_t type, base;
2886 * we can just set our output type to the base translation.
2897 type = ctf_type_resolve(cp->dn_ctfp, cp->dn_type);
2898 kind = ctf_type_kind(cp->dn_ctfp, type);
2901 if (ctf_array_info(cp->dn_ctfp, type, &r) != 0) {
2905 type = r.ctr_contents;
2907 type = ctf_type_reference(cp->dn_ctfp, type);
2910 "cannot dereference non-pointer type\n");
2913 dt_node_type_assign(dnp, cp->dn_ctfp, type);
2914 base = ctf_type_resolve(cp->dn_ctfp, type);
2952 "of arithmetic type\n", opstr(dnp->dn_op));
2960 "integral type\n", opstr(dnp->dn_op));
2968 "of scalar type\n", opstr(dnp->dn_op));
2999 xyerror(D_TYPE_ERR, "cannot find type for \"&\": %s*\n",
3028 "cannot apply stringof to a value of type %s\n",
3040 "scalar type\n", opstr(dnp->dn_op));
3079 ctf_id_t type;
3121 * a type by assignment or declaration (!dt_ident_unref())
3143 "integral type\n", opstr(op));
3156 "integral type\n", opstr(op));
3169 "integral type\n", opstr(op));
3182 "arithmetic type\n", opstr(op));
3196 "of scalar type\n", opstr(op));
3212 * if the left-hand side is an enum type. To do this, we cook
3250 * The rules for type checking for the relational operators are
3254 * type (resulting in a strcmp(3C)-style comparison), and we
3282 * The rules for type checking for the additive operators are
3301 dt_type_promote(lp, rp, &ctfp, &type);
3305 type = lp->dn_type;
3309 type = rp->dn_type;
3314 type = ctf_lookup_by_name(ctfp, "ptrdiff_t");
3323 dt_node_type_assign(dnp, ctfp, type);
3350 "integral type\n", opstr(op));
3369 "arithmetic type\n", opstr(op));
3445 * output of a translator, our result is the translated type.
3449 type = idp->di_type;
3453 type = rp->dn_type;
3459 * variable created by this compilation pass, reset the type of
3460 * this variable to the type of the right-hand side.
3464 dt_node_type_assign(lp, ctfp, type);
3465 dt_ident_type_assign(lp->dn_ident, ctfp, type);
3477 * The rules for type checking for the assignment operators are
3487 "applied to operand of type \"%s\"\n",
3494 ctf_type_compat(lp->dn_ctfp, lp->dn_type, ctfp, type))
3527 * The rules for type checking for the assignment operators are
3615 * the type of the left is the translation output type.
3626 type = ctf_type_resolve(ctfp, idp->di_type);
3630 type = ctf_type_resolve(ctfp, lp->dn_type);
3634 kind = ctf_type_kind(ctfp, type);
3641 type = ctf_type_reference(ctfp, type);
3642 type = ctf_type_resolve(ctfp, type);
3643 kind = ctf_type_kind(ctfp, type);
3648 * search the entire type space for the actual definition.
3651 char *tag = ctf_type_name(ctfp, type, n1, sizeof (n1));
3655 (dtt.dtt_ctfp != ctfp || dtt.dtt_type != type)) {
3657 type = ctf_type_resolve(ctfp, dtt.dtt_type);
3658 kind = ctf_type_kind(ctfp, type);
3670 "applied to pointer to type \"%s\"; must "
3672 ctf_type_name(ctfp, type, n1, sizeof (n1)));
3675 "applied to type \"%s\"; must be applied "
3677 ctf_type_name(ctfp, type, n1, sizeof (n1)));
3681 if (ctf_member_info(ctfp, type, rp->dn_string, &m) == CTF_ERR) {
3684 ctf_type_name(ctfp, type, n1, sizeof (n1)));
3687 type = ctf_type_resolve(ctfp, m.ctm_type);
3688 kind = ctf_type_kind(ctfp, type);
3837 * and K&R[A6]. Basically, we can cast to the same type or
3838 * same base type, between any kind of scalar values, from
3873 "cannot be of dynamic type\n", opstr(op));
3932 ctf_id_t type;
3940 "operator ?: expression must be of scalar type\n");
3945 "operator ?: operands cannot be of dynamic type\n");
3949 * The rules for type checking for the ternary operator are complex and
3956 type = lp->dn_type;
3958 dt_type_promote(lp, rp, &ctfp, &type);
3962 type = DT_STR_TYPE(yypcb->pcb_hdl);
3963 } else if (dt_node_is_ptrcompat(lp, rp, &ctfp, &type) == 0) {
3973 dt_node_type_assign(dnp, ctfp, type);
3993 * this node is just a reference to the aggregation's type and attributes.
4025 * as a variable of type int64_t. The predicate must be cooked first because
4099 "predicate result must be of scalar type\n");
4132 * type exactly matches the type that is returned by the translation.
4509 * parameter is used to indicate the type of reference (r/w) and is applied to
4597 * Compute the DOF dtrace_diftype_t representation of a node's type. This is
4632 (void) snprintf(buf, BUFSIZ, "type=<%s> attr=%s flags=", n, a);
4634 (void) snprintf(buf, BUFSIZ, "type=<%ld> attr=%s flags=",