summaryrefslogtreecommitdiffhomepage
path: root/ir/be/begnuas.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-05-10 13:00:19 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-05-11 07:09:12 +0200
commit1e54e7eac1834832d398ed3153bc82e6c8e7935a (patch)
treea40e03e5ebd6ed9cb3d73ff00aee541465fd704e /ir/be/begnuas.c
parentb6eb10a223e14c1bab0a2f442eda02ff82776593 (diff)
begnuas: Remove the unused parameter 'env' from emit_init_expression() and its callers.
It is only passed around recursively.
Diffstat (limited to 'ir/be/begnuas.c')
-rw-r--r--ir/be/begnuas.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c
index 79a32b1..7bebb5c 100644
--- a/ir/be/begnuas.c
+++ b/ir/be/begnuas.c
@@ -609,21 +609,20 @@ const char *be_gas_insn_label_prefix(void)
/**
* Dump an atomic value.
*
- * @param env the gas output environment
* @param init a node representing the atomic value (on the const code irg)
*/
-static void emit_init_expression(be_gas_decl_env_t *env, ir_node *init)
+static void emit_init_expression(ir_node *const init)
{
ir_mode *mode = get_irn_mode(init);
int bytes = get_mode_size_bytes(mode);
switch (get_irn_opcode(init)) {
case iro_Id:
- emit_init_expression(env, get_Id_pred(init));
+ emit_init_expression(get_Id_pred(init));
return;
case iro_Conv:
- emit_init_expression(env, get_Conv_op(init));
+ emit_init_expression(get_Conv_op(init));
return;
case iro_Const: {
@@ -653,27 +652,27 @@ static void emit_init_expression(be_gas_decl_env_t *env, ir_node *init)
if (!mode_is_int(mode) && !mode_is_reference(mode)) {
panic("constant must be int or pointer for '+' to work");
}
- emit_init_expression(env, get_Add_left(init));
+ emit_init_expression(get_Add_left(init));
be_emit_cstring(" + ");
- emit_init_expression(env, get_Add_right(init));
+ emit_init_expression(get_Add_right(init));
return;
case iro_Sub:
if (!mode_is_int(mode) && !mode_is_reference(mode)) {
panic("constant must be int or pointer for '-' to work");
}
- emit_init_expression(env, get_Sub_left(init));
+ emit_init_expression(get_Sub_left(init));
be_emit_cstring(" - ");
- emit_init_expression(env, get_Sub_right(init));
+ emit_init_expression(get_Sub_right(init));
return;
case iro_Mul:
if (!mode_is_int(mode) && !mode_is_reference(mode)) {
panic("constant must be int or pointer for '*' to work");
}
- emit_init_expression(env, get_Mul_left(init));
+ emit_init_expression(get_Mul_left(init));
be_emit_cstring(" * ");
- emit_init_expression(env, get_Mul_right(init));
+ emit_init_expression(get_Mul_right(init));
return;
case iro_Unknown:
@@ -1014,10 +1013,9 @@ static void emit_tarval_data(ir_type *type, ir_tarval *tv)
/**
* Emit an atomic value.
*
- * @param env the gas output environment
* @param init a node representing the atomic value (on the const code irg)
*/
-static void emit_node_data(be_gas_decl_env_t *env, ir_node *init, ir_type *type)
+static void emit_node_data(ir_node *const init, ir_type *const type)
{
size_t size = get_type_size_bytes(type);
if (size == 12 || size == 16) {
@@ -1030,12 +1028,12 @@ static void emit_node_data(be_gas_decl_env_t *env, ir_node *init, ir_type *type)
}
emit_size_type(size);
- emit_init_expression(env, init);
+ emit_init_expression(init);
be_emit_char('\n');
be_emit_write_line();
}
-static void emit_initializer(be_gas_decl_env_t *env, const ir_entity *entity)
+static void emit_initializer(ir_entity const *const entity)
{
ir_initializer_t const *const initializer = get_entity_initializer(entity);
if (initializer_is_string_const(initializer, false)) {
@@ -1069,7 +1067,7 @@ static void emit_initializer(be_gas_decl_env_t *env, const ir_entity *entity)
switch (kind) {
case NORMAL:
if (vals[k].v.value != NULL) {
- emit_node_data(env, vals[k].v.value, vals[k].type);
+ emit_node_data(vals[k].v.value, vals[k].type);
elem_size = get_type_size_bytes(vals[k].type);
} else {
elem_size = 0;
@@ -1414,7 +1412,7 @@ static void emit_global(be_gas_decl_env_t *env, const ir_entity *entity)
be_emit_write_line();
}
} else {
- emit_initializer(env, entity);
+ emit_initializer(entity);
}
}