Compiler implementation of the D programming language.
Return !=0 if modfrom can be implicitly converted to modto
Return MATCH.exact or MATCH.constant if a method of type '() modfrom' can call a method of type '() modto'.
Merge mod bits to form common mod.
Store modifier name into buf.
mod
, which is the token mod
corresponds toConvert MODxxxx to STCxxx
dotExp() bit flags
Variadic argument lists https://dlang.org/spec/function.html#variadic
fixed number of arguments
(T t, ...) can be C-style (core.stdc.stdarg) or D-style (core.vararg)
(T t ...) typesafe https://dlang.org/spec/function.html#typesafe_variadic_functions
Covariant means that 'this' can substitute for 't', i.e. a pure function is a match for an impure type.
Type t
| type 'this' is covariant with |
StorageClass* pstc
| if not null, store STCxxxx which would make it covariant |
bool fix17349
| enable fix https://issues.dlang.org/show_bug.cgi?id=17349 |
For pretty-printing a type.
Deinitializes the global state of the compiler.
This can be used to restore the state set by _init
to its original state.
This version does a merge even if the deco is already computed. Necessary for types that have a deco, but are not merged.
Store this type's modifier name into buf.
Return this type's modifier name.
When T is mutable,
Returns true if T can be converted to boolean value.
Check type to see if it is based on a deprecated symbol.
Return a copy of this type with all attributes null-initialized. Useful for creating a type with different modifiers.
Convert to 'const'.
Convert to 'immutable'.
Make type mutable.
Make type unshared. 0 => 0 const => const immutable => immutable shared => 0 shared const => const wild => wild wild const => wild const shared wild => wild shared wild const => wild const
Convert to 'wild'.
For our new type 'this', which is type-constructed from t, fill in the cto, ito, sto, scto, wto shortcuts.
Look for bugs in constructing types.
Apply STCxxxx bits to existing type. Use *before* semantic analysis is run.
Apply MODxxxx bits to existing type.
Add MODxxxx bits to existing type. We're adding, not replacing, so adding const to a shared type => "shared const"
Add storage class modifiers to type.
If this is a shell around another type, get that other type.
Determine if 'this' can be implicitly converted to type 'to'.
Determine if converting 'this' to 'to' is an identity operation, a conversion to const operation, or the types aren't the same.
Compute MOD bits matching this
argument type to wild parameter type.
Type t
| corresponding parameter type |
bool isRef
| parameter is ref or out
|
Return type with the top level of it being mutable.
Return alignment to use for this type.
Use when we prefer the default initializer to be a literal, rather than a global immutable variable.
Return !=0 if the type or any of its subtypes is wild.
Return !=0 if type has pointers that need to be scanned by the GC during a collection cycle.
Detect if type has pointer fields that are initialized to void. Local stack variables with such void fields can remain uninitialized, leading to pointer bugs.
If this is a type of something, return that something.
If this is a type of static array, return its base element type.
Compute number of elements for a (possibly multidimensional) static array, or 1 for other types.
Loc loc
| for error message |
Return the mask that an integral type will fit into.
true if when type goes out of scope, it needs a destructor applied. Only applies to value types, not ref types.
https://issues.dlang.org/show_bug.cgi?id=14488 Check if the inner most base type is complex or imaginary. Should only give alerts when set to emit transitional messages.
Loc loc
| The source location. |
Scope* sc
| scope of the type |
For TypeFunction, nextOf() can return NULL if the function return type is meant to be inferred, and semantic() hasn't yet ben run on the function. After semantic(), it must no longer be NULL.
The basetype must be one of: byte[16],ubyte[16],short[8],ushort[8],int[4],uint[4],long[2],ulong[2],float[4],double[2] For AVX: byte[32],ubyte[32],short[16],ushort[16],int[8],uint[8],long[4],ulong[4],float[8],double[4]
Static array, one with a fixed dimension
Dynamic array, no dimension
Set 'purity' field of 'this'. Do this lazily, as the parameter types might be forward referenced.
Return true if there are lazy parameters.
Examine function signature for parameter p and see if the value of p can 'escape' the scope of the function. This is useful to minimize the needed annotations for the parameters.
Type tthis
| type of this parameter, null if none |
Parameter p
| parameter to this function |
Take the specified storage class for p, and use the function signature to infer whether STC.scope_ and STC.return_ should be OR'd in. (This will not affect the name mangling.)
Type tthis
| type of this parameter, null if none |
Parameter p
| parameter to this function |
'args' are being matched to function 'this' Determine match level.
Type tthis
| type of this pointer, null if not member function |
Expression[] args
| array of function arguments |
int flag
| 1: performing a partial ordering match |
const(char)** pMessage
| address to store error message, or null |
Scope* sc
| context |
This is a shell containing a TraitsExp that can be either resolved to a type or to a symbol.
The point is to allow AliasDeclarationY to use __traits()
, see issue 7804.
The expression to resolve as type or symbol.
After typeSemantic
the symbol when exp
doesn't represent a type.
Implements mixin types.
Semantic analysis will convert it to a real type.
See if type resolves to a symbol, if so, return that symbol.
Similar to TypeIdentifier, but with a TemplateInstance as the root
Use when we prefer the default initializer to be a literal, rather than a global immutable variable.
Form TypeTuple from the types of the expressions. Assume exps[] is already tuple expanded.
Type tuple with 0, 1 or 2 types in it.
This is so we can slice a TypeTuple
Encapsulate Parameters* so .length and [i] can be used on it. https://dlang.org/spec/function.html#ParameterList
Determine if parameter is a lazy array of delegates. If so, return the return type of those delegates. If not, return NULL.
Returns T if the type is one of the following forms: T delegate()[] T delegate()[dim]
Determine number of arguments, folding in tuples.
Get nth Parameter, folding in tuples.
Expands tuples in args in depth first order. Calls dg(void *ctx, size_t argidx, Parameter *arg) for each Parameter. If dg returns !=0, stops and returns that value else returns 0. Use this function to avoid the O(N + N^2/2) complexity of calculating dim and calling N times getNth.
Compute covariance of parameters this
and p
as determined by the storage classes of both.
bool returnByRef
| true if the function returns by ref |
Parameter p
| Parameter to compare with |
this
can be used in place of p
false = nopeFor printing two types with qualification when necessary.
Type t1
| The first type to receive the type name for |
Type t2
| The second type to receive the type name for |
For each active modifier (MODFlags.const_, MODFlags.immutable_, etc) call fp
with a void* for the work param and a string representation of the attribute.
For each active attribute (ref/const/nogc/etc) call fp
with a void* for the work param and a string representation of the attribute.
If the type is a class or struct, returns the symbol for it, else null.
Determine if type t can be indexed or sliced given that it is not an aggregate with operator overloads.
Type t
| type to check |
Determine if type t is copyable.
Type t
| type to check |
© 1999–2019 The D Language Foundation
Licensed under the Boost License 1.0.
https://dlang.org/phobos/dmd_mtype.html