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
93193708
Commit
93193708
authored
Jul 12, 2012
by
Christoph Mallon
Browse files
Directly use pmap_get() instead of pmap_contains() + pmap_get().
parent
cdcd17c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ana/trouts.c
View file @
93193708
...
...
@@ -53,12 +53,10 @@ static pmap *type_arraytype_map = NULL;
*/
static
ir_node
**
get_entity_access_array
(
const
ir_entity
*
ent
)
{
ir_node
**
res
;
if
(
!
entity_access_map
)
entity_access_map
=
pmap_create
();
if
(
pmap_contains
(
entity_access_map
,
ent
))
{
res
=
pmap_get
(
ir_node
*
,
entity_access_map
,
ent
);
}
else
{
ir_node
**
res
=
pmap_get
(
ir_node
*
,
entity_access_map
,
ent
);
if
(
!
res
)
{
res
=
NEW_ARR_F
(
ir_node
*
,
0
);
pmap_insert
(
entity_access_map
,
ent
,
(
void
*
)
res
);
}
...
...
@@ -77,12 +75,10 @@ static void set_entity_access_array(const ir_entity *ent, ir_node **accs)
*/
static
ir_node
**
get_entity_reference_array
(
const
ir_entity
*
ent
)
{
ir_node
**
res
;
if
(
!
entity_reference_map
)
entity_reference_map
=
pmap_create
();
if
(
pmap_contains
(
entity_reference_map
,
ent
))
{
res
=
pmap_get
(
ir_node
*
,
entity_reference_map
,
ent
);
}
else
{
ir_node
**
res
=
pmap_get
(
ir_node
*
,
entity_reference_map
,
ent
);
if
(
!
res
)
{
res
=
NEW_ARR_F
(
ir_node
*
,
0
);
pmap_insert
(
entity_reference_map
,
ent
,
(
void
*
)
res
);
}
...
...
@@ -101,12 +97,10 @@ static void set_entity_reference_array(const ir_entity *ent, ir_node **refs)
*/
static
ir_node
**
get_type_alloc_array
(
const
ir_type
*
tp
)
{
ir_node
**
res
;
if
(
!
type_alloc_map
)
type_alloc_map
=
pmap_create
();
if
(
pmap_contains
(
type_alloc_map
,
tp
))
{
res
=
pmap_get
(
ir_node
*
,
type_alloc_map
,
tp
);
}
else
{
ir_node
**
res
=
pmap_get
(
ir_node
*
,
type_alloc_map
,
tp
);
if
(
!
res
)
{
res
=
NEW_ARR_F
(
ir_node
*
,
0
);
pmap_insert
(
type_alloc_map
,
tp
,
(
void
*
)
res
);
}
...
...
@@ -125,12 +119,10 @@ static void set_type_alloc_array(const ir_type *tp, ir_node **alls)
*/
static
ir_node
**
get_type_cast_array
(
const
ir_type
*
tp
)
{
ir_node
**
res
;
if
(
!
type_cast_map
)
type_cast_map
=
pmap_create
();
if
(
pmap_contains
(
type_cast_map
,
tp
))
{
res
=
pmap_get
(
ir_node
*
,
type_cast_map
,
tp
);
}
else
{
ir_node
**
res
=
pmap_get
(
ir_node
*
,
type_cast_map
,
tp
);
if
(
!
res
)
{
res
=
NEW_ARR_F
(
ir_node
*
,
0
);
pmap_insert
(
type_cast_map
,
tp
,
(
void
*
)
res
);
}
...
...
@@ -148,12 +140,10 @@ static void set_type_cast_array(const ir_type *tp, ir_node **alls)
*/
static
ir_type
**
get_type_pointertype_array
(
const
ir_type
*
tp
)
{
ir_type
**
res
;
if
(
!
type_pointertype_map
)
type_pointertype_map
=
pmap_create
();
if
(
pmap_contains
(
type_pointertype_map
,
tp
))
{
res
=
pmap_get
(
ir_type
*
,
type_pointertype_map
,
tp
);
}
else
{
ir_type
**
res
=
pmap_get
(
ir_type
*
,
type_pointertype_map
,
tp
);
if
(
!
res
)
{
res
=
NEW_ARR_F
(
ir_type
*
,
0
);
pmap_insert
(
type_pointertype_map
,
tp
,
(
void
*
)
res
);
}
...
...
@@ -172,12 +162,10 @@ static void set_type_pointertype_array(const ir_type *tp, ir_type **pts)
*/
static
ir_type
**
get_type_arraytype_array
(
const
ir_type
*
tp
)
{
ir_type
**
res
;
if
(
!
type_arraytype_map
)
type_arraytype_map
=
pmap_create
();
if
(
pmap_contains
(
type_arraytype_map
,
tp
))
{
res
=
pmap_get
(
ir_type
*
,
type_arraytype_map
,
tp
);
}
else
{
ir_type
**
res
=
pmap_get
(
ir_type
*
,
type_arraytype_map
,
tp
);
if
(
!
res
)
{
res
=
NEW_ARR_F
(
ir_type
*
,
0
);
pmap_insert
(
type_arraytype_map
,
tp
,
(
void
*
)
res
);
}
...
...
ir/ir/irdump.c
View file @
93193708
...
...
@@ -469,13 +469,10 @@ static void init_irdump(void)
*/
static
void
*
ird_get_irn_link
(
const
ir_node
*
n
)
{
void
*
res
=
NULL
;
if
(
irdump_link_map
==
NULL
)
return
NULL
;
if
(
pmap_contains
(
irdump_link_map
,
n
))
res
=
pmap_get
(
void
,
irdump_link_map
,
n
);
return
res
;
return
pmap_get
(
void
,
irdump_link_map
,
n
);
}
/**
...
...
@@ -493,13 +490,10 @@ static void ird_set_irn_link(const ir_node *n, void *x)
*/
static
void
*
ird_get_irg_link
(
const
ir_graph
*
irg
)
{
void
*
res
=
NULL
;
if
(
irdump_link_map
==
NULL
)
return
NULL
;
if
(
pmap_contains
(
irdump_link_map
,
irg
))
res
=
pmap_get
(
void
,
irdump_link_map
,
irg
);
return
res
;
return
pmap_get
(
void
,
irdump_link_map
,
irg
);
}
/**
...
...
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