Target

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.

extern (C++)
struct Target {
OS os;
ubyte osMajor;
CPU cpu;
bool isX86_64;
bool isLP64;
bool omfobj;
}

Members

Enums

OS
enum OS

Bit decoding of the Target.OS

Functions

_init
void _init(Param params)

Initialize the Target

alignsize
uint alignsize(Type type)

Requested target memory alignment size of the given type.

deinitialize
void deinitialize()

Deinitializes the global state of the compiler.

fieldalign
uint fieldalign(Type type)

Requested target field alignment size of the given type.

getTargetInfo
Expression getTargetInfo(const(char)* name, Loc loc)

Get targetInfo by key

isCalleeDestroyingArgs
bool isCalleeDestroyingArgs(TypeFunction tf)
isReturnOnStack
bool isReturnOnStack(TypeFunction tf, bool needsThis)

Determine return style of function - whether in registers or through a hidden pointer to the caller's stack.

isVectorOpSupported
bool isVectorOpSupported(Type type, EXP op, Type t2)

Checks whether the target supports the given operation for vectors.

isVectorTypeSupported
int isVectorTypeSupported(int sz, Type type)

Checks whether the target supports a vector type.

isXmmSupported
bool isXmmSupported()
libraryObjectMonitors
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).

objectFormat
Target.ObjectFormat objectFormat()

Determine the object format to be used

preferPassByRef
bool preferPassByRef(Type t)

Decides whether an in parameter of the specified POD type is to be passed by reference or by value. To be used with -preview=in only!

setCPU
void setCPU()

Determine the instruction set to be used

stackAlign
uint stackAlign()
supportsLinkerDirective
bool supportsLinkerDirective()

Returns true if the target supports pragma(linkerDirective).

systemLinkage
LINK systemLinkage()

Default system linkage for the target.

toArgTypes
TypeTuple toArgTypes(Type t)

Describes how an argument type is passed to a function on target.

va_listType
Type va_listType(Loc loc, Scope* sc)

Type for the va_list type for the target; e.g., required for _argptr declarations. NOTE: For Posix/x86_64 this returns the type which will really be used for passing an argument of type va_list.

Properties

isPOSIX
bool isPOSIX [@property getter]

Structs

FPTypeProperties
struct FPTypeProperties(T)

Values representing all properties for floating point types

Variables

DoubleProperties
FPTypeProperties!double DoubleProperties;
FloatProperties
FPTypeProperties!float FloatProperties;
RealProperties
FPTypeProperties!real_t RealProperties;
architectureName
const(char)[] architectureName;

Architecture name

c
TargetC c;

C ABI

classinfosize
ubyte classinfosize;

size of ClassInfo

cpp
TargetCPP cpp;

C++ ABI

dll_ext
const(char)[] dll_ext;

extension for dynamic library files

lib_ext
const(char)[] lib_ext;

extension for static library files

maxStaticDataSize
ulong maxStaticDataSize;

maximum size of static data

obj_ext
const(char)[] obj_ext;

extension for object files

objc
TargetObjC objc;

Objective-C ABI

ptrsize
ubyte ptrsize;

size of a pointer in bytes

realalignsize
ubyte realalignsize;

alignment for reals

realpad
ubyte realpad;

padding added to the CPU real size to bring it up to realsize

realsize
ubyte realsize;

size a real consumes in memory

run_noext
bool run_noext;

allow -run sources without extensions

Meta