Commit c893b2e8 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ir: Specify the operands of Anchor.

parent 27ce5101
......@@ -599,12 +599,11 @@ ir_node *new_r_Anchor(ir_graph *irg)
res->in[0] = res;
/* we can't have NULL inputs so reference ourselves for now */
int const arity = anchor_last + 1;
ir_node *in[arity];
for (size_t i = 0; i < (size_t)arity; ++i) {
ir_node *in[n_Anchor_max + 1];
for (size_t i = 0; i < ARRAY_SIZE(in); ++i) {
in[i] = res;
}
set_irn_in(res, arity, in);
set_irn_in(res, ARRAY_SIZE(in), in);
return res;
}
......
......@@ -123,82 +123,82 @@ int node_is_in_irgs_storage(const ir_graph *irg, const ir_node *n);
/** Returns the start block of a graph. */
static inline ir_node *get_irg_start_block_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_start_block);
return get_Anchor_start_block(irg->anchor);
}
static inline void set_irg_start_block_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_start_block, node);
set_Anchor_start_block(irg->anchor, node);
}
static inline ir_node *get_irg_start_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_start);
return get_Anchor_start(irg->anchor);
}
static inline void set_irg_start_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_start, node);
set_Anchor_start(irg->anchor, node);
}
static inline ir_node *get_irg_end_block_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_end_block);
return get_Anchor_end_block(irg->anchor);
}
static inline void set_irg_end_block_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_end_block, node);
set_Anchor_end_block(irg->anchor, node);
}
static inline ir_node *get_irg_end_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_end);
return get_Anchor_end(irg->anchor);
}
static inline void set_irg_end_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_end, node);
set_Anchor_end(irg->anchor, node);
}
static inline ir_node *get_irg_frame_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_frame);
return get_Anchor_frame(irg->anchor);
}
static inline void set_irg_frame_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_frame, node);
set_Anchor_frame(irg->anchor, node);
}
static inline ir_node *get_irg_initial_mem_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_initial_mem);
return get_Anchor_initial_mem(irg->anchor);
}
static inline void set_irg_initial_mem_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_initial_mem, node);
set_Anchor_initial_mem(irg->anchor, node);
}
static inline ir_node *get_irg_args_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_args);
return get_Anchor_args(irg->anchor);
}
static inline void set_irg_args_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_args, node);
set_Anchor_args(irg->anchor, node);
}
static inline ir_node *get_irg_no_mem_(const ir_graph *irg)
{
return get_irn_n(irg->anchor, anchor_no_mem);
return get_Anchor_no_mem(irg->anchor);
}
static inline void set_irg_no_mem_(ir_graph *irg, ir_node *node)
{
set_irn_n(irg->anchor, anchor_no_mem, node);
set_Anchor_no_mem(irg->anchor, node);
}
static inline ir_entity *get_irg_entity_(const ir_graph *irg)
......
......@@ -439,24 +439,6 @@ typedef struct irg_edge_info_t {
typedef irg_edge_info_t irg_edges_info_t[EDGE_KIND_LAST+1];
/**
* Index constants for nodes that can be accessed through the graph anchor node.
*/
typedef enum irg_anchors {
anchor_first,
anchor_end_block = anchor_first, /**< block the end node will belong to,
same as Anchors block */
anchor_start_block, /**< block the start node will belong to */
anchor_end, /**< end node of this ir_graph */
anchor_start, /**< start node of this ir_graph */
anchor_frame, /**< methods frame */
anchor_initial_mem, /**< initial memory of this graph */
anchor_args, /**< methods arguments */
anchor_no_mem, /**< NoMem node of this ir_graph, the one and only in this graph */
anchor_last = anchor_no_mem
} irg_anchors;
ENUM_COUNTABLE(irg_anchors)
/** A callgraph entry for callees. */
typedef struct cg_callee_entry {
ir_graph *irg; /**< The called irg. */
......
......@@ -79,14 +79,23 @@ class Alloc:
@op
class Anchor:
"""utiliy node used to "hold" nodes in a graph that might possibly not be
"""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.
Each firm-graph contains exactly one anchor node whose address is always
known. All other well-known graph-nodes like Start, End, NoMem, Bad, ...
known. All other well-known graph-nodes like Start, End, NoMem, ...
are found by looking at the respective Anchor operand."""
ins = [
("end_block", "block the end node belongs to" ),
("start_block", "block the start node belongs to" ),
("end", "end node of this ir_graph" ),
("start", "start node of this ir_graph" ),
("frame", "frame of this ir_graph" ),
("initial_mem", "initial memory of this ir_graph" ),
("args", "argument proj of the start node" ),
("no_mem", "the only NoMem node of this ir_graph" ),
]
mode = "mode_ANY"
arity = "variable"
flags = [ "dump_noblock" ]
pinned = "yes"
singleton = True
......
Markdown is supported
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