summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bevarargs.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-01-08 01:45:11 +0100
committerMatthias Braun <matze@braunis.de>2017-01-28 18:45:41 +0100
commitec7cfdce1d4fbf613620772367a7adf3f3ca50a4 (patch)
tree749b77a426915b3d4a635c45d54c8eb268f67581 /ir/be/bevarargs.c
parente05fde26a55e967319fa766f6f31a8c57d703244 (diff)
Reorganize va_arg handling
Do not put stuff unnecessarily into backend params. - Pass lower_va_arg directly as a parameter to lower_builtins - Pass stack_param align directly to be_default_lower_va_arg
Diffstat (limited to 'ir/be/bevarargs.c')
-rw-r--r--ir/be/bevarargs.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/ir/be/bevarargs.c b/ir/be/bevarargs.c
index 901328e..f10e966 100644
--- a/ir/be/bevarargs.c
+++ b/ir/be/bevarargs.c
@@ -18,7 +18,8 @@
#include "irnode_t.h"
#include "util.h"
-static void be_default_lower_va_arg(ir_node *const node, bool const compound_is_ptr)
+void be_default_lower_va_arg(ir_node *const node, bool const compound_is_ptr,
+ unsigned const stack_param_align)
{
ir_node *block = get_nodes_block(node);
dbg_info *dbgi = get_irn_dbg_info(node);
@@ -46,9 +47,8 @@ load:;
new_mem = node_mem;
}
- backend_params const *const be_params = be_get_backend_param();
unsigned const round_up = round_up2(get_type_size(aptype),
- be_params->stack_param_align);
+ stack_param_align);
ir_mode *const offset_mode = get_reference_offset_mode(mode_P);
ir_node *const offset = new_r_Const_long(irg, offset_mode, round_up);
ir_node *const new_ap = new_rd_Add(dbgi, block, ap, offset);
@@ -57,21 +57,6 @@ load:;
turn_into_tuple(node, ARRAY_SIZE(in), in);
}
-void be_default_lower_va_arg_compound_ptr(ir_node *const node)
-{
- be_default_lower_va_arg(node, true);
-}
-
-void be_default_lower_va_arg_compound_val(ir_node *const node)
-{
- be_default_lower_va_arg(node, false);
-}
-
-void be_set_va_list_type_pointer(backend_params *const p)
-{
- p->vararg.va_list_type = new_type_pointer(get_type_for_mode(mode_ANY));
-}
-
ir_entity *be_make_va_start_entity(ir_type *const frame_type, int const offset)
{
ident *const id = new_id_from_str("$va_start");