dmd.cond
Evaluate compile-time conditionals, such as static if version and debug.
Specification: Conditional Compilation
License
Source: cond.d
Documentation: https://dlang.org/phobos/dmd_cond.html
-
Declaration
enumInclude: ubyte;-
Declaration
notComputednot computed yet
-
Declaration
yesinclude the conditional code
-
Declaration
nodo not include the conditional code
-
-
Declaration
classStaticForeach: dmd.root.rootobject.RootObject;Implements common functionality for StaticForeachDeclaration and StaticForeachStatement This performs the necessary lowerings before dmd.statementsem.makeTupleForeach can be used to expand the corresponding
static foreachdeclaration or statement.-
Declaration
ForeachStatementaggrfe;Not
nulliff thestatic foreachis over an aggregate. In this case, it contains the corresponding ForeachStatement. For StaticForeachDeclaration, the body isnull. -
Declaration
ForeachRangeStatementrangefe;Not
nulliff thestatic foreachis over a range. Exactly one of theaggrefeandfields is notrangefenull. Seeaggrfefield for more details. -
Declaration
boolneedExpansion;trueif it is necessary to expand a tuple into multiple variables (see lowerNonArrayAggregate). -
Declaration
voidprepare(Scope*sc);Perform
static foreachlowerings that are necessary in order to finally expand thestatic foreachusingdmd.statementsem.makeTupleForeach. -
Declaration
boolready();Return Value
trueiffreadyto calldmd.statementsem.makeTupleForeach.
-
-
Declaration
abstract classDVCondition: dmd.cond.Condition; -
Declaration
classDebugCondition: dmd.cond.DVCondition;-
Declaration
deprecated static voidaddGlobalIdent(const(char)*ident);
static voidaddGlobalIdent(stringident);
static voidaddGlobalIdent(const(char)[]ident);Add an user-supplied identifier to the list of global debug identifiers
Discussion
Can be called from either the driver or a
debug = Ident;statement. Unlike version identifier, there isn't any reserved debug identifier so no validation takes place.Parameters
const(char)*identidentifier to add
-
Declaration
this(const ref Locloc, Modulemod, uintlevel, Identifierident);Instantiate a new
DebugConditionParameters
ModulemodModule this node belongs to
uintlevelMinimum global
levelthis condition needs to pass. Only used ifisidentnull.IdentifieridentIdentifier required for this condition to pass. If
null, this conditiion will use an integerlevel.LoclocLocation in the source file
-
-
Declaration
classVersionCondition: dmd.cond.DVCondition;Node to represent a version condition
Discussion
A version condition is of the form:
In user code. This class also provides means to add version identifier to the list of global (cross module) identifiers.version (Identifier)
-
Declaration
static voidcheckReserved(const ref Locloc, const(char)[]ident);Raises an error if a version identifier is reserved.
Discussion
Called when setting a version identifier, e.g.
-version=identifierparameter to the compiler orversion = Fooin user code.Parameters
LoclocWhere the identifier is set
const(char)[]identidentifier being checked (
ident[$] must be '\0') -
Declaration
deprecated static voidaddGlobalIdent(const(char)*ident);
static voidaddGlobalIdent(stringident);
static voidaddGlobalIdent(const(char)[]ident);Add an user-supplied global identifier to the list
Discussion
Only called from the driver for
-version=Identparameters. Will raise an error if the identifier is reserved.Parameters
const(char)*identidentifier to add
-
Declaration
deprecated static voidaddPredefinedGlobalIdent(const(char)*ident);
static voidaddPredefinedGlobalIdent(stringident);
static voidaddPredefinedGlobalIdent(const(char)[]ident);Add any global identifier to the list, without checking if it's predefined
Discussion
Only called from the driver after platform detection, and internally.
Parameters
const(char)*identidentifier to add (
ident[$] must be '\0') -
Declaration
this(const ref Locloc, Modulemod, uintlevel, Identifierident);Instantiate a new
VersionConditionParameters
ModulemodModule this node belongs to
uintlevelMinimum global
levelthis condition needs to pass. Only used ifisidentnull.IdentifieridentIdentifier required for this condition to pass. If
null, this conditiion will use an integerlevel.LoclocLocation in the source file
-
Declaration
classStaticIfCondition: dmd.cond.Condition; -
Declaration
pure nothrow @safe boolfindCondition(Identifiers*ids, Identifierident);Find
in an array of identifiers.identParameters
Identifiers*idsarray of identifiers
Identifieridentidentifier to search for
Return Value
trueif found