dmd.backend.elem

Routines to handle elems.

Compiler implementation of the D programming language.

Members

Functions

ERTOL
bool ERTOL(elem* e)
el_alignsize
uint el_alignsize(elem* e)
el_allbits
bool el_allbits(elem* e, int bit)

Determine if constant e is all ones or all zeros.

el_alloctmp
elem* el_alloctmp(tym_t ty)

Allocate a temporary, and return temporary elem.

el_anydef
bool el_anydef(elem* ed, const(elem)* e)

Does any definition of lvalue ed appear in e?

el_appears
int el_appears(const(elem)* e, Symbol* s)

Does symbol s appear in tree e?

el_basesym
Symbol* el_basesym(elem* e)

Look for symbol that is a base of addressing mode e.

el_bint
elem* el_bint(OPER op, type* t, elem* e1, elem* e2)

Make a binary operator node.

el_calloc
elem* el_calloc()

Allocate an element.

el_check
void el_check(const(elem)* e)

Check for errors in a tree.

el_combine
elem* el_combine(elem* e1, elem* e2)

Combine e1 and e2 with a comma-expression. Be careful about either or both being null.

el_combines
elem* el_combines(void** args, int length)

Do an array of parameters as a balanced binary tree.

el_const
elem* el_const(tym_t ty, eve* pconst)

Make a constant elem. ty = type of elem *pconst = union of constant data

el_convstring
elem* el_convstring(elem* e)

Convert reference to a string to reference to a symbol stored in the static data segment.

el_convxmm
elem* el_convxmm(elem* e)

Convert vector constant to a read-only symbol. Needed iff vector code can't load immediate constants.

el_copy
void el_copy(elem* to, elem* from)

Copy an element (not the tree!).

el_copytotmp
elem* el_copytotmp(elem** pe)

Thin wrapper of exp2_copytotemp. Different from el_same, always makes a temporary.

el_copytree
elem* el_copytree(elem* e)

Create and return a duplicate of e, including its leaves. No CSEs.

el_countCommas
int el_countCommas(const(elem)* e)

Count number of commas in the expression.

el_ctor
elem* el_ctor(elem* ector, elem* e, Symbol* sdtor)

Insert constructor information into tree. ector pointer to object being constructed e code to construct the object sdtor function to destruct the object

el_ctor_dtor
elem* el_ctor_dtor(elem* ec, elem* ed, elem** pedtor)

Create constructor/destructor pair of elems. Caution: The pattern generated here must match that detected in e2ir.c's visit(CallExp).

el_dctor
elem* el_dctor(elem* e, void* decl)

Insert constructor information into tree. A corresponding el_ddtor() must be called later.

el_ddtor
elem* el_ddtor(elem* e, void* decl)

Insert destructor information into tree. e code to destruct the object decl VarDeclaration of variable being destructed (must match decl for corresponding OPctor)

el_dehydrate
void el_dehydrate(elem** pe)

Dehydrate an elem.

el_depends
int el_depends(const(elem)* ea, elem* eb)

Input: ea lvalue (might be an OPbit)

el_dtor
elem* el_dtor(elem* edtor, elem* e)

Insert destructor information into tree. edtor pointer to object being destructed e code to do the destruction

el_free
void el_free(elem* e)

Free element

el_funcsideeff
bool el_funcsideeff(elem* e)
el_hydrate
void el_hydrate(elem** pe)

Hydrate an elem.

el_init
void el_init()

Initialize el package.

el_isdependent
bool el_isdependent(elem* e)

Is elem type-dependent or value-dependent?

el_longt
elem* el_longt(type* t, targ_llong val)

Make a constant node out of integral type.

el_match
bool el_match(elem* n1, elem* n2)
el_match2
bool el_match2(elem* n1, elem* n2)

Kludge on el_match(). Same, but ignore differences in OPconst.

el_match3
bool el_match3(elem* n1, elem* n2)

Kludge on el_match(). Same, but ignore differences in type modifiers.

el_match4
bool el_match4(elem* n1, elem* n2)

Kludge on el_match(). Same, but ignore differences in spelling of var's.

el_match5
bool el_match5(elem* n1, elem* n2)

