X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbenode_t.h;h=ffc0fb0504d007d4d093082a7da69cf0612e94da;hb=c23b55879df97f49fc6f1e95651f9f28a980b620;hp=c7d7567480b94e141d9022a64e4eacef73270fda;hpb=7c4e33eb7648d9e1cc7efcffc8682a2f27a570a3;p=libfirm diff --git a/ir/be/benode_t.h b/ir/be/benode_t.h index c7d756748..ffc0fb050 100644 --- a/ir/be/benode_t.h +++ b/ir/be/benode_t.h @@ -33,7 +33,7 @@ #include #include "firm_types.h" -#include "irnode.h" +#include "irnode_t.h" #include "bearch.h" #define BE_OUT_POS(p) (-((p) + 1)) @@ -58,27 +58,6 @@ extern ir_op *op_be_FrameAddr; 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, @@ -453,24 +432,7 @@ ir_node *be_get_Unwind_sp(const ir_node *irn); * @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. @@ -543,23 +505,21 @@ void be_node_set_reg_class(ir_node *irn, int pos, const arch_register_class_t *c 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. @@ -574,8 +534,25 @@ void be_set_phi_flags(const arch_env_t *arch_env, ir_node *phi, 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 */