Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
c893b2e8
Commit
c893b2e8
authored
Nov 17, 2014
by
Christoph Mallon
Browse files
ir: Specify the operands of Anchor.
parent
27ce5101
Changes
4
Hide whitespace changes
Inline
Side-by-side
ir/ir/ircons.c
View file @
c893b2e8
...
...
@@ -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
;
}
...
...
ir/ir/irgraph_t.h
View file @
c893b2e8
...
...
@@ -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
,
a
nchor_start_block
);
return
get_
A
nchor_start_block
(
irg
->
anchor
);
}
static
inline
void
set_irg_start_block_
(
ir_graph
*
irg
,
ir_node
*
node
)
{
set_
irn_n
(
irg
->
anchor
,
a
nchor_start_block
,
node
);
set_
A
nchor_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
,
a
nchor_initial_mem
);
return
get_
A
nchor_initial_mem
(
irg
->
anchor
);
}
static
inline
void
set_irg_initial_mem_
(
ir_graph
*
irg
,
ir_node
*
node
)
{
set_
irn_n
(
irg
->
anchor
,
a
nchor_initial_mem
,
node
);
set_
A
nchor_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
)
...
...
ir/ir/irtypes.h
View file @
c893b2e8
...
...
@@ -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. */
...
...
scripts/ir_spec.py
View file @
c893b2e8
...
...
@@ -79,14 +79,23 @@ class Alloc:
@
op
class
Anchor
:
"""
u
tiliy node used to "hold" nodes in a graph that might possibly not be
"""
U
tili
t
y 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment