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
a1855e22
Commit
a1855e22
authored
Nov 22, 2014
by
Christoph Mallon
Browse files
be: Factorise common dump formatters for booleans and registers.
This replaces several 1/0 and true/false by yes/no.
parent
b745f81b
Changes
5
Hide whitespace changes
Inline
Side-by-side
ir/be/arm/arm_new_nodes.c
View file @
a1855e22
...
...
@@ -98,10 +98,8 @@ static void arm_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
ir_fprintf
(
F
,
"load_store_mode = %+F
\n
"
,
attr
->
load_store_mode
);
ir_fprintf
(
F
,
"entity = %+F
\n
"
,
attr
->
entity
);
fprintf
(
F
,
"offset = %ld
\n
"
,
attr
->
offset
);
fprintf
(
F
,
"is_frame_entity = %s
\n
"
,
attr
->
is_frame_entity
?
"yes"
:
"no"
);
fprintf
(
F
,
"entity_sign = %s
\n
"
,
attr
->
entity_sign
?
"yes"
:
"no"
);
fprintf
(
F
,
"is_frame_entity = %s
\n
"
,
be_dump_yesno
(
attr
->
is_frame_entity
));
fprintf
(
F
,
"entity_sign = %s
\n
"
,
be_dump_yesno
(
attr
->
entity_sign
));
}
if
(
has_shifter_operand
(
n
))
{
const
arm_shifter_operand_t
*
attr
...
...
ir/be/bedump.c
View file @
a1855e22
...
...
@@ -243,14 +243,14 @@ void be_dump_reqs_and_registers(FILE *F, const ir_node *node)
fprintf
(
F
,
"inreq #%d = "
,
i
);
dump_register_req
(
F
,
req
);
arch_register_t
const
*
const
reg
=
be_get_info
(
skip_Proj_const
(
op
))
->
out_infos
?
arch_get_irn_register
(
op
)
:
NULL
;
fprintf
(
F
,
" [%s]
\n
"
,
reg
?
reg
->
name
:
"n/a"
);
fprintf
(
F
,
" [%s]
\n
"
,
be_dump_
reg
_
name
(
reg
)
);
}
be_foreach_out
(
node
,
o
)
{
const
arch_register_req_t
*
req
=
arch_get_irn_register_req_out
(
node
,
o
);
fprintf
(
F
,
"outreq #%u = "
,
o
);
dump_register_req
(
F
,
req
);
const
arch_register_t
*
reg
=
arch_get_irn_register_out
(
node
,
o
);
fprintf
(
F
,
" [%s]
\n
"
,
reg
!=
NULL
?
reg
->
name
:
"n/a"
);
fprintf
(
F
,
" [%s]
\n
"
,
be_dump_
reg
_
name
(
reg
)
);
}
fprintf
(
F
,
"flags ="
);
...
...
ir/be/bedump.h
View file @
a1855e22
...
...
@@ -13,8 +13,8 @@
#include <stdio.h>
#include <stdbool.h>
#include "firm_types.h"
#include "be
_types
.h"
#include "be
arch
.h"
/**
* Dump interference graph
...
...
@@ -42,4 +42,14 @@ void be_dump_liveness_block(be_lv_t *lv, FILE *F, const ir_node *block);
void
be_dump_reqs_and_registers
(
FILE
*
F
,
const
ir_node
*
node
);
static
inline
char
const
*
be_dump_reg_name
(
arch_register_t
const
*
const
reg
)
{
return
reg
?
reg
->
name
:
"n/a"
;
}
static
inline
char
const
*
be_dump_yesno
(
bool
const
b
)
{
return
b
?
"yes"
:
"no"
;
}
#endif
ir/be/ia32/ia32_new_nodes.c
View file @
a1855e22
...
...
@@ -224,13 +224,13 @@ static void ia32_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
fprintf
(
F
,
"condition_code = <invalid (0x%X)>
\n
"
,
(
unsigned
)
get_ia32_condcode
(
n
));
}
fprintf
(
F
,
"ins_permuted = %
u
\n
"
,
(
unsigned
)
attr
->
ins_permuted
);
fprintf
(
F
,
"ins_permuted = %
s
\n
"
,
be_dump_yesno
(
attr
->
ins_permuted
)
)
;
}
else
if
(
is_ia32_CopyB
(
n
)
||
is_ia32_CopyB_i
(
n
))
{
fprintf
(
F
,
"size = %u
\n
"
,
get_ia32_copyb_size
(
n
));
}
fprintf
(
F
,
"commutative = %
d
\n
"
,
is_ia32_commutative
(
n
));
fprintf
(
F
,
"is reload = %
d
\n
"
,
is_ia32_is_reload
(
n
));
fprintf
(
F
,
"commutative = %
s
\n
"
,
be_dump_yesno
(
is_ia32_commutative
(
n
))
)
;
fprintf
(
F
,
"is reload = %
s
\n
"
,
be_dump_yesno
(
is_ia32_is_reload
(
n
))
)
;
fprintf
(
F
,
"latency = %u
\n
"
,
get_ia32_latency
(
n
));
/* dump frame entity */
...
...
ir/be/sparc/sparc_new_nodes.c
View file @
a1855e22
...
...
@@ -90,15 +90,14 @@ static void sparc_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
if
(
sparc_has_load_store_attr
(
n
))
{
const
sparc_load_store_attr_t
*
attr
=
get_sparc_load_store_attr_const
(
n
);
ir_fprintf
(
F
,
"load store mode: %+F
\n
"
,
attr
->
load_store_mode
);
fprintf
(
F
,
"is frame entity: %s
\n
"
,
attr
->
is_frame_entity
?
"true"
:
"false"
);
fprintf
(
F
,
"is frame entity: %s
\n
"
,
be_dump_yesno
(
attr
->
is_frame_entity
));
}
if
(
has_jmp_cond_attr
(
n
))
{
const
sparc_jmp_cond_attr_t
*
attr
=
get_sparc_jmp_cond_attr_const
(
n
);
fprintf
(
F
,
"relation: %d (%s)
\n
"
,
(
int
)
attr
->
relation
,
get_relation_string
(
attr
->
relation
));
fprintf
(
F
,
"unsigned: %s
\n
"
,
attr
->
is_unsigned
?
"true"
:
"false"
);
fprintf
(
F
,
"unsigned: %s
\n
"
,
be_dump_yesno
(
attr
->
is_unsigned
)
);
}
if
(
has_fp_attr
(
n
))
{
const
sparc_fp_attr_t
*
attr
=
get_sparc_fp_attr_const
(
n
);
...
...
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