Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
ddmd.ctfeexpr
Compiler implementation of the
D programming language.
Authors:
License:
Source: ctfeexpr.d
- struct
CtfeStatus
; - Global status of the CTFE engine. Mostly used for performance diagnostics
- class
ClassReferenceExp
: ddmd.expression.Expression; - 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).
- class
VoidInitExp
: ddmd.expression.Expression; - An uninitialized value
- class
ThrownExceptionExp
: ddmd.expression.Expression; - Fake class which holds the thrown exception. Used for implementing exception handling.
- class
CTFEExp
: ddmd.expression.Expression; - This type is only used by the interpreter.
- bool
needToCopyLiteral
(Expressionexpr
); - Aggregate literals (AA/string/array/struct)
- ArrayLiteralExp
createBlockDuplicatedArrayLiteral
(Locloc
, Typetype
, Expressionelem
, size_tdim
); - Helper for NewExp Create an array literal consisting of '
elem
' duplicated 'dim
' times.Parameters:Loc loc
source location where the interpretation occurs Type type
target type
of the resultExpression elem
the source of array element, it will be owned by the result size_t dim
element number of the result Returns:Constructed ArrayLiteralExp - StringExp
createBlockDuplicatedStringLiteral
(Locloc
, Typetype
, dcharvalue
, size_tdim
, ubytesz
); - Helper for NewExp Create a string literal consisting of '
value
' duplicated 'dim
' times. - bool
isTypeInfo_Class
(Typetype
); - TypeInfo operations
- bool
isPointer
(Typet
); - Pointer operations
- bool
pointToSameMemoryBlock
(Expressionagg1
, Expressionagg2
); - Return
true
ifagg1
andagg2
are pointers to the same memory block - bool
isCtfeComparable
(Expressione
); - Constant folding, with support for CTFEReturn
true
if non-pointer expressione
can be compared with >,is, ==, etc, using ctfeCmp, ctfeEqual, ctfeIdentity - int
specificCmp
(TOKop
, intrawCmp
); - Returns cmp OP 0; where OP is ==, !=, <, >=, etc. Result is 0 or 1
- int
intUnsignedCmp
(TOKop
, dinteger_tn1
, dinteger_tn2
); - Returns e1 OP e2; where OP is ==, !=, <, >=, etc. Result is 0 or 1
- int
intSignedCmp
(TOKop
, sinteger_tn1
, sinteger_tn2
); - Returns e1 OP e2; where OP is ==, !=, <, >=, etc. Result is 0 or 1
- int
realCmp
(TOKop
, real_tr1
, real_tr2
); - Returns e1 OP e2; where OP is ==, !=, <, >=, etc. Result is 0 or 1
- int
ctfeEqual
(Locloc
, TOKop
, Expressione1
, Expressione2
); - Evaluate ==, !=. Resolves slices before comparing. Returns 0 or 1
- int
ctfeIdentity
(Locloc
, TOKop
, Expressione1
, Expressione2
); - Evaluate is, !is. Resolves slices before comparing. Returns 0 or 1
- int
ctfeCmp
(Locloc
, TOKop
, Expressione1
, Expressione2
); - Evaluate >,<=, etc. Resolves slices before comparing. Returns 0 or 1
- void
assignInPlace
(Expressiondest
, Expressionsrc
); - Assignment helper functions
- UnionExp
changeArrayLiteralLength
(Locloc
, TypeArrayarrayType
, Expressionoldval
, size_toldlen
, size_tnewlen
); - Given array literal
oldval
of type ArrayLiteralExp or StringExp, of lengtholdlen
, change its length tonewlen
. If thenewlen
is longer thanoldlen
, all new elements will be set to the default initializer for the element type. - bool
isCtfeValueValid
(Expressionnewval
); - CTFE Sanity Checks
- UnionExp
voidInitLiteral
(Typet
, VarDeclarationvar
); - Void initialization
Copyright © 1999-2017 by the D Language Foundation | Page generated by
Ddoc on Wed Jul 19 22:16:38 2017