summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.h
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-10-16 13:49:08 +0200
committerMatthias Braun <matze@braunis.de>2014-10-18 20:42:45 +0200
commitf6d766be9acea48112802d8a42f8a32c8c0094ca (patch)
tree4af2be1c39a9fe62ac766f017cfb76be2cd05710 /ir/be/betranshlp.h
parent6d813381e5a82337d20b20b59f0fa73971f4dc7a (diff)
move beabihelper to betranshlp/bera
Diffstat (limited to 'ir/be/betranshlp.h')
-rw-r--r--ir/be/betranshlp.h39
1 files changed, 36 insertions, 3 deletions
diff --git a/ir/be/betranshlp.h b/ir/be/betranshlp.h
index 0be22fe..db12691 100644
--- a/ir/be/betranshlp.h
+++ b/ir/be/betranshlp.h
@@ -5,9 +5,9 @@
/**
* @file
- * @brief be transform helper extracted from the ia32 backend.
- * @author Matthias Braun, Michael Beck
- * @date 14.06.2007
+ * @brief Helper functions for code selection.
+ * @author Matthias Braun, Michael Beck
+ * @date 14.06.2007
*/
#ifndef FIRM_BE_BETRANSHLP_H
#define FIRM_BE_BETRANSHLP_H
@@ -15,6 +15,8 @@
#include "be_types.h"
#include "firm_types.h"
+typedef struct be_stackorder_t be_stackorder_t;
+
/**
* A callback to pre-transform some nodes before the transformation starts.
*/
@@ -110,4 +112,35 @@ void be_map_exc_node_to_runtime_call(ir_node *node, ir_mode *res_mode,
long pn_M, long pn_X_regular,
long pn_X_except, long pn_res);
+/**
+ * In the normal firm representation some nodes like pure calls, builtins
+ * have no memory inputs+outputs. However in the backend these sometimes have to
+ * access the stack to work and therefore suddenly need to be enqueued into the
+ * memory edge again.
+ * This API creates a possible order to enqueue them so we can be sure to create
+ * a legal dependency graph when transforming them.
+ */
+be_stackorder_t *be_collect_stacknodes(ir_graph *irg);
+
+/**
+ * return node that should produce the predecessor stack node in a block.
+ * returns NULL if there's no predecessor in the current block.
+ */
+ir_node *be_get_stack_pred(const be_stackorder_t *env, const ir_node *node);
+
+/**
+ * free memory associated with a stackorder structure
+ */
+void be_free_stackorder(be_stackorder_t *env);
+
+/**
+ * In case where a parameter is transmitted via register but someone takes its
+ * address a store to the frame which can be references is necessary.
+ * This function can be used as a preprocessing phase before transformation to
+ * do this. The assumption is that all parameter_entities which are passed
+ * through the stack are already moved to the arg_type and all remaining
+ * parameter_entities on the frame type need stores.
+ */
+void be_add_parameter_entity_stores(ir_graph *irg);
+
#endif