ddmd.ctfeexpr

Compiler implementation of the D programming language.

Members

Classes

CTFEExp
class CTFEExp

This type is only used by the interpreter.

ClassReferenceExp
class ClassReferenceExp

A reference to a class, or an interface. We need this when we point to a base class (we must record what the type is).

ThrownExceptionExp
class ThrownExceptionExp

Fake class which holds the thrown exception. Used for implementing exception handling.

VoidInitExp
class VoidInitExp

An uninitialized value

Functions

assignInPlace
void assignInPlace(Expression dest, Expression src)

Assignment helper functions

changeArrayLiteralLength
UnionExp changeArrayLiteralLength(Loc loc, TypeArray arrayType, Expression oldval, size_t oldlen, size_t newlen)

Given array literal oldval of type ArrayLiteralExp or StringExp, of length oldlen, change its length to newlen. If the newlen is longer than oldlen, all new elements will be set to the default initializer for the element type.

createBlockDuplicatedArrayLiteral
ArrayLiteralExp createBlockDuplicatedArrayLiteral(Loc loc, Type type, Expression elem, size_t dim)

Helper for NewExp Create an array literal consisting of 'elem' duplicated 'dim' times.

createBlockDuplicatedStringLiteral
StringExp createBlockDuplicatedStringLiteral(Loc loc, Type type, dchar value, size_t dim, ubyte sz)

Helper for NewExp Create a string literal consisting of 'value' duplicated 'dim' times.

ctfeCmp
int ctfeCmp(Loc loc, TOK op, Expression e1, Expression e2)

Evaluate >,<=, etc. Resolves slices before comparing. Returns 0 or 1

ctfeEqual
int ctfeEqual(Loc loc, TOK op, Expression e1, Expression e2)

Evaluate ==, !=. Resolves slices before comparing. Returns 0 or 1

ctfeIdentity
int ctfeIdentity(Loc loc, TOK op, Expression e1, Expression e2)

Evaluate is, !is. Resolves slices before comparing. Returns 0 or 1

intSignedCmp
int intSignedCmp(TOK op, sinteger_t n1, sinteger_t n2)

Returns e1 OP e2; where OP is ==, !=, <, >=, etc. Result is 0 or 1

intUnsignedCmp
int intUnsignedCmp(TOK op, dinteger_t n1, dinteger_t n2)

Returns e1 OP e2; where OP is ==, !=, <, >=, etc. Result is 0 or 1

isCtfeComparable
bool isCtfeComparable(Expression e)

Constant folding, with support for CTFE ***************************/ /// Return true if non-pointer expression e can be compared /// with >,is, ==, etc, using ctfeCmp, ctfeEqual, ctfeIdentit

isCtfeValueValid
bool isCtfeValueValid(Expression newval)

CTFE Sanity Checks

isPointer
bool isPointer(Type t)

Pointer operations

isTypeInfo_Class
bool isTypeInfo_Class(Type type)

TypeInfo operations

needToCopyLiteral
bool needToCopyLiteral(Expression expr)

Aggregate literals (AA/string/array/struct)

pointToSameMemoryBlock
bool pointToSameMemoryBlock(Expression agg1, Expression agg2)

Return true if agg1 and agg2 are pointers to the same memory block

realCmp
int realCmp(TOK op, real_t r1, real_t r2)

Returns e1 OP e2; where OP is ==, !=, <, >=, etc. Result is 0 or 1

specificCmp
int specificCmp(TOK op, int rawCmp)

Returns cmp OP 0; where OP is ==, !=, <, >=, etc. Result is 0 or 1

voidInitLiteral
UnionExp voidInitLiteral(Type t, VarDeclaration var)

Void initialization

Structs

CtfeStatus
struct CtfeStatus

Global status of the CTFE engine. Mostly used for performance diagnostics

Meta

Source

See Source File
$(DMDSRC _ctfeexpr.d)