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
b8d2203a
Commit
b8d2203a
authored
Oct 31, 2016
by
Christoph Mallon
Browse files
be: Factor out the common code to emit jump label names.
parent
87986ce0
Changes
6
Hide whitespace changes
Inline
Side-by-side
ir/be/amd64/amd64_emitter.c
View file @
b8d2203a
...
...
@@ -632,8 +632,7 @@ static void emit_amd64_jmp(const ir_node *node)
static
void
emit_jumptable_target
(
ir_entity
const
*
const
table
,
ir_node
const
*
const
proj_x
)
{
ir_node
const
*
const
block
=
be_emit_get_cfop_target
(
proj_x
);
be_gas_emit_block_name
(
block
);
be_emit_cfop_target
(
proj_x
);
if
(
be_options
.
pic_style
!=
BE_PIC_NONE
)
{
be_emit_char
(
'-'
);
be_gas_emit_entity
(
table
);
...
...
ir/be/arm/arm_emitter.c
View file @
b8d2203a
...
...
@@ -226,15 +226,6 @@ static void emit_constant_name(const ent_or_tv_t *entry)
be_emit_irprintf
(
"%sC%u"
,
be_gas_get_private_prefix
(),
entry
->
label
);
}
/**
* Emit the target label for a control flow node.
*/
static
void
arm_emit_cfop_target
(
const
ir_node
*
irn
)
{
ir_node
*
block
=
be_emit_get_cfop_target
(
irn
);
be_gas_emit_block_name
(
block
);
}
void
arm_emitf
(
const
ir_node
*
node
,
const
char
*
format
,
...)
{
BE_EMITF
(
node
,
format
,
ap
,
false
)
{
...
...
@@ -439,7 +430,7 @@ static void emit_jumptable_target(ir_entity const *const table,
ir_node
const
*
const
proj_x
)
{
(
void
)
table
;
arm
_emit_cfop_target
(
proj_x
);
be
_emit_cfop_target
(
proj_x
);
}
static
void
emit_arm_SwitchJmp
(
const
ir_node
*
irn
)
...
...
ir/be/beemithlp.c
View file @
b8d2203a
...
...
@@ -13,6 +13,7 @@
#include "bedwarf.h"
#include "beemitter.h"
#include "be_t.h"
#include "begnuas.h"
#include "benode.h"
#include "dbginfo.h"
#include "debug.h"
...
...
@@ -85,3 +86,9 @@ be_cond_branch_projs_t be_get_cond_branch_projs(ir_node const *const node)
assert
(
projs
.
f
&&
projs
.
t
);
return
projs
;
}
void
be_emit_cfop_target
(
ir_node
const
*
const
jmp
)
{
ir_node
*
const
target
=
be_emit_get_cfop_target
(
jmp
);
be_gas_emit_block_name
(
target
);
}
ir/be/beemithlp.h
View file @
b8d2203a
...
...
@@ -78,6 +78,11 @@ typedef struct be_cond_branch_projs_t {
be_cond_branch_projs_t
be_get_cond_branch_projs
(
ir_node
const
*
node
);
/**
* Emit the target label for a control flow node.
*/
void
be_emit_cfop_target
(
ir_node
const
*
jmp
);
#define BE_EMITF(node, fmt, ap, in_delay_slot) \
va_list ap; \
va_start(ap, fmt); \
...
...
@@ -99,7 +104,7 @@ be_cond_branch_projs_t be_get_cond_branch_projs(ir_node const *node);
be_emit_char('%'); \
} else if (*fmt == 'L') { \
++fmt; \
be_
gas_emit_block_name(be_emit_ge
t_cfop_target(va_arg(ap, ir_node const*))
)
; \
be_
emi
t_cfop_target(va_arg(ap, ir_node const*)); \
} else
#endif
ir/be/ia32/ia32_emitter.c
View file @
b8d2203a
...
...
@@ -267,15 +267,6 @@ static void ia32_emit_xmm_mode_suffix(ir_node const *const node)
be_emit_char
(
get_xmm_mode_suffix
(
attr
->
size
));
}
/**
* Emits the target label for a control flow node.
*/
static
void
ia32_emit_cfop_target
(
const
ir_node
*
node
)
{
ir_node
*
block
=
be_emit_get_cfop_target
(
node
);
be_gas_emit_block_name
(
block
);
}
void
x86_emit_condition_code
(
x86_condition_code_t
cc
)
{
switch
(
cc
)
{
...
...
@@ -772,8 +763,7 @@ void ia32_emit_jumptable_target(ir_entity const *const table,
ir_node
const
*
const
proj_x
)
{
(
void
)
table
;
ir_node
const
*
const
block
=
be_emit_get_cfop_target
(
proj_x
);
be_gas_emit_block_name
(
block
);
be_emit_cfop_target
(
proj_x
);
switch
(
be_options
.
pic_style
)
{
case
BE_PIC_NONE
:
break
;
...
...
@@ -1268,7 +1258,7 @@ static void ia32_assign_exc_label(ir_node *node)
be_emit_char
(
':'
);
be_emit_pad_comment
();
be_emit_cstring
(
"/* exception to Block "
);
ia32
_emit_cfop_target
(
node
);
be
_emit_cfop_target
(
node
);
be_emit_cstring
(
" */
\n
"
);
be_emit_write_line
();
}
...
...
ir/be/sparc/sparc_emitter.c
View file @
b8d2203a
...
...
@@ -179,15 +179,6 @@ static void emit_fp_suffix(const ir_mode *mode)
}
}
/**
* Returns the target label for a control flow node.
*/
static
void
sparc_emit_cfop_target
(
const
ir_node
*
node
)
{
ir_node
*
block
=
be_emit_get_cfop_target
(
node
);
be_gas_emit_block_name
(
block
);
}
/**
* returns true if a sparc_call calls a register and not an immediate
*/
...
...
@@ -1173,7 +1164,7 @@ static void emit_jumptable_target(ir_entity const *const table,
ir_node
const
*
const
proj_x
)
{
(
void
)
table
;
sparc
_emit_cfop_target
(
proj_x
);
be
_emit_cfop_target
(
proj_x
);
}
static
void
emit_sparc_IJmp
(
ir_node
const
*
const
node
)
...
...
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