#include <limits.h>
#include "firm_types.h"
-#include "irnode.h"
+#include "irnode_t.h"
#include "bearch.h"
#define BE_OUT_POS(p) (-((p) + 1))
extern ir_op *op_be_Barrier;
extern ir_op *op_be_Unwind;
-typedef enum {
- beo_NoBeOp = -1,
- beo_Spill,
- beo_Reload,
- beo_Perm,
- beo_MemPerm,
- beo_Copy,
- beo_Keep,
- beo_CopyKeep,
- beo_Call,
- beo_Return,
- beo_AddSP,
- beo_SubSP,
- beo_IncSP,
- beo_RegParams,
- beo_FrameAddr,
- beo_Barrier,
- beo_Unwind,
- beo_Last
-} be_opcode_t;
-
/** Not used yet. */
typedef enum {
be_frame_flag_spill = 1,
*/
unsigned be_Return_get_pop(const ir_node *ret);
+/**
+ * Return non-zero, if number of popped bytes must be always emitted.
+ *
+ * @param ret the be_Return node
+ */
+int be_Return_get_emit_pop(const ir_node *ret);
+
+/**
+ * Set the emit_pop flag.
+ *
+ * @param ret the be_Return node
+ */
+void be_Return_set_emit_pop(ir_node *ret, int emit_pop);
+
/** appends a node to the return node, returns the position of the node */
int be_Return_append_node(ir_node *ret, ir_node *node);
* @param irn The node.
* @return The backend opcode.
*/
-be_opcode_t be_get_irn_opcode(const ir_node *irn);
-
-int be_is_Spill(const ir_node *irn);
-int be_is_Reload(const ir_node *irn);
-int be_is_Copy(const ir_node *irn);
-int be_is_Perm(const ir_node *irn);
-int be_is_MemPerm(const ir_node *irn);
-int be_is_Keep(const ir_node *irn);
-int be_is_CopyKeep(const ir_node *irn);
-int be_is_Call(const ir_node *irn);
-int be_is_Return(const ir_node *irn);
-int be_is_IncSP(const ir_node *irn);
-int be_is_AddSP(const ir_node *irn);
-int be_is_SubSP(const ir_node *irn);
-int be_is_RegParams(const ir_node *irn);
-int be_is_FrameAddr(const ir_node *irn);
-int be_is_Barrier(const ir_node *irn);
-int be_is_Unwind(const ir_node *irn);
+#define be_get_irn_opcode(irn) get_irn_opcode(irn)
/**
* Returns the frame entity of a be node.
void be_node_set_req_type(ir_node *irn, int pos, arch_register_req_type_t type);
/**
- * Make a new phi handler.
- * @param env The architecture environment.
- * @return A new phi handler.
+ * Initialize the Phi handler.
+ * @param env The be_main environment.
*/
-arch_irn_handler_t *be_phi_handler_new(const arch_env_t *arch_env);
+void be_phi_handler_new(be_main_env_t *env);
/**
- * Free a phi handler.
- * @param handler The handler to free.
+ * Destroy the Phi handler.
*/
-void be_phi_handler_free(arch_irn_handler_t *handler);
+void be_phi_handler_free(void);
/**
- * Reset the register data in the phi handler.
+ * Reset the register data in the Phi handler.
* This should be called on each new graph and deletes the register information of the current graph.
*/
-void be_phi_handler_reset(arch_irn_handler_t *handler);
+void be_phi_handler_reset(void);
/**
* Set the register requirements for a phi node.
arch_irn_flags_t flags);
/**
- * irn handler for common be nodes.
- */
-extern const arch_irn_handler_t be_node_irn_handler;
+ * irn handler for common be nodes and Phi's.
+ */
+const void *be_node_get_irn_ops(const ir_node *irn);
+
+static INLINE int be_is_Spill (const ir_node *irn) { return get_irn_opcode(irn) == beo_Spill ; }
+static INLINE int be_is_Reload (const ir_node *irn) { return get_irn_opcode(irn) == beo_Reload ; }
+static INLINE int be_is_Copy (const ir_node *irn) { return get_irn_opcode(irn) == beo_Copy ; }
+static INLINE int be_is_CopyKeep (const ir_node *irn) { return get_irn_opcode(irn) == beo_CopyKeep ; }
+static INLINE int be_is_Perm (const ir_node *irn) { return get_irn_opcode(irn) == beo_Perm ; }
+static INLINE int be_is_MemPerm (const ir_node *irn) { return get_irn_opcode(irn) == beo_MemPerm ; }
+static INLINE int be_is_Keep (const ir_node *irn) { return get_irn_opcode(irn) == beo_Keep ; }
+static INLINE int be_is_Call (const ir_node *irn) { return get_irn_opcode(irn) == beo_Call ; }
+static INLINE int be_is_Return (const ir_node *irn) { return get_irn_opcode(irn) == beo_Return ; }
+static INLINE int be_is_IncSP (const ir_node *irn) { return get_irn_opcode(irn) == beo_IncSP ; }
+static INLINE int be_is_AddSP (const ir_node *irn) { return get_irn_opcode(irn) == beo_AddSP ; }
+static INLINE int be_is_SubSP (const ir_node *irn) { return get_irn_opcode(irn) == beo_SubSP ; }
+static INLINE int be_is_RegParams(const ir_node *irn) { return get_irn_opcode(irn) == beo_RegParams; }
+static INLINE int be_is_FrameAddr(const ir_node *irn) { return get_irn_opcode(irn) == beo_FrameAddr; }
+static INLINE int be_is_Barrier (const ir_node *irn) { return get_irn_opcode(irn) == beo_Barrier ; }
+static INLINE int be_is_Unwind (const ir_node *irn) { return get_irn_opcode(irn) == beo_Unwind ; }
#endif /* FIRM_BE_BENODE_T_H */