dmd.e2ir

Converts expressions to Intermediate Representation (IR) for the backend.

Members

Functions

addressElem
elem* addressElem(elem* e, Type t, bool alwaysCopy = false)

Take address of an elem.

array_toDarray
elem* array_toDarray(Type t, elem* e)

Convert array to a dynamic array.

array_toPtr
elem* array_toPtr(Type t, elem* e)

Convert array to a pointer to the data.

buildArrayBoundsError
elem* buildArrayBoundsError(IRState* irs, const ref Loc loc, elem* lwr, elem* upr, elem* elength)

Construct elem to run when an array bounds check fails.

callCAssert
elem* callCAssert(IRState* irs, const ref Loc loc, Expression exp, Expression emsg, const(char)* str)

Generate call to C's assert failure function. One of exp, emsg, or str must not be null.

clearStringTab
void clearStringTab()

Reset stringTab[] between object files being emitted, because the symbols are local.

elAssign
elem* elAssign(elem* e1, elem* e2, Type t, type* tx)

Generate a copy from e2 to e1.

elemIsLvalue
bool elemIsLvalue(elem* e)

Return true if elem is a an lvalue. Lvalue elems are OPvar and OPind.

genHalt
elem* genHalt(const ref Loc loc)

Generate HALT instruction.

getTypeInfo
elem* getTypeInfo(Loc loc, Type t, IRState* irs)
needsDtor
StructDeclaration needsDtor(Type t)

Determine if t is a struct that has destructor.

needsPostblit
StructDeclaration needsPostblit(Type t)

Determine if t is a struct that has postblit.

sarray_toDarray
elem* sarray_toDarray(const ref Loc loc, Type tfrom, Type tto, elem* e)
setEthis2
elem* setEthis2(const ref Loc loc, IRState* irs, FuncDeclaration fd, elem* ethis2, elem** ethis, elem** eside)

Initialize the dual-context array with the context pointers.

toElemDtor
elem* toElemDtor(Expression e, IRState* irs)

Convert Expression to elem, then append destructors for any temporaries created in elem.

toStringSymbol
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.

toStringSymbol
Symbol* toStringSymbol(StringExp se)

Turn StringExp into Symbol.

toTraceGC
void toTraceGC(IRState* irs, elem* e, const ref Loc loc)

Replace call to GC allocator with call to tracing GC allocator.

type_zeroCopy
bool type_zeroCopy(type* t)

Determine if zero bits need to be copied for this backend type

Meta