libFirm
|
ir_node - a datatype representing a Firm node More...
Modules | |
ASM node | |
executes assembler fragments of the target machine. | |
Add node | |
returns the sum of its operands | |
Address node | |
Symbolic constant that represents the address of an entity (variable or method) | |
Align node | |
A symbolic constant that represents the alignment of a type. | |
Alloc node | |
Allocates a block of memory on the stack. | |
Anchor node | |
Utility node used to "hold" nodes in a graph that might possibly not be reachable by other means or which should be reachable immediately without searching through the graph. | |
And node | |
returns the result of a bitwise and operation of its operands | |
Bad node | |
Bad nodes indicate invalid input, which is values which should never be computed. | |
Bitcast node | |
Converts a value between modes with different arithmetics but same number of bits by reinterpreting the bits in the new mode. | |
Block node | |
A basic block. | |
Builtin node | |
performs a backend-specific builtin. | |
Call node | |
Calls other code. | |
Cmp node | |
Compares its two operands and checks whether a specified relation (like less or equal) is fulfilled. | |
Cond node | |
Conditionally change control flow. | |
Confirm node | |
Specifies constraints for a value. | |
Const node | |
Returns a constant value. | |
Conv node | |
Converts values between modes. | |
CopyB node | |
Copies a block of memory with statically known size/type. | |
Deleted node | |
Internal node which is temporary set to nodes which are already removed from the graph. | |
Div node | |
returns the quotient of its 2 operands | |
Dummy node | |
A placeholder value. | |
End node | |
Last node of a graph. | |
Eor node | |
returns the result of a bitwise exclusive or operation of its operands. | |
Free node | |
Frees a block of memory previously allocated by an Alloc node. | |
IJmp node | |
Jumps to the code in its argument. | |
Id node | |
Returns its operand unchanged. | |
Jmp node | |
Jumps to the block connected through the out-value. | |
Load node | |
Loads a value from memory (heap or stack). | |
Member node | |
Computes the address of a compound type member given the base address of an instance of the compound type. | |
Minus node | |
returns the additive inverse of its operand | |
Mod node | |
returns the remainder of its operands from an implied division. | |
Mul node | |
returns the product of its operands | |
Mulh node | |
returns the upper word of the product of its operands (the part which would not fit into the result mode of a normal Mul anymore) | |
Mux node | |
returns the false or true operand depending on the value of the sel operand | |
NoMem node | |
Placeholder node for cases where you don't need any memory input. | |
Node Opcodes | |
This module specifies the opcodes for ir nodes. | |
Not node | |
returns the bitwise complement of a value. | |
Offset node | |
Symbolic constant that represents the offset of an entity in its owner type. | |
Or node | |
returns the result of a bitwise or operation of its operands | |
Phi node | |
Choose a value based on control flow. | |
Pin node | |
Pin the value of the node node in the current block. | |
Proj node | |
returns an entry of a tuple value | |
Raise node | |
Raises an exception. | |
Return node | |
Returns from the current function. | |
Sel node | |
Computes the address of an array element from the array base pointer and an index. | |
Shl node | |
Returns its first operands bits shifted left by the amount of the 2nd operand. | |
Shr node | |
Returns its first operands bits shifted right by the amount of the 2nd operand. | |
Shrs node | |
Returns its first operands bits shifted right by the amount of the 2nd operand. | |
Size node | |
A symbolic constant that represents the size of a type. | |
Start node | |
The first node of a graph. | |
Store node | |
Stores a value into memory (heap or stack). | |
Sub node | |
returns the difference of its operands | |
Switch node | |
Change control flow. | |
Sync node | |
The Sync operation unifies several partial memory blocks. | |
Tuple node | |
Builds a Tuple from single values. | |
Unknown node | |
Returns an unknown (at compile- and runtime) value. | |
Typedefs | |
typedef struct ir_node | ir_node |
Procedure Graph Node. More... | |
Enumerations | |
enum | ir_relation { ir_relation_false = 0, ir_relation_equal = 1u << 0, ir_relation_less = 1u << 1, ir_relation_greater = 1u << 2, ir_relation_unordered = 1u << 3, ir_relation_less_equal = ir_relation_equal|ir_relation_less, ir_relation_greater_equal = ir_relation_equal|ir_relation_greater, ir_relation_less_greater = ir_relation_less|ir_relation_greater, ir_relation_less_equal_greater = ir_relation_equal|ir_relation_less|ir_relation_greater, ir_relation_unordered_equal = ir_relation_unordered|ir_relation_equal, ir_relation_unordered_less = ir_relation_unordered|ir_relation_less, ir_relation_unordered_less_equal = ir_relation_unordered|ir_relation_less|ir_relation_equal, ir_relation_unordered_greater = ir_relation_unordered|ir_relation_greater, ir_relation_unordered_greater_equal = ir_relation_unordered|ir_relation_greater|ir_relation_equal, ir_relation_unordered_less_greater = ir_relation_unordered|ir_relation_less|ir_relation_greater, ir_relation_true = ir_relation_equal|ir_relation_less|ir_relation_greater|ir_relation_unordered } |
Relations for comparing numbers. More... | |
enum | ir_cons_flags { cons_none = 0, cons_volatile = 1U << 0, cons_unaligned = 1U << 1, cons_floats = 1U << 2, cons_throws_exception = 1U << 3 } |
constrained flags for memory operations. More... | |
enum | op_pin_state { op_pin_state_floats = 0, op_pin_state_pinned = 1, op_pin_state_exc_pinned } |
pinned states. More... | |
Functions | |
int | get_irn_arity (const ir_node *node) |
Returns the number of predecessors without the block predecessor. More... | |
ir_node * | get_irn_n (const ir_node *node, int n) |
Returns the n-th predecessor of a node. More... | |
void | set_irn_in (ir_node *node, int arity, ir_node *const in[]) |
Replaces the old in array by a new one that will contain the ins given in the parameters. More... | |
void | set_irn_n (ir_node *node, int n, ir_node *in) |
Replaces the n-th predecessor of a node with a new one. More... | |
int | add_irn_n (ir_node *node, ir_node *in) |
Appends a new predecessor to a node. More... | |
void | set_irn_mode (ir_node *node, ir_mode *mode) |
Sets the mode struct of node. More... | |
ir_mode * | get_irn_mode (const ir_node *node) |
Returns the mode struct of a node. More... | |
ir_op * | get_irn_op (const ir_node *node) |
Returns the opcode struct of the node. More... | |
unsigned | get_irn_opcode (const ir_node *node) |
Returns the opcode-enum of the node. More... | |
const char * | get_irn_opname (const ir_node *node) |
Returns the string representation of the opcode. More... | |
ident * | get_irn_opident (const ir_node *node) |
Returns the ident for a string representation of the opcode. More... | |
ir_visited_t | get_irn_visited (const ir_node *node) |
Returns the visited counter of a node. More... | |
void | set_irn_visited (ir_node *node, ir_visited_t visited) |
Sets the visited counter of a node. More... | |
void | mark_irn_visited (ir_node *node) |
Sets visited to get_irg_visited(get_irn_irg(node)). More... | |
int | irn_visited (const ir_node *node) |
Returns 1 if visited >= get_irg_visited(get_irn_irg(node)). More... | |
int | irn_visited_else_mark (ir_node *node) |
Returns 1 if visited >= get_irg_visited(get_irn_irg(node)). More... | |
void | set_irn_link (ir_node *node, void *link) |
Sets the link of a node. More... | |
void * | get_irn_link (const ir_node *node) |
Returns the link of a node. More... | |
ir_graph * | get_irn_irg (const ir_node *node) |
Returns the ir_graph this node belongs to. More... | |
long | get_irn_node_nr (const ir_node *node) |
Outputs a unique number for this node if libFIRM is compiled for debugging, (configure with –enable-debug) else returns address of node cast to long. More... | |
int | get_irn_pinned (const ir_node *node) |
Returns whether a node is pinned. More... | |
void | set_irn_pinned (ir_node *node, int pinned) |
Sets pin state for nodes with op pin state op_pin_state_exc_pinned. More... | |
ir_node * | new_ir_node (dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mode, int arity, ir_node *const *in) |
IR node constructor. More... | |
ir_node * | get_nodes_block (const ir_node *node) |
Returns the block the node belongs to. More... | |
void | set_nodes_block (ir_node *node, ir_node *block) |
Sets the Block of a node. More... | |
const char * | get_builtin_kind_name (ir_builtin_kind kind) |
Returns a human readable string for the ir_builtin_kind. More... | |
ir_node * | get_binop_left (const ir_node *node) |
Returns left operand of binary operation node . More... | |
void | set_binop_left (ir_node *node, ir_node *left) |
Sets left operand of binary operation node . More... | |
ir_node * | get_binop_right (const ir_node *node) |
Returns rights operand of binary operation node . More... | |
void | set_binop_right (ir_node *node, ir_node *right) |
Sets right operand of binary operation node . More... | |
int | is_x_except_Proj (const ir_node *node) |
Tests whether a node is the X_except Proj of a fragile operation. More... | |
int | is_x_regular_Proj (const ir_node *node) |
Tests whether a node is the X_regular Proj of a fragile operation. More... | |
void | ir_set_throws_exception (ir_node *node, int throws_exception) |
Sets throws exception attribute of a fragile node throws_exception must be 0 or 1. More... | |
int | ir_throws_exception (const ir_node *node) |
Returns throws_exception attribute of a fragile node. More... | |
const char * | get_relation_string (ir_relation relation) |
Returns the name of an ir_relation. More... | |
ir_relation | get_negated_relation (ir_relation relation) |
Calculates the negated (Complement(R)) relation, i.e. More... | |
ir_relation | get_inversed_relation (ir_relation relation) |
Calculates the inversed (R^-1) relation, i.e., "<" –> ">". More... | |
int | is_memop (const ir_node *node) |
Returns true if node is a memory operation. More... | |
ir_node * | get_memop_mem (const ir_node *node) |
Returns the memory input of a memory operation. More... | |
void | set_memop_mem (ir_node *node, ir_node *mem) |
Sets the memory input of a memory operation. More... | |
ir_node * | skip_Proj (ir_node *node) |
Returns operand of node if node is a Proj. More... | |
const ir_node * | skip_Proj_const (const ir_node *node) |
Returns operand of node if node is a Proj. More... | |
ir_node * | skip_Id (ir_node *node) |
Returns operand of node if node is a Id. More... | |
ir_node * | skip_Tuple (ir_node *node) |
Returns corresponding operand of Tuple if node is a Proj from a Tuple. More... | |
ir_node * | skip_Pin (ir_node *node) |
Returns operand of node if node is a Pin. More... | |
ir_node * | skip_Confirm (ir_node *node) |
Returns operand of node if node is a Confirm. More... | |
int | is_cfop (const ir_node *node) |
Returns true if the operation manipulates control flow. More... | |
int | is_unknown_jump (const ir_node *node) |
Returns true if the operation jumps to an unknown destination. More... | |
int | is_fragile_op (const ir_node *node) |
Returns true if the operation can change the control flow because of an exception: Call, Div, Mod, Load, Store, Alloc, Bad. More... | |
int | is_irn_forking (const ir_node *node) |
Returns true if the operation is a forking control flow operation: Cond. More... | |
int | is_irn_const_memory (const ir_node *node) |
Returns true if the operation does not change anymemory contents although it has a memory input/output. More... | |
void | copy_node_attr (ir_graph *irg, const ir_node *old_node, ir_node *new_node) |
Copies attributes stored in the old node to a new node. More... | |
ir_type * | get_irn_type_attr (ir_node *n) |
Returns the type attribute of a node n (TypeConst, Call, Alloc, Free) or NULL. More... | |
ir_entity * | get_irn_entity_attr (ir_node *n) |
Returns the entity attribute of a node n (Address, Offset, Sel) or NULL. More... | |
int | is_irn_constlike (const ir_node *node) |
Returns non-zero for constant-like nodes. More... | |
int | is_irn_keep (const ir_node *node) |
Returns non-zero for nodes that are allowed to have keep-alives and are neither Block nor PhiM. More... | |
int | is_irn_start_block_placed (const ir_node *node) |
Returns non-zero for nodes that are always placed in the start block. More... | |
const char * | get_cond_jmp_predicate_name (cond_jmp_predicate pred) |
Returns the string representation of the jump prediction. More... | |
void * | get_irn_generic_attr (ir_node *node) |
Returns a pointer to the node attributes. More... | |
const void * | get_irn_generic_attr_const (const ir_node *node) |
Returns a pointer to the node attributes. More... | |
unsigned | get_irn_idx (const ir_node *node) |
Returns the unique node index for the node in its graph. More... | |
void | set_irn_dbg_info (ir_node *n, dbg_info *db) |
Sets the debug information of a node. More... | |
dbg_info * | get_irn_dbg_info (const ir_node *n) |
Returns the debug information of an node. More... | |
const char * | gdb_node_helper (const void *firm_object) |
Returns a descriptive name of a node (containing type+number) More... | |
int | is_binop (const ir_node *node) |
Test if node is a binop. More... | |
int | is_entconst (const ir_node *node) |
Test if node is a entconst. More... | |
ir_entity * | get_entconst_entity (const ir_node *node) |
Returns entity attribute of an entconst node. More... | |
void | set_entconst_entity (ir_node *node, ir_entity *entity) |
Sets entity attribute of an entconst node. More... | |
int | is_typeconst (const ir_node *node) |
Test if node is a typeconst. More... | |
ir_type * | get_typeconst_type (const ir_node *node) |
Returns type attribute of a typeconst node. More... | |
void | set_typeconst_type (ir_node *node, ir_type *type) |
Sets type attribute of a typeconst node. More... | |
ir_node - a datatype representing a Firm node
The common fields are:
Procedure Graph Node.
Definition at line 53 of file firm_types.h.
enum ir_cons_flags |
constrained flags for memory operations.
Definition at line 183 of file firm_types.h.
enum ir_relation |
Relations for comparing numbers.
Definition at line 159 of file firm_types.h.
enum op_pin_state |
pinned states.
Definition at line 198 of file firm_types.h.
Appends a new predecessor to a node.
This only works for nodes with dynamic arity!
Copies attributes stored in the old node to a new node.
Assumes both have the same opcode and sufficient size.
irg | The irg of the new_node (get_irn_irg on it might not work yet) |
old_node | the node where the attributes are copied from |
new_node | node the attributes get copies to. |
This copies all essential information to the new node. It does not copy temporary or calculated information like visited flags or results of dominance or loop calculations.
const char* gdb_node_helper | ( | const void * | firm_object | ) |
Returns a descriptive name of a node (containing type+number)
const char* get_builtin_kind_name | ( | ir_builtin_kind | kind | ) |
Returns a human readable string for the ir_builtin_kind.
const char* get_cond_jmp_predicate_name | ( | cond_jmp_predicate | pred | ) |
Returns the string representation of the jump prediction.
Returns entity attribute of an entconst node.
Definition at line 3534 of file gen_irnode.c.
ir_relation get_inversed_relation | ( | ir_relation | relation | ) |
Calculates the inversed (R^-1) relation, i.e., "<" –> ">".
int get_irn_arity | ( | const ir_node * | node | ) |
Returns the number of predecessors without the block predecessor.
node | the IR-node |
Returns the debug information of an node.
n | The node. |
Returns the entity attribute of a node n (Address, Offset, Sel) or NULL.
void* get_irn_generic_attr | ( | ir_node * | node | ) |
Returns a pointer to the node attributes.
Used for accessing attributes of user-defined nodes.
const void* get_irn_generic_attr_const | ( | const ir_node * | node | ) |
Returns a pointer to the node attributes.
Used for accessing attributes of user-defined nodes.
unsigned get_irn_idx | ( | const ir_node * | node | ) |
Returns the unique node index for the node in its graph.
This index is used to access phase information for this node.
Returns the ir_graph this node belongs to.
Referenced by new_rd_Add(), new_rd_Alloc(), new_rd_And(), new_rd_Bitcast(), new_rd_Builtin(), new_rd_Call(), new_rd_Cmp(), new_rd_Cond(), new_rd_Confirm(), new_rd_Conv(), new_rd_CopyB(), new_rd_Div(), new_rd_Eor(), new_rd_Free(), new_rd_IJmp(), new_rd_Jmp(), new_rd_Load(), new_rd_Member(), new_rd_Minus(), new_rd_Mod(), new_rd_Mul(), new_rd_Mulh(), new_rd_Mux(), new_rd_Not(), new_rd_Or(), new_rd_Phi(), new_rd_Pin(), new_rd_Proj(), new_rd_Raise(), new_rd_Return(), new_rd_Sel(), new_rd_Shl(), new_rd_Shr(), new_rd_Shrs(), new_rd_Store(), new_rd_Sub(), new_rd_Switch(), new_rd_Sync(), and new_rd_Tuple().
void* get_irn_link | ( | const ir_node * | node | ) |
Returns the link of a node.
Returns the mode struct of a node.
Referenced by new_rd_Confirm(), and new_rd_Pin().
Returns the n-th predecessor of a node.
This function removes Id predecessors.
long get_irn_node_nr | ( | const ir_node * | node | ) |
Outputs a unique number for this node if libFIRM is compiled for debugging, (configure with –enable-debug) else returns address of node cast to long.
unsigned get_irn_opcode | ( | const ir_node * | node | ) |
Returns the opcode-enum of the node.
Returns the ident for a string representation of the opcode.
const char* get_irn_opname | ( | const ir_node * | node | ) |
Returns the string representation of the opcode.
int get_irn_pinned | ( | const ir_node * | node | ) |
Returns whether a node is pinned.
A pinned node must not be moved to a different block even if the operands would allow this. Returns 1 if node is pinned, 0 otherwise.
Returns the type attribute of a node n (TypeConst, Call, Alloc, Free) or NULL.
ir_visited_t get_irn_visited | ( | const ir_node * | node | ) |
Returns the visited counter of a node.
ir_relation get_negated_relation | ( | ir_relation | relation | ) |
Calculates the negated (Complement(R)) relation, i.e.
"<" –> ">="
Returns the block the node belongs to.
This is only possible for pinned nodes or if the graph is in pinned state. Otherwise the block may be incorrect. This condition is now checked by an assertion.
This works for all except Block. It can return Blocks or the Bad node.
To express the difference to access routines that work for all nodes we use infix "nodes" and do not name this function get_irn_block().
Referenced by new_rd_Proj().
const char* get_relation_string | ( | ir_relation | relation | ) |
Returns the name of an ir_relation.
Returns type attribute of a typeconst node.
Definition at line 3549 of file gen_irnode.c.
void ir_set_throws_exception | ( | ir_node * | node, |
int | throws_exception | ||
) |
Sets throws exception attribute of a fragile node throws_exception
must be 0 or 1.
int ir_throws_exception | ( | const ir_node * | node | ) |
Returns throws_exception attribute of a fragile node.
int irn_visited | ( | const ir_node * | node | ) |
Returns 1 if visited >= get_irg_visited(get_irn_irg(node)).
int irn_visited_else_mark | ( | ir_node * | node | ) |
Returns 1 if visited >= get_irg_visited(get_irn_irg(node)).
Marks the node visited, if it was not.
int is_binop | ( | const ir_node * | node | ) |
Test if node is a binop.
Definition at line 3524 of file gen_irnode.c.
int is_cfop | ( | const ir_node * | node | ) |
Returns true if the operation manipulates control flow.
int is_entconst | ( | const ir_node * | node | ) |
Test if node is a entconst.
Definition at line 3529 of file gen_irnode.c.
int is_fragile_op | ( | const ir_node * | node | ) |
Returns true if the operation can change the control flow because of an exception: Call, Div, Mod, Load, Store, Alloc, Bad.
Raise is not fragile, but a unconditional jump.
int is_irn_const_memory | ( | const ir_node * | node | ) |
Returns true if the operation does not change anymemory contents although it has a memory input/output.
int is_irn_constlike | ( | const ir_node * | node | ) |
Returns non-zero for constant-like nodes.
int is_irn_forking | ( | const ir_node * | node | ) |
Returns true if the operation is a forking control flow operation: Cond.
int is_irn_keep | ( | const ir_node * | node | ) |
Returns non-zero for nodes that are allowed to have keep-alives and are neither Block nor PhiM.
int is_irn_start_block_placed | ( | const ir_node * | node | ) |
Returns non-zero for nodes that are always placed in the start block.
int is_memop | ( | const ir_node * | node | ) |
Returns true if node
is a memory operation.
A memory operation is a node with an opcode that has irop_flag_uses_memory set. It is guaranteed to have (exactly) one memory input.
int is_typeconst | ( | const ir_node * | node | ) |
Test if node is a typeconst.
Definition at line 3544 of file gen_irnode.c.
int is_unknown_jump | ( | const ir_node * | node | ) |
Returns true if the operation jumps to an unknown destination.
See irop_flag_unknown_jump for a detailed explanation
int is_x_except_Proj | ( | const ir_node * | node | ) |
Tests whether a node is the X_except Proj of a fragile operation.
int is_x_regular_Proj | ( | const ir_node * | node | ) |
Tests whether a node is the X_regular Proj of a fragile operation.
void mark_irn_visited | ( | ir_node * | node | ) |
Sets visited to get_irg_visited(get_irn_irg(node)).
ir_node* new_ir_node | ( | dbg_info * | db, |
ir_graph * | irg, | ||
ir_node * | block, | ||
ir_op * | op, | ||
ir_mode * | mode, | ||
int | arity, | ||
ir_node *const * | in | ||
) |
IR node constructor.
Create a new IR node in irg, with an op, mode, arity and some incoming IR nodes. Normally you should not use this constructor directly unless you registered custom opcodes. For the default opcodes firm provides specific constructors.
db | Debug info. |
irg | IR-graph on with this new node should be constructed. |
block | The block the new node belongs to |
op | The opcode of the new node. |
mode | The mode of the new node. |
arity | The arity of the new node, <0 if can be changed dynamically. |
in | An array of arity predecessor nodes. |
Referenced by new_rd_Add(), new_rd_Address(), new_rd_Align(), new_rd_Alloc(), new_rd_And(), new_rd_Bad(), new_rd_Bitcast(), new_rd_Block(), new_rd_Builtin(), new_rd_Call(), new_rd_Cmp(), new_rd_Cond(), new_rd_Confirm(), new_rd_Const(), new_rd_Conv(), new_rd_CopyB(), new_rd_Div(), new_rd_Dummy(), new_rd_End(), new_rd_Eor(), new_rd_Free(), new_rd_IJmp(), new_rd_Jmp(), new_rd_Load(), new_rd_Member(), new_rd_Minus(), new_rd_Mod(), new_rd_Mul(), new_rd_Mulh(), new_rd_Mux(), new_rd_NoMem(), new_rd_Not(), new_rd_Offset(), new_rd_Or(), new_rd_Phi(), new_rd_Pin(), new_rd_Proj(), new_rd_Raise(), new_rd_Return(), new_rd_Sel(), new_rd_Shl(), new_rd_Shr(), new_rd_Shrs(), new_rd_Size(), new_rd_Start(), new_rd_Store(), new_rd_Sub(), new_rd_Switch(), new_rd_Sync(), new_rd_Tuple(), and new_rd_Unknown().
Sets right operand of binary operation node
.
Sets entity attribute of an entconst node.
Definition at line 3539 of file gen_irnode.c.
Sets the debug information of a node.
n | The node. |
db | The debug info. |
Replaces the old in array by a new one that will contain the ins given in the parameters.
Conserves the block predecessor. It copies the array passed. This function is necessary to adjust in arrays of blocks, calls and phis. "in" must contain all predecessors except the block that are required for the nodes opcode.
void set_irn_link | ( | ir_node * | node, |
void * | link | ||
) |
Sets the link of a node.
Only allowed if the graph is NOT in phase_building.
Replaces the n-th predecessor of a node with a new one.
void set_irn_pinned | ( | ir_node * | node, |
int | pinned | ||
) |
Sets pin state for nodes with op pin state op_pin_state_exc_pinned.
pinned
should be 0 or 1,
void set_irn_visited | ( | ir_node * | node, |
ir_visited_t | visited | ||
) |
Sets the visited counter of a node.
Sets type attribute of a typeconst node.
Definition at line 3554 of file gen_irnode.c.