-#include "ircons_t.h"
-
-/* Needed for obstack copy */
-#define bcopy(src,dst,n) memcpy(dst,src,n)
-
-#define INIT_HEADER(tgt, kind_suffix, a_isa, str) \
- do { \
- arch_header_t *h = (arch_header_t *) (tgt); \
- memset(tgt, 0, sizeof(*(tgt))); \
- h->kind = arch_kind_ ## kind_suffix; \
- h->name = new_id_from_str(str); \
- h->isa = a_isa; \
- } while(0)
-
-static INLINE int hash_header(const arch_header_t *header)
-{
- int res = HASH_PTR(header->isa);
- res = 37 * res + HASH_STR(header->name, strlen(header->name));
- res = 37 * res + header->kind;
- return res;
-}
-
-static int cmp_header(const void *a, const void *b)
-{
- const arch_header_t *h1 = a;
- const arch_header_t *h2 = b;
-
- return !(h1->kind == h2->kind && h1->isa == h2->isa && strcmp(h1->name, h2->name) == 0);
-}
-
-/**
- * The obstack and pset where the arch data is stored.
- */
-typedef struct _arch_data_t {
- struct obstack obst; /**< Here is the data allocated. */
- pset *header_set; /**< Here reside copies of the headers. */
-} arch_data_t;
-
-/**
- * Get the storage (obstack and pset) for the arch objects.
- * @return A struct containing both, the obst and pset where
- * the objects are allocated and their pointer are recorded.
- */
-static INLINE arch_data_t *get_arch_data(void)
-{
- static arch_data_t arch_data;
- static int inited = 0;
-
- if(!inited) {
- obstack_init(&arch_data.obst);
- arch_data.header_set = new_pset(cmp_header, 512);
- inited = 1;
- }
-
- return &arch_data;
-}