summaryrefslogtreecommitdiffhomepage
path: root/ir/lower
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/lower
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/lower')
-rw-r--r--ir/lower/lower_builtins.c8
-rw-r--r--ir/lower/lower_builtins.h5
2 files changed, 10 insertions, 3 deletions
diff --git a/ir/lower/lower_builtins.c b/ir/lower/lower_builtins.c
index 1925ac7..dc9648a 100644
--- a/ir/lower/lower_builtins.c
+++ b/ir/lower/lower_builtins.c
@@ -23,6 +23,7 @@
#include "util.h"
static bool dont_lower[ir_bk_last + 1];
+static lower_func lower_va_arg;
static const char *get_builtin_name(ir_builtin_kind kind)
{
@@ -191,7 +192,7 @@ changed:
return;
case ir_bk_va_arg:
- be_get_backend_param()->vararg.lower_va_arg(node);
+ lower_va_arg(node);
return;
case ir_bk_trap:
@@ -210,8 +211,11 @@ changed:
panic("unexpected builtin %+F", node);
}
-void lower_builtins(size_t const n_exceptions, ir_builtin_kind const *const exceptions)
+void lower_builtins(size_t n_exceptions,
+ ir_builtin_kind const *const exceptions,
+ lower_func new_lower_va_arg)
{
+ lower_va_arg = new_lower_va_arg;
memset(dont_lower, 0, sizeof(dont_lower));
for (size_t i = 0; i < n_exceptions; ++i) {
dont_lower[exceptions[i]] = true;
diff --git a/ir/lower/lower_builtins.h b/ir/lower/lower_builtins.h
index f185095..54478f6 100644
--- a/ir/lower/lower_builtins.h
+++ b/ir/lower/lower_builtins.h
@@ -14,6 +14,9 @@
#include "firm_types.h"
#include <stddef.h>
-void lower_builtins(size_t n_exceptions, ir_builtin_kind const *exceptions);
+typedef void(*lower_func)(ir_node*);
+
+void lower_builtins(size_t n_exceptions, ir_builtin_kind const *exceptions,
+ lower_func lower_va_arg);
#endif