Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
dmd.backend.type
Types for the back end
Compiler implementation of the
D programming language.
Authors:
License:
Source backend/type.d
- enum
TF: ushort; - Values for Tflags:
- nothrow @nogc @trusted targ_size_t
type_size(const type*t); - Compute size of type in bytes.Parameters:
type* ttype Returns:size - nothrow @trusted uint
type_alignsize(const(type)*t); - Return the size of a type for alignment purposes.
- nothrow @trusted bool
type_zeroSize(const type*t, tym_ttyf); - Compute special zero sized struct.Parameters:
type* ttype of parameter tym_t tyffunction type Returns:true if t is a zero size struct - nothrow @safe uint
type_parameterSize(const type*t, tym_ttyf); - Compute the size of a single parameter.Parameters:
type* ttype of parameter tym_t tyffunction type Returns:size in bytes - nothrow @trusted uint
type_paramsize(const type*t); - Compute the total size of parameters for function call. Used for stdcall name mangling. Note that hidden parameters do not contribute to size.Parameters:
type* tfunction type Returns:total stack usage in bytes - nothrow @nogc @trusted type*
type_alloc(tym_tty); - Create a type & initialize it.
Input ty = TYxxxx
Returns:pointer to newly created type. - nothrow @nogc @safe type*
type_fake(tym_tty); - Fake a type & initialize it.
Input ty = TYxxxx
Returns:pointer to newly created type. - nothrow @safe type*
type_allocn(tym_tty, type*tn); - Allocate a type of ty with a Tnext of tn.
- nothrow @safe type*
type_pointer(type*tnext); - Allocate a pointer type.Returns:Tcount already incremented
- nothrow @trusted type*
type_dyn_array(type*tnext); - Allocate a dynamic array type.Returns:Tcount already incremented
- nothrow @safe type*
type_static_array(targ_size_tdim, type*tnext); - Allocate a static array type.Returns:Tcount already incremented
- nothrow @trusted type*
type_assoc_array(type*tkey, type*tvalue); - Allocate an associative array type, which are key=value pairsReturns:Tcount already incremented
- nothrow @trusted type*
type_delegate(type*tnext); - Allocate a delegate type.Returns:Tcount already incremented
- nothrow @trusted type*
type_function(tym_ttyf, type*[]ptypes, boolvariadic, type*tret); - Allocate a function type.Parameters:
tym_t tyffunction type type*[] ptypestypes of the function parameters bool variadicif ... function type* tretreturn type Returns:Tcount already incremented - nothrow @trusted type*
type_enum(const(char)*name, type*tbase); - Create an enum type.
Input name name of enum tbase "base" type of enum
Returns:Tcount already incremented - nothrow @trusted type*
type_struct_class(const(char)*name, uintalignsize, uintstructsize, type*arg1type, type*arg2type, boolisUnion, boolisClass, boolisPOD, boolis0size); - Create a struct/union/class type.Parameters:
const(char)* namename of struct (this function makes its own copy of the string) uint alignsizealignment for fields uint structsizetotal size of struct type* arg1typefor Sarg1type field type* arg2typefor Sarg2type field bool isUniontrue if a union bool isClasstrue if a class bool isPODtrue if Plain Old Data bool is0sizeif struct has no fields (even if Sstructsize is 1) Returns:Tcount already incremented - nothrow @trusted void
type_free(type*t); - Free up data type.
- nothrow @trusted type*
type_copy(type*tf); - Type type information.Make copy of a type.Parameters:
type* tftype to copy Returns:copy of tf - nothrow @safe type*
type_setty(type**pt, uintnewty); - Modify the tym_t field of a type.
- nothrow @safe type*
type_setmangle(type**pt, Manglemangle); - Modify the Tmangle field of a type.
- nothrow @safe type*
type_setcv(type**pt, tym_tcv); - Set/clear const and volatile bits in* pt according to the settings in cv.
- nothrow @trusted bool
type_embed(type*t, type*u); - Recursively check if type u is embedded in type t.Returns:true if embedded
- nothrow @trusted void
type_print(const type*t); - Pretty-print a type.
- nothrow @trusted void
param_t_print(scope const param_t*p); - Pretty-print a param_t
- nothrow @trusted void
param_free(ref param_t[]*pparamlst); - Free parameter list.
Output paramlst = null
- nothrow @safe uint
param_t_length(scope param_t*p); - Compute number of parameters
- nothrow @trusted int
typematch(type*t1, type*t2, intrelax); - A cheap version of exp2.typematch() and exp2.paramlstmatch(), so that we can get cpp_mangle() to work for MARS. It's less complex because it doesn't do templates and can rely on strict typechecking.Returns:!=0 if types match.
Copyright © 1999-2026 by the D Language Foundation | Page generated by
Ddoc on Wed Aug 19 13:54:14 2026