Constexpr_If_Statement¶
- class Constexpr_If_Statement (concrete, physical)¶
C++17
if constexpr(init; condition) then_branch else else_branch.- Direct parents:
inherits If_Statement
- Ancestor classes and implemented interfaces:
Conditional_Interface, If_Statement, Linked_Node, Logical_Code_Range_Interface, Operation, Physical_IR_Root, Statement
Field
Kind
Type
Description
Condition_Valueattribute
builtin Boolean
Whether the condition evaluated to ‘true’
Condition_Value_Knownattribute
builtin Boolean
Whether the condition was evaluated. If false, template instantiation is required to compute the condition value.
Init_Statement(from If_Statement)syntactic
class Statement
In C++17, the variable declaration inside the if condition:
if (init_statement; condition) then_branch else else_branch. Only used with the C++17 syntax where the condition is separate from the init_statement. If the condition itself is a variable declaration, we use a Condition_Variable_Selection node.Then_Branch(from If_Statement)syntactic
class Statement
The true branch.
Else_Branch(from If_Statement)syntactic
class Statement
The false branch.
Logical(from Linked_Node)semantic to logical
class Logical_IR_Root
cross-reference into LIR
Parent(from Physical_IR_Root)semantic
class Physical_IR_Root
The parent of the node in the syntactic forest.
Original_Position_Index(from Physical_IR_Root)attribute
builtin SLoc_Index_Type
Internal source location info. If from macro expansion, this location is inside the macro body or macro argument
Original_Position(from Physical_IR_Root)attribute
builtin SLoc
Source location. If from macro expansion, this location is inside the macro body or macro argument
Position(from Physical_IR_Root)attribute
builtin SLoc
Source location. If from macro expansion, this location is that of the macro expansion
Artificial(from Physical_IR_Root)attribute
builtin Boolean
Whether this node was compiler-generated
Parenthesized(from Physical_IR_Root)attribute
builtin Boolean
Whether this node was enclosed in parentheses (used for expressions)
In_Template_Instance(from Physical_IR_Root)attribute
builtin Boolean
Whether this node is inside a template instance
Enclosing_Template_Instance(from Physical_IR_Root)semantic
class Physical_IR_Root
Innermost enclosing template instance if
In_Template_Instanceis trueCode_Start(from Logical_Code_Range_Interface)semantic to logical
class Execution_Node
Start of the LIR code belonging to this statement. If set to an instruction, that instruction is part of the code range. If set to a block, the code range begins with the tail jump of that block, but does not include the block’s code. Use
is_inside_code_range()to determine if an instruction is between Code_Start and Code_End.Code_End(from Logical_Code_Range_Interface)semantic to logical
class Execution_Node
If set to an instruction, it is the first instruction after those belonging to the code range belonging to this statement. If set to a block, the code range includes all instructions in that block but not the block’s tail jump. In other words: A block is used to refer to the “instruction-after-last” in that block; all instructions between Code_Start (inclusive) to Code_End (exclusive) belong to the code range. If Code_Start==Code_End, then the statement did not emit any LIR instructions.
Condition(from Conditional_Interface)syntactic
class Expression
the condition to check in an
if,?:, loop,assert,switchalso used for#ifvariants, and C# 6 exception filters