Converts expressions to Intermediate Representation (IR) for the backend.
bool
ISX64REF
(Declaration
var
);
If variable var is a value that will actually be passed as a reference
Parameters:Declarationvar | parameter variable |
Returns:true if actually implicitly passed by reference
elem*
elAssign
(elem*
e1
, elem*
e2
, Type
t
, type*
tx
);
Generate a copy from e2 to e1.
Parameters:elem*e1 | lvalue |
elem*e2 | rvalue |
Typet | value type |
type*tx | if !null, then t converted to C type |
bool
type_zeroCopy
(type*
t
);
Determine if zero bits need to be copied for this backend type
Symbol*
toStringSymbol
(const(char)*
str
, size_t
len
, size_t
sz
);
Write read-only string to object file, create a local symbol for it. Makes a copy of str's contents, does not keep a reference to it.
Parameters:const(char)*str | string |
size_tlen | number of code units in string |
size_tsz | number of bytes per code unit |
Symbol*
toStringSymbol
(StringExp
se
);
Turn StringExp into Symbol.
void
toTraceGC
(ref IRState
irs
, elem*
e
, const ref Loc
loc
);
Replace call to GC allocator with call to tracing GC allocator.
Parameters:IRStateirs | to get function from |
elem*e | elem to modify in place |
Locloc | to get file/line from |
elem*
toElemDtor
(Expression
e
, ref IRState
irs
);
Convert Expression to elem, then append destructors for any temporaries created in elem.
Parameters:Expressione | Expression to convert |
IRStateirs | context |
Returns:generated elem tree
elem*
addressElem
(elem*
e
, Type
t
, bool
alwaysCopy
= false);
Take address of an elem. Accounts for e being an rvalue by assigning the rvalue to a temp.
Parameters:elem*e | elem to take address of |
Typet | Type of elem |
boolalwaysCopy | when true, always copy e to a tmp |
Returns:the equivalent of &e
Reset stringTab[] between object files being emitted, because the symbols are local.
bool
isDllImported
(Dsymbol
var
);
Figure out whether a data symbol should be dllimported
Parameters:Dsymbolvar | declaration of the symbol |
Returns:true if symbol should be imported from a DLL
Symbol*
toExtSymbol
(Dsymbol
s
);
Generate a backend symbol for a frontend symbol
Returns:the backend symbol or the associated symbol in the import table if it is expected to be imported from a DLL
elem*
toElem
(Expression
e
, ref IRState
irs
);
Convert Expression to backend elem.
Parameters:Expressione | expression tree |
IRStateirs | context |
Returns:backend elem tree