Commit 53914aee authored by Matthias Braun's avatar Matthias Braun
Browse files

be: remove beabi

parent 603a1337
......@@ -26,7 +26,6 @@
#include "beutil.h"
#include "betranshlp.h"
#include "beabihelper.h"
#include "beabi.h"
#include "arm_nodes_attr.h"
#include "arm_transform.h"
......
......@@ -47,23 +47,15 @@ typedef enum arch_irn_flags_t {
} arch_irn_flags_t;
ENUM_BITSET(arch_irn_flags_t)
typedef struct be_lv_t be_lv_t;
typedef union be_lv_info_t be_lv_info_t;
typedef struct be_abi_call_flags_bits_t be_abi_call_flags_bits_t;
typedef struct be_abi_call_flags_t be_abi_call_flags_t;
typedef struct be_abi_callbacks_t be_abi_callbacks_t;
typedef struct be_abi_call_t be_abi_call_t;
typedef struct be_abi_irg_t be_abi_irg_t;
typedef struct be_stack_layout_t be_stack_layout_t;
typedef struct backend_info_t backend_info_t;
typedef struct sched_info_t sched_info_t;
typedef struct reg_out_info_t reg_out_info_t;
typedef struct be_ifg_t be_ifg_t;
typedef struct copy_opt_t copy_opt_t;
typedef struct be_main_env_t be_main_env_t;
typedef struct be_options_t be_options_t;
typedef struct be_lv_t be_lv_t;
typedef union be_lv_info_t be_lv_info_t;
typedef struct be_stack_layout_t be_stack_layout_t;
typedef struct backend_info_t backend_info_t;
typedef struct sched_info_t sched_info_t;
typedef struct reg_out_info_t reg_out_info_t;
typedef struct be_ifg_t be_ifg_t;
typedef struct copy_opt_t copy_opt_t;
typedef struct be_main_env_t be_main_env_t;
typedef struct be_options_t be_options_t;
#endif
This diff is collapsed.
/*
* This file is part of libFirm.
* Copyright (C) 2012 University of Karlsruhe.
*/
/**
* @file
* @brief Backend ABI implementation.
* @author Sebastian Hack
*/
#ifndef FIRM_BE_BEABI_H
#define FIRM_BE_BEABI_H
#include <stdbool.h>
#include "be_types.h"
#include "firm_types.h"
struct be_abi_call_flags_t {
bool try_omit_fp : 1; /**< Try to omit the frame pointer. */
bool call_has_imm : 1; /**< A call can take the callee's address as an
immediate. */
};
struct be_abi_callbacks_t {
/**
* Get the between type for that call.
* @param self The callback object.
* @return The between type of for that call.
*/
ir_type *(*get_between_type)(ir_graph *irg);
};
/**
* Set the flags for a call.
* @param call The call.
* @param flags Some flags to be set.
* @param cb The call callbacks for that call.
* @note The ABI phase might change the flags due to analysis.
*/
void be_abi_call_set_flags(be_abi_call_t *call, be_abi_call_flags_t flags, const be_abi_callbacks_t *cb);
/**
* Sets the number of bytes the stackframe is shrinked by the callee on return
*/
void be_abi_call_set_pop(be_abi_call_t *call, int pop);
/**
* The ABI can change when we call a function vs. when we have
* been called.
*/
typedef enum {
ABI_CONTEXT_CALLEE = 1 << 0,
ABI_CONTEXT_CALLER = 1 << 1,
ABI_CONTEXT_BOTH = ABI_CONTEXT_CALLEE | ABI_CONTEXT_CALLER
} be_abi_context_t;
/**
* Record the that ABI transmits call argument pos on the stack. Modifies the abi object.
*
* @param call the abi call object
* @param pos the parameter position
* @param load_mode load the parameter with this mode (if the parameter mode is different from this mode a Conv is inserted)
* @param alignment stack alignment for the parameter on the current architecture
* @param space_before size of allocated additional space before the parameter
* @param space_after size of allocated additional space after the parameter
*/
void be_abi_call_param_stack(be_abi_call_t *call, int pos, ir_mode *load_mode,
unsigned alignment, unsigned space_before,
unsigned space_after, be_abi_context_t context);
/**
* Record the that ABI transmits call argument pos in the given register.
*
* @param call the abi call object
* @param pos the parameter position
* @param reg the register used
*/
void be_abi_call_param_reg(be_abi_call_t *call, int pos,
const arch_register_t *reg,
be_abi_context_t context);
/**
* Record the that ABI transmits return value pos in the given register.
*
* @param call the abi call object
* @param pos the return value position
* @param reg the register used
*/
void be_abi_call_res_reg(be_abi_call_t *call, int pos,
const arch_register_t *reg,
be_abi_context_t context);
/**
* Get the flags of a ABI call object.
* Note that the flags must not be the same as set by be_abi_call_set_flags(). Analysis may have
* altered several flags, so getting them from the call object is always a good idea.
* @param call The call object.
* @return The flags.
*/
be_abi_call_flags_t be_abi_call_get_flags(const be_abi_call_t *call);
void be_abi_introduce(ir_graph *irg);
#endif
......@@ -376,3 +376,26 @@ void be_add_parameter_entity_stores(ir_graph *irg)
create_stores_for_type(irg, between_type);
}
}
unsigned be_get_n_allocatable_regs(const ir_graph *irg,
const arch_register_class_t *cls)
{
unsigned *const bs = rbitset_alloca(cls->n_regs);
be_get_allocatable_regs(irg, cls, bs);
return rbitset_popcount(bs, cls->n_regs);
}
void be_get_allocatable_regs(ir_graph const *const irg,
arch_register_class_t const *const cls,
unsigned *const raw_bitset)
{
be_irg_t *birg = be_birg_from_irg(irg);
unsigned *allocatable_regs = birg->allocatable_regs;
rbitset_clear_all(raw_bitset, cls->n_regs);
for (unsigned i = 0; i < cls->n_regs; ++i) {
const arch_register_t *reg = &cls->regs[i];
if (rbitset_is_set(allocatable_regs, reg->global_index))
rbitset_set(raw_bitset, i);
}
}
......@@ -418,13 +418,6 @@ struct arch_isa_if_t {
*/
void (*end_codegeneration)(void *self);
/**
* Get the ABI restrictions for procedure calls.
* @param call_type The call type of the method (procedure) in question.
* @param p The array of parameter locations to be filled.
*/
void (*get_call_abi)(ir_type *call_type, be_abi_call_t *abi);
/**
* mark node as rematerialized
*/
......@@ -450,12 +443,6 @@ struct arch_isa_if_t {
ir_node *(*new_reload)(ir_node *value, ir_node *spilled_value,
ir_node *before);
/**
* Checks if the given register is callee/caller saved.
* @deprecated, only necessary if backend still uses beabi functions
*/
int (*register_saved_by)(const arch_register_t *reg, int callee);
/**
* Called directly after initialization. Backend should handle all
* intrinsics here.
......
......@@ -36,7 +36,6 @@
#include "panic.h"
#include "bechordal_t.h"
#include "beabi.h"
#include "beutil.h"
#include "besched.h"
#include "besched.h"
......
......@@ -27,7 +27,6 @@
#include "irtools.h"
#include "lc_opts.h"
#include "lc_opts_enum.h"
#include "beabi.h"
#include "bemodule.h"
#include "beemitter.h"
#include "dbginfo.h"
......
......@@ -11,7 +11,7 @@
#ifndef FIRM_BE_BEDWARF_H
#define FIRM_BE_BEDWARF_H
#include "beabi.h"
#include "bearch.h"
typedef struct parameter_dbg_info_t {
const ir_entity *entity;
......
......@@ -13,10 +13,10 @@
#include "irnode_t.h"
#include "iredges.h"
#include "bearch.h"
#include "bechordal_t.h"
#include "besched.h"
#include "beinsn_t.h"
#include "beabi.h"
be_insn_t *be_scan_insn(be_chordal_env_t *const env, ir_node *const irn)
{
......
......@@ -46,7 +46,6 @@
#include "beifg.h"
#include "becopystat.h"
#include "bessadestr.h"
#include "beabi.h"
#include "belower.h"
#include "bestat.h"
#include "beverify.h"
......
......@@ -24,7 +24,6 @@ struct be_module_list_entry_t {
struct be_module_list_entry_t *next; /**< Points to the next entry. */
};
void be_init_abi(void);
void be_init_sched(void);
void be_init_blocksched(void);
void be_init_spill(void);
......@@ -76,7 +75,6 @@ void be_init_modules(void)
return;
run_once = true;
be_init_abi();
be_init_loopana();
be_init_live();
be_init_spillslots();
......
......@@ -44,7 +44,6 @@
#include "pdeq.h"
#include "hungarian.h"
#include "statev.h"
#include "beabi.h"
#include "bechordal_t.h"
#include "be.h"
#include "beirg.h"
......
......@@ -23,8 +23,8 @@
#include "debug.h"
#include "execfreq_t.h"
#include "bearch.h"
#include "beirg.h"
#include "beabi.h"
#include "betranshlp.h"
#include "belive.h"
#include "benode.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment