![]() |
libFirm
|
Change control flow. More...
Typedefs | |
| typedef struct ir_switch_table | ir_switch_table |
| A switch table mapping integer numbers to proj-numbers of a Switch-node. More... | |
Enumerations | |
| enum | n_Switch { n_Switch_selector, n_Switch_max = n_Switch_selector } |
| Input numbers for Switch node. More... | |
| enum | pn_Switch { pn_Switch_default, pn_Switch_max = pn_Switch_default } |
| Projection numbers for result of Switch node (use for Proj nodes) More... | |
Functions | |
| ir_switch_table * | ir_new_switch_table (ir_graph *irg, size_t n_entries) |
Creates a new switch_table data structure with n_entries entries. More... | |
| size_t | ir_switch_table_get_n_entries (const ir_switch_table *table) |
Returns number of entries available in switch table table. More... | |
| void | ir_switch_table_set (ir_switch_table *table, size_t entry, ir_tarval *min, ir_tarval *max, unsigned pn) |
Sets entry number entry in the switch table table. More... | |
| ir_tarval * | ir_switch_table_get_max (const ir_switch_table *table, size_t entry) |
Returns maximum tarval value of switch table entry entry. More... | |
| ir_tarval * | ir_switch_table_get_min (const ir_switch_table *table, size_t entry) |
Returns minimum tarval value of switch table entry entry. More... | |
| unsigned | ir_switch_table_get_pn (const ir_switch_table *table, size_t entry) |
Returns proj number taken if switch table entry entry matches. More... | |
| ir_switch_table * | ir_switch_table_duplicate (ir_graph *irg, const ir_switch_table *table) |
Duplicates switch table table on obstack of irg. More... | |
| ir_node * | new_rd_Switch (dbg_info *dbgi, ir_node *block, ir_node *irn_selector, unsigned n_outs, ir_switch_table *table) |
| Construct a Switch node. More... | |
| ir_node * | new_r_Switch (ir_node *block, ir_node *irn_selector, unsigned n_outs, ir_switch_table *table) |
| Construct a Switch node. More... | |
| ir_node * | new_d_Switch (dbg_info *dbgi, ir_node *irn_selector, unsigned n_outs, ir_switch_table *table) |
| Construct a Switch node. More... | |
| ir_node * | new_Switch (ir_node *irn_selector, unsigned n_outs, ir_switch_table *table) |
| Construct a Switch node. More... | |
| int | is_Switch (const ir_node *node) |
| Test if node is a Switch. More... | |
| ir_node * | get_Switch_selector (const ir_node *node) |
| Returns selector input of a Switch node. More... | |
| void | set_Switch_selector (ir_node *node, ir_node *selector) |
| Sets selector input of a Switch node. More... | |
| unsigned | get_Switch_n_outs (const ir_node *node) |
| Returns n_outs attribute of a Switch node. More... | |
| void | set_Switch_n_outs (ir_node *node, unsigned n_outs) |
| Sets n_outs attribute of a Switch node. More... | |
| ir_switch_table * | get_Switch_table (const ir_node *node) |
| Returns table attribute of a Switch node. More... | |
| void | set_Switch_table (ir_node *node, ir_switch_table *table) |
| Sets table attribute of a Switch node. More... | |
| ir_op * | get_op_Switch (void) |
| Returns opcode for Switch nodes. More... | |
Variables | |
| ir_op * | op_Switch |
| Switch opcode. More... | |
Change control flow.
The destination is choosen based on an integer input value which is looked up in a table.
Backends can implement this efficiently using a jump table.
| typedef struct ir_switch_table ir_switch_table |
A switch table mapping integer numbers to proj-numbers of a Switch-node.
Entries map a continuous range of integer numbers to a proj-number. There must never be two different entries matching the same integer number.
Definition at line 102 of file firm_types.h.
| enum n_Switch |
| enum pn_Switch |
| ir_op* get_op_Switch | ( | void | ) |
Returns opcode for Switch nodes.
Definition at line 2746 of file gen_irnode.c.
References op_Switch.
| unsigned get_Switch_n_outs | ( | const ir_node * | node | ) |
Returns n_outs attribute of a Switch node.
Definition at line 3489 of file gen_irnode.c.
Returns selector input of a Switch node.
Definition at line 2736 of file gen_irnode.c.
| ir_switch_table* get_Switch_table | ( | const ir_node * | node | ) |
Returns table attribute of a Switch node.
Definition at line 3499 of file gen_irnode.c.
| ir_switch_table* ir_new_switch_table | ( | ir_graph * | irg, |
| size_t | n_entries | ||
| ) |
Creates a new switch_table data structure with n_entries entries.
The data structure is allocated on the obstack of irg.
| ir_switch_table* ir_switch_table_duplicate | ( | ir_graph * | irg, |
| const ir_switch_table * | table | ||
| ) |
Duplicates switch table table on obstack of irg.
| ir_tarval* ir_switch_table_get_max | ( | const ir_switch_table * | table, |
| size_t | entry | ||
| ) |
Returns maximum tarval value of switch table entry entry.
| ir_tarval* ir_switch_table_get_min | ( | const ir_switch_table * | table, |
| size_t | entry | ||
| ) |
Returns minimum tarval value of switch table entry entry.
| size_t ir_switch_table_get_n_entries | ( | const ir_switch_table * | table | ) |
Returns number of entries available in switch table table.
| unsigned ir_switch_table_get_pn | ( | const ir_switch_table * | table, |
| size_t | entry | ||
| ) |
Returns proj number taken if switch table entry entry matches.
| void ir_switch_table_set | ( | ir_switch_table * | table, |
| size_t | entry, | ||
| ir_tarval * | min, | ||
| ir_tarval * | max, | ||
| unsigned | pn | ||
| ) |
Sets entry number entry in the switch table table.
| table | the switch table |
| entry | entry number to set |
| min | The minimum tarval that matches this entry |
| max | The maximum tarval that matches this entry |
| pn | Proj number taken on match |
| int is_Switch | ( | const ir_node * | node | ) |
Test if node is a Switch.
Definition at line 3484 of file gen_irnode.c.
| ir_node* new_d_Switch | ( | dbg_info * | dbgi, |
| ir_node * | irn_selector, | ||
| unsigned | n_outs, | ||
| ir_switch_table * | table | ||
| ) |
Construct a Switch node.
| dbgi | A pointer to debug information. |
| irn_selector | selector |
| n_outs | number of outputs (including pn_Switch_default) |
| table | table describing mapping from input values to Proj numbers |
Definition at line 2724 of file gen_irnode.c.
References current_ir_graph, get_cur_block(), IR_GRAPH_CONSTRAINT_CONSTRUCTION, irg_is_constrained(), and new_rd_Switch().
Referenced by new_Switch().
| ir_node* new_r_Switch | ( | ir_node * | block, |
| ir_node * | irn_selector, | ||
| unsigned | n_outs, | ||
| ir_switch_table * | table | ||
| ) |
Construct a Switch node.
| block | The IR block the node belongs to. |
| irn_selector | selector |
| n_outs | number of outputs (including pn_Switch_default) |
| table | table describing mapping from input values to Proj numbers |
Definition at line 2719 of file gen_irnode.c.
References new_rd_Switch().
| ir_node* new_rd_Switch | ( | dbg_info * | dbgi, |
| ir_node * | block, | ||
| ir_node * | irn_selector, | ||
| unsigned | n_outs, | ||
| ir_switch_table * | table | ||
| ) |
Construct a Switch node.
| dbgi | A pointer to debug information. |
| block | The IR block the node belongs to. |
| irn_selector | selector |
| n_outs | number of outputs (including pn_Switch_default) |
| table | table describing mapping from input values to Proj numbers |
Definition at line 2702 of file gen_irnode.c.
References get_irn_irg(), mode_T, new_ir_node(), op_Switch, optimize_node(), and verify_new_node().
Referenced by new_d_Switch(), and new_r_Switch().
| ir_node* new_Switch | ( | ir_node * | irn_selector, |
| unsigned | n_outs, | ||
| ir_switch_table * | table | ||
| ) |
Construct a Switch node.
| irn_selector | selector |
| n_outs | number of outputs (including pn_Switch_default) |
| table | table describing mapping from input values to Proj numbers |
Definition at line 2731 of file gen_irnode.c.
References new_d_Switch().
| void set_Switch_n_outs | ( | ir_node * | node, |
| unsigned | n_outs | ||
| ) |
Sets n_outs attribute of a Switch node.
Definition at line 3494 of file gen_irnode.c.
Sets selector input of a Switch node.
Definition at line 2741 of file gen_irnode.c.
| void set_Switch_table | ( | ir_node * | node, |
| ir_switch_table * | table | ||
| ) |
Sets table attribute of a Switch node.
Definition at line 3504 of file gen_irnode.c.
| ir_op* op_Switch |
Switch opcode.
Definition at line 4084 of file nodes.h.
Referenced by get_op_Switch(), and new_rd_Switch().