summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonas Haag <jonas@lophus.org>2016-03-13 21:24:33 +0100
committerPhilipp Serrer <philipp@serrer.de>2018-01-18 18:15:37 +0100
commit089e0c083e7983e28f09ac44b3b26b42c28aff92 (patch)
tree9beb1294d40c0eb0e183e3b68db53f1618c99230
parent59c9c5afef50d0a47b3e65331b66576ea6d5a6f3 (diff)
Copy DWARF CFA code from ia32 to amd64 emitter
-rw-r--r--ir/be/amd64/amd64_bearch_t.h2
-rw-r--r--ir/be/amd64/amd64_emitter.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/ir/be/amd64/amd64_bearch_t.h b/ir/be/amd64/amd64_bearch_t.h
index 0404cb2..ce2c7fc 100644
--- a/ir/be/amd64/amd64_bearch_t.h
+++ b/ir/be/amd64/amd64_bearch_t.h
@@ -51,6 +51,8 @@ void amd64_cconv_init(void);
void amd64_adjust_pic(ir_graph *irg);
+int amd64_get_sp_change(ir_node *node);
+
void amd64_simulate_graph_x87(ir_graph *irg);
#endif
diff --git a/ir/be/amd64/amd64_emitter.c b/ir/be/amd64/amd64_emitter.c
index 181fec7..1aec65c 100644
--- a/ir/be/amd64/amd64_emitter.c
+++ b/ir/be/amd64/amd64_emitter.c
@@ -834,6 +834,22 @@ static void amd64_register_emitters(void)
}
/**
+ * Emits code for a node.
+ */
+static void amd64_emit_node(ir_node *node)
+{
+ be_emit_node(node);
+
+ if (omit_fp) {
+ int sp_change = -amd64_get_sp_change(node);
+ if (sp_change != 0) {
+ callframe_offset += sp_change;
+ be_dwarf_callframe_offset(callframe_offset);
+ }
+ }
+}
+
+/**
* Walks over the nodes in a block connected by scheduling edges
* and emits code for each node.
*/