Commit 1cfde28f authored by Michael Beck's avatar Michael Beck
Browse files

get_irn_generic_attr() cannot have a const argument

__get_irn_generic_attr() added to speed up backend

[r13950]
parent 85238f04
......@@ -597,17 +597,15 @@ get_irn_block_attr(ir_node *node) {
}
load_attr
get_irn_load_attr(ir_node *node)
{
assert(node->op == op_Load);
return node->attr.load;
get_irn_load_attr(ir_node *node) {
assert(node->op == op_Load);
return node->attr.load;
}
store_attr
get_irn_store_attr(ir_node *node)
{
assert(node->op == op_Store);
return node->attr.store;
get_irn_store_attr(ir_node *node) {
assert(node->op == op_Store);
return node->attr.store;
}
except_attr
......@@ -617,9 +615,9 @@ get_irn_except_attr(ir_node *node) {
return node->attr.except;
}
void *
get_irn_generic_attr(const ir_node *node) {
return &node->attr;
void *(get_irn_generic_attr)(ir_node *node) {
assert(is_ir_node(node));
return _get_irn_generic_attr(node);
}
unsigned (get_irn_idx)(const ir_node *node) {
......
......@@ -1334,7 +1334,7 @@ unsigned register_additional_node_data(unsigned size);
* Return a pointer to the node attributes.
* Needed for user-defined nodes.
*/
void *get_irn_generic_attr(const ir_node *node);
void *get_irn_generic_attr(ir_node *node);
/**
* Returns the unique node index for the node in its graph.
......
......@@ -991,6 +991,10 @@ static INLINE int _get_Psi_n_conds(ir_node *node) {
return _get_irn_arity(node) >> 1;
}
static INLINE void *_get_irn_generic_attr(ir_node *node) {
return &node->attr;
}
static INLINE unsigned _get_irn_idx(const ir_node *node) {
return node->node_idx;
}
......@@ -1076,6 +1080,7 @@ static INLINE unsigned _get_irn_idx(const ir_node *node) {
#define get_Cond_jmp_pred(node) _get_Cond_jmp_pred(node)
#define set_Cond_jmp_pred(node, pred) _set_Cond_jmp_pred(node, pred)
#define get_Psi_n_conds(node) _get_Psi_n_conds(node)
#define get_irn_generic_attr(node) _get_irn_generic_attr(node)
#define get_irn_idx(node) _get_irn_idx(node)
#define get_irn_deps(node) _get_irn_deps(node)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment