389cb75e1983532e05a1d4f7c24cce333fbfec7b
[libfirm] / ir / be / beabi.h
1
2 /**
3  * Backend ABI implementation.
4  */
5
6 #ifndef _BEABI_H
7 #define _BEABI_H
8
9 #include "be.h"
10 #include "bearch.h"
11 #include "beabi_t.h"
12
13 typedef enum {
14         BE_ABI_NONE = 0,
15         BE_ABI_LEFT_TO_RIGHT           = 1, /**< Arguments are from left to right. */
16         BE_ABI_USE_PUSH                = 2, /**< Use sequential stores for arguments. */
17         BE_ABI_TRY_OMIT_FRAME_POINTER  = 4, /**< Try to omit the frame pointer. */
18         BE_ABI_FRAME_POINTER_DEDICATED = 8  /**< If the function wants a frame pointer,
19                                                                                   use the one of the architecture, else
20                                                                                   an arbitrary register is used. */
21 } be_abi_call_flags_t;
22
23 void be_abi_call_set_flags(be_abi_call_t *call, be_abi_call_flags_t flags, unsigned arg_gap);
24 void be_abi_call_param_stack(be_abi_call_t *call, int pos);
25 void be_abi_call_param_reg(be_abi_call_t *call, int pos, const arch_register_t *reg);
26 void be_abi_call_res_reg(be_abi_call_t *call, int pos, const arch_register_t *reg);
27
28 be_abi_irg_t *be_abi_introduce(be_irg_t *bi);
29 void be_abi_fix_stack_bias(be_abi_irg_t *env);
30 void be_abi_fix_stack_nodes(be_abi_irg_t *env);
31 void be_abi_free(be_abi_irg_t *abi);
32
33 ir_node *be_abi_get_callee_save_irn(be_abi_irg_t *abi, const arch_register_t *reg);
34
35 #endif