Kludge on el_match(). Same, but regard signed/unsigned as equivalent.

el_nelems
elem* el_nelems(type* t)

Return an elem that evaluates to the number of elems in a type (if it is an array). Returns null if t is not an array.

el_nparams
int el_nparams(elem* e)

Return a list of the parameters.

el_opArray
void el_opArray(elem*** parray, elem* e, OPER op)

Fill an array with the ops.

el_opCombine
elem* el_opCombine(elem** args, size_t length, OPER op, tym_t ty)

Do an array of parameters as a tree

el_opN
size_t el_opN(elem* e, OPER op)

Return number of op nodes

el_pair
elem* el_pair(tym_t tym, elem* lo, elem* hi)

Create a quad word out of two dwords.

el_param
elem* el_param(elem* e1, elem* e2)

Combine e1 and e2 as parameters to a function. Be careful about either or both being null.

el_paramArray
void el_paramArray(elem*** parray, elem* e)

Fill an array with the parameters.

el_params
elem* el_params(elem* e1, ...)

Create parameter list, terminated by a null.

el_params
elem* el_params(void** args, int length)

Do an array of parameters as a balanced binary tree.

el_parent
elem** el_parent(elem* e, elem** pe)

Find and return pointer to parent of e starting at *pe. Return null if can't find it.

el_ptr_offset
elem* el_ptr_offset(Symbol* s, targ_size_t offset)

Make a pointer to an elem out of a symbol at offset.

el_replace_sym
void el_replace_sym(elem* e, Symbol* s1, Symbol* s2)

Replace symbol s1 with s2 in tree.

el_replacesym
void el_replacesym(elem* e, Symbol* s1, Symbol* s2)

Walk tree, replacing symbol s1 with s2.

el_reset
void el_reset()

Initialize for another run through.

el_returns
bool el_returns(const(elem)* e)

Determine if expression may return. Does not detect all cases, errs on the side of saying it returns.

el_same
elem* el_same(elem** pe)

Similar to el_copytree(e). But if e has any side effects, it's replaced with (tmp = e) and tmp is returned.

el_scancommas
elem* el_scancommas(elem* e)

Scan down commas and return the controlling elem.

el_selecte1
elem* el_selecte1(elem* e)

Select the e1 child of e.

el_selecte2
elem* el_selecte2(elem* e)

Select the e2 child of e.

el_settype
elem* el_settype(elem* e, type* t)

Set new type for elem.

el_sideeffect
bool el_sideeffect(elem* e)
el_signx32
bool el_signx32(elem* e)

Determine if constant e is a 32 bit or less value, or is a 32 bit value sign extended to 64 bits.

el_term
void el_term()

Terminate el package.

el_toconst
void el_toconst(elem* e)

If elem is a const that can be converted to an OPconst, do the conversion.

el_toldouble
longdouble_soft el_toldouble(elem* e)

Extract long double value from constant elem. Silently ignore types which are not floating point values.

el_tolong
targ_llong el_tolong(elem* e)

Extract long value from constant elem.

el_tolongt
targ_llong el_tolongt(elem* e)

Extract long value from constant parser elem.

el_typesize
elem* el_typesize(type* t)

Create elem that is the size of a type.

el_unat
elem* el_unat(OPER op, type* t, elem* e1)

Make a unary operator node.

el_vectorConst
elem* el_vectorConst(tym_t ty, ulong val)

Create a const integer vector elem

el_zero
elem* el_zero(type* t)

Create an elem of the constant 0, of the type t.

elem_print
void elem_print(elem* e, int nestlevel)

Write out expression elem.

exp2_copytotemp
elem* exp2_copytotemp(elem* e)

Replace (e) with ((stmp = e),stmp)

shrinkLongDoubleConstantIfPossible
void shrinkLongDoubleConstantIfPossible(elem* e)

If e is a long double constant, and it is perfectly representable as a double constant, convert it to a double constant. Note that this must NOT be done in contexts where there are no further operations, since then it could change the type (eg, in the function call printf("%La", 2.0L); the 2.0 must stay as a long double).

Structs

STAB
struct STAB

//////////////////////////

Meta