Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
cdcd17c4
Commit
cdcd17c4
authored
Jul 12, 2012
by
Christoph Mallon
Browse files
Add a wrapper macro for pmap_get(), which has the return type as additional parameter.
parent
c719c20b
Changes
27
Hide whitespace changes
Inline
Side-by-side
ir/ir/irverify.c
View file @
cdcd17c4
...
...
@@ -1891,7 +1891,7 @@ static int check_block_cfg(const ir_node *block, check_cfg_env_t *env)
branch
=
skip_Tuple
(
branch
);
if
(
is_Bad
(
branch
))
continue
;
former_dest
=
(
ir_node
*
)
pmap_get
(
branch_nodes
,
branch
);
former_dest
=
pmap_get
(
ir_node
,
branch_nodes
,
branch
);
ASSERT_AND_RET_DBG
(
former_dest
==
NULL
||
is_unknown_jump
(
skip_Proj
(
branch
)),
"Multiple users on mode_X node"
,
0
,
ir_printf
(
"node %+F
\n
"
,
branch
);
...
...
@@ -1904,7 +1904,7 @@ static int check_block_cfg(const ir_node *block, check_cfg_env_t *env)
if
(
is_Proj
(
branch
))
{
branch
=
skip_Proj
(
branch
);
}
former_branch
=
(
ir_node
*
)
pmap_get
(
branch_nodes
,
branch_block
);
former_branch
=
pmap_get
(
ir_node
,
branch_nodes
,
branch_block
);
ASSERT_AND_RET_DBG
(
former_branch
==
NULL
||
former_branch
==
branch
,
"Multiple branching nodes in a block"
,
0
,
...
...
@@ -1939,7 +1939,7 @@ static void check_cfg_walk_func(ir_node *node, void *data)
static
int
verify_block_branch
(
const
ir_node
*
block
,
check_cfg_env_t
*
env
)
{
ir_node
*
branch
=
(
ir_node
*
)
pmap_get
(
env
->
branch_nodes
,
block
);
ir_node
*
branch
=
pmap_get
(
ir_node
,
env
->
branch_nodes
,
block
);
ASSERT_AND_RET_DBG
(
branch
!=
NULL
||
ir_nodeset_contains
(
&
env
->
kept_nodes
,
block
)
||
block
==
get_irg_end_block
(
get_irn_irg
(
block
)),
...
...
ir/lower/lower_builtins.c
View file @
cdcd17c4
...
...
@@ -99,7 +99,7 @@ static void replace_with_call(ir_node *node)
snprintf
(
buf
,
sizeof
(
buf
),
"__%s%s2"
,
name
,
gcc_machmode
);
id
=
new_id_from_str
(
buf
);
entity
=
(
ir_entity
*
)
pmap_get
(
entities
,
id
);
entity
=
pmap_get
(
ir_entity
,
entities
,
id
);
if
(
entity
==
NULL
)
{
entity
=
create_compilerlib_entity
(
id
,
mtp
);
pmap_insert
(
entities
,
id
,
entity
);
...
...
ir/lower/lower_calls.c
View file @
cdcd17c4
...
...
@@ -51,7 +51,7 @@ static pmap *lowered_mtps;
*/
static
ir_type
*
get_pointer_type
(
ir_type
*
dest_type
)
{
ir_type
*
res
=
(
ir_type
*
)
pmap_get
(
pointer_types
,
dest_type
);
ir_type
*
res
=
pmap_get
(
ir_type
,
pointer_types
,
dest_type
);
if
(
res
==
NULL
)
{
res
=
new_type_pointer
(
dest_type
);
pmap_insert
(
pointer_types
,
dest_type
,
res
);
...
...
@@ -119,7 +119,7 @@ static ir_type *lower_mtp(compound_call_lowering_flags flags, ir_type *mtp)
if
(
!
is_Method_type
(
mtp
))
return
mtp
;
lowered
=
(
ir_type
*
)
pmap_get
(
lowered_mtps
,
mtp
);
lowered
=
pmap_get
(
ir_type
,
lowered_mtps
,
mtp
);
if
(
lowered
!=
NULL
)
return
lowered
;
...
...
@@ -508,7 +508,7 @@ static ir_node *get_dummy_sel(ir_graph *irg, ir_node *block, ir_type *tp,
wlk_env
*
env
)
{
/* use a map the check if we already create such an entity */
ir_entity
*
ent
=
(
ir_entity
*
)
pmap_get
(
env
->
dummy_map
,
tp
);
ir_entity
*
ent
=
pmap_get
(
ir_entity
,
env
->
dummy_map
,
tp
);
if
(
ent
==
NULL
)
{
ir_type
*
ft
=
get_irg_frame_type
(
irg
);
ident
*
dummy_id
=
id_unique
(
"dummy.%u"
);
...
...
ir/lower/lower_dw.c
View file @
cdcd17c4
...
...
@@ -1739,7 +1739,7 @@ static ir_type *lower_mtp(ir_type *mtp)
size_t
n_res
;
bool
must_be_lowered
;
res
=
(
ir_type
*
)
pmap_get
(
lowered_type
,
mtp
);
res
=
pmap_get
(
ir_type
,
lowered_type
,
mtp
);
if
(
res
!=
NULL
)
return
res
;
if
(
type_visited
(
mtp
))
...
...
@@ -2377,7 +2377,7 @@ static ir_type *lower_Builtin_type_high(ir_type *mtp)
size_t
n_results
;
bool
must_be_lowered
;
res
=
(
ir_type
*
)
pmap_get
(
lowered_builtin_type_high
,
mtp
);
res
=
pmap_get
(
ir_type
,
lowered_builtin_type_high
,
mtp
);
if
(
res
!=
NULL
)
return
res
;
...
...
@@ -2473,7 +2473,7 @@ static ir_type *lower_Builtin_type_low(ir_type *mtp)
size_t
n_results
;
bool
must_be_lowered
;
res
=
(
ir_type
*
)
pmap_get
(
lowered_builtin_type_low
,
mtp
);
res
=
pmap_get
(
ir_type
,
lowered_builtin_type_low
,
mtp
);
if
(
res
!=
NULL
)
return
res
;
...
...
ir/lower/lower_intrinsics.c
View file @
cdcd17c4
...
...
@@ -70,7 +70,7 @@ static void call_mapper(ir_node *node, void *env)
return
;
ent
=
get_SymConst_entity
(
symconst
);
r
=
(
const
i_call_record
*
)
pmap_get
(
wenv
->
c_map
,
ent
);
r
=
pmap_get
(
i_call_record
const
,
wenv
->
c_map
,
ent
);
if
(
r
!=
NULL
)
{
wenv
->
nr_of_intrinsics
+=
r
->
i_mapper
(
node
,
r
->
ctx
)
?
1
:
0
;
...
...
ir/lower/lower_softfloat.c
View file @
cdcd17c4
...
...
@@ -379,7 +379,7 @@ static ir_type *lower_method_type(ir_type *mtp)
size_t
n_param
;
size_t
n_res
;
res
=
(
ir_type
*
)
pmap_get
(
lowered_type
,
mtp
);
res
=
pmap_get
(
ir_type
,
lowered_type
,
mtp
);
if
(
res
!=
NULL
)
return
res
;
...
...
ir/opt/opt_inline.c
View file @
cdcd17c4
...
...
@@ -1084,7 +1084,7 @@ void inline_leaf_functions(unsigned maxsize, unsigned leafsize,
continue
;
}
calleee
=
(
ir_graph
*
)
pmap_get
(
copied_graphs
,
callee
);
calleee
=
pmap_get
(
ir_graph
,
copied_graphs
,
callee
);
if
(
calleee
!=
NULL
)
{
/*
* Remap callee if we have a copy.
...
...
@@ -1607,7 +1607,7 @@ static void inline_into(ir_graph *irg, unsigned maxsize,
continue
;
}
calleee
=
(
ir_graph
*
)
pmap_get
(
copied_graphs
,
callee
);
calleee
=
pmap_get
(
ir_graph
,
copied_graphs
,
callee
);
if
(
calleee
!=
NULL
)
{
int
benefice
=
curr_call
->
benefice
;
/*
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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