C_Switch_Statement¶
- class C_Switch_Statement (concrete, physical)¶
Semantics: evaluates Selector, then Dispatch.
- Direct parents:
inherits Switch_Statement
- Ancestor classes and implemented interfaces:
Linked_Node, Logical_Code_Range_Interface, Operation, Physical_IR_Root, Statement, Switch_Statement
Field
Kind
Type
Description
Case_Labels
semantic
list of class Switch_Case_Label
All labels in the order as they appear in the source for
case ....:This includes the default label! Note: semantic because the body could be a loop over the casesDefault_Case
semantic
class Default_Case_Label
Case for
default(null if none)Init_Statement (from Switch_Statement)
syntactic
class Statement
In C++17, the variable declaration inside the switch:
switch (init_statement; selector) body. 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.Selector (from Switch_Statement)
syntactic
class Expression
the controlling expression
Switch_Body (from Switch_Statement)
syntactic
class Statement
the switch body statement before the first label (usually a block)
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_Instance is true
Code_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.