Describes a back-end target. At present it is incomplete, but in the future it should grow to contain most or all target machine and target O/S specific information.
In many cases, calls to sizeof() can't be used directly for getting data type sizes since cross compiling is supported and would end up using the host sizes rather than the target sizes.
Bit decoding of the Target.OS
size of a pointer in bytes
size a real consumes in memory
padding added to the CPU real size to bring it up to realsize
alignment for reals
size ofClassInfo
maximum size of static data
C ABI
C++ ABI
Objective-C ABI
const(char)[]
architectureName;
Architecture name
extension for object files
extension for static library files
extension for dynamic library files
allow -run sources without extensions
struct
FPTypeProperties(T);
Values representing all properties for floating point types
largest representable value that's not infinity
smallest representable normalized value that's not 0
NaN value
infinity value
smallest increment to the value 1
number of decimal digits of precision
number of bits in mantissa
maximum int value such that 2max_exp-1 is representable
minimum int value such that 2min_exp-1 is representable as a normalized value
maximum int value such that 10max_10_exp is representable
minimum int value such that 10min_10_exp is representable as a normalized value
FPTypeProperties!float
FloatProperties;
FPTypeProperties!double
DoubleProperties;
FPTypeProperties!real_t
RealProperties;
void
_init(ref const Param
params);
Initialize the Target
@safe Target.ObjectFormat
objectFormat() const;
Determine the object format to be used
Determine the instruction set to be used
@safe void
deinitialize();
Deinitializes the global state of the compiler.
This can be used to restore the state set by_init to its original state.
Requested target memory alignment size of the given type.
Returns:alignment in bytes
uint
fieldalign(Type
type);
Requested target field alignment size of the given type.
Returns:alignment in bytes
Type
va_listType(Loc
loc, Scope*
sc);
Type for theva_list type for the target; e.g., required for_argptr declarations.
NOTEFor Posix/x86_64 this returns the type which will really be used for passing an argument of type va_list.
Returns:Type that representsva_list.
@safe int
isVectorTypeSupported(int
sz, Type
type);
Checks whether the target supports a vector type.
Parameters:intsz | vector type size in bytes |
Typetype | vector element type |
Returns:0 vector type is supported, 1 vector type is not supported on the target at all 2 vector element type is not supported 3 vector size is not supported
bool
isVectorOpSupported(Type
type, EXP
op, Type
t2 = null);
Checks whether the target supports the given operation for vectors.
Parameters:Typetype | target type of operation |
EXPop | the unary or binary op being done on thetype |
Typet2 | type of second operand ifop is a binary operation |
Returns:true if the operation is supported or type is not a vector
@safe LINK
systemLinkage();
Default system linkage for the target.
Returns:LINK to use forextern(System)
TypeTuple
toArgTypes(Type
t);
Describes how an argument type is passed to a function on target.
Returns:tuple of types if type is passed in one or more registers empty tuple if type is always passed on the stack null if the type is avoid or argtypes aren't supported by the target
bool
isReturnOnStack(TypeFunction
tf, bool
needsThis);
Determine return style of function - whether in registers or through a hidden pointer to the caller's stack.
Parameters:TypeFunctiontf | function type to check |
boolneedsThis | true if the function type is for a non-static member function |
Returns:true if return value from function is on the stack
bool
preferPassByRef(Type
t);
Decides whether anin parameter of the specified POD type is to be passed by reference or by value. To be used with-preview=in only!
Parameters:Typet | type of thein parameter, must be a POD |
Returns:true if thein parameter is to be passed by reference
Expression
getTargetInfo(const(char)*
name, Loc
loc);
Get targetInfo by key
Parameters:const(char)*name | name of targetInfo to get |
Locloc | location to use for error messages |
Returns:Expression for the requested targetInfo
@safe bool
isCalleeDestroyingArgs(TypeFunction
tf);
Parameters:TypeFunctiontf | type of function being called |
Returns:true if the callee invokes destructors for arguments.
bool
libraryObjectMonitors(FuncDeclaration
fd, Statement
fbody);
Returns true if the implementation for object monitors is always defined in the D runtime library (rt/monitor_.d).
Parameters:FuncDeclarationfd | function withsynchronized storage class. |
Statementfbody | entire function body offd |
Returns:false if the target backend handles synchronizing monitors.
@safe bool
supportsLinkerDirective() const;
Returns true if the target supportspragma(linkerDirective).
Returns:false if the target does not supportpragma(linkerDirective).
@safe bool
isXmmSupported();
Returns:true if xmm usage is supported
nothrow @nogc @property @safe bool
isPOSIX() const scope;
Returns:true if generating code for POSIX
Returns:alignment of the stack