Polly 19.0.0git
Classes | Macros | Functions | Variables
hash.h File Reference
#include <stdlib.h>
#include <isl/stdint.h>
#include <isl/ctx.h>

Go to the source code of this file.

Classes

struct  isl_hash_table_entry
 
struct  isl_hash_table
 

Macros

#define isl_hash_init()   (2166136261u)
 
#define isl_hash_byte(h, b)
 
#define isl_hash_hash(h, h2)
 
#define isl_hash_bits(h, bits)
 
#define isl_hash_builtin(h, l)   isl_hash_mem(h, &l, sizeof(l))
 

Functions

uint32_t isl_hash_string (uint32_t hash, const char *s)
 
uint32_t isl_hash_mem (uint32_t hash, const void *p, size_t len)
 
struct isl_hash_tableisl_hash_table_alloc (struct isl_ctx *ctx, int min_size)
 
void isl_hash_table_free (struct isl_ctx *ctx, struct isl_hash_table *table)
 
int isl_hash_table_init (struct isl_ctx *ctx, struct isl_hash_table *table, int min_size)
 
void isl_hash_table_clear (struct isl_hash_table *table)
 
struct isl_hash_table_entryisl_hash_table_find (struct isl_ctx *ctx, struct isl_hash_table *table, uint32_t key_hash, isl_bool(*eq)(const void *entry, const void *val), const void *val, int reserve)
 
isl_stat isl_hash_table_foreach (isl_ctx *ctx, struct isl_hash_table *table, isl_stat(*fn)(void **entry, void *user), void *user)
 
isl_bool isl_hash_table_every (isl_ctx *ctx, struct isl_hash_table *table, isl_bool(*test)(void **entry, void *user), void *user)
 
void isl_hash_table_remove (struct isl_ctx *ctx, struct isl_hash_table *table, struct isl_hash_table_entry *entry)
 

Variables

struct isl_hash_table_entryisl_hash_table_entry_none
 

Macro Definition Documentation

◆ isl_hash_bits

#define isl_hash_bits (   h,
  bits 
)
Value:
((bits) == 32) ? (h) : \
((bits) >= 16) ? \
((h) >> (bits)) ^ ((h) & (((uint32_t)1 << (bits)) - 1)) : \
(((h) >> (bits)) ^ (h)) & (((uint32_t)1 << (bits)) - 1)

Definition at line 33 of file hash.h.

◆ isl_hash_builtin

#define isl_hash_builtin (   h,
 
)    isl_hash_mem(h, &l, sizeof(l))

Definition at line 42 of file hash.h.

◆ isl_hash_byte

#define isl_hash_byte (   h,
  b 
)
Value:
do { \
h *= 16777619; \
h ^= b; \
} while(0)
b(9)

Definition at line 22 of file hash.h.

◆ isl_hash_hash

#define isl_hash_hash (   h,
  h2 
)
Value:
do { \
isl_hash_byte(h, (h2) & 0xFF); \
isl_hash_byte(h, ((h2) >> 8) & 0xFF); \
isl_hash_byte(h, ((h2) >> 16) & 0xFF); \
isl_hash_byte(h, ((h2) >> 24) & 0xFF); \
} while(0)

Definition at line 26 of file hash.h.

◆ isl_hash_init

#define isl_hash_init ( )    (2166136261u)

Definition at line 21 of file hash.h.

Function Documentation

◆ isl_hash_mem()

uint32_t isl_hash_mem ( uint32_t  hash,
const void *  p,
size_t  len 
)

Definition at line 22 of file isl_hash.c.

References isl_hash_byte, and p.

◆ isl_hash_string()

uint32_t isl_hash_string ( uint32_t  hash,
const char *  s 
)

Definition at line 15 of file isl_hash.c.

References isl_hash_byte.

Referenced by check_keywords(), id_alloc(), isl_id_alloc(), and isl_stream_register_keyword().

◆ isl_hash_table_alloc()

struct isl_hash_table * isl_hash_table_alloc ( struct isl_ctx ctx,
int  min_size 
)

◆ isl_hash_table_clear()

void isl_hash_table_clear ( struct isl_hash_table table)

◆ isl_hash_table_every()

isl_bool isl_hash_table_every ( isl_ctx ctx,
struct isl_hash_table table,
isl_bool(*)(void **entry, void *user test,
void *  user 
)

◆ isl_hash_table_find()

struct isl_hash_table_entry * isl_hash_table_find ( struct isl_ctx ctx,
struct isl_hash_table table,
uint32_t  key_hash,
isl_bool(*)(const void *entry, const void *val eq,
const void *  val,
int  reserve 
)

◆ isl_hash_table_foreach()

isl_stat isl_hash_table_foreach ( isl_ctx ctx,
struct isl_hash_table table,
isl_stat(*)(void **entry, void *user fn,
void *  user 
)

◆ isl_hash_table_free()

void isl_hash_table_free ( struct isl_ctx ctx,
struct isl_hash_table table 
)

◆ isl_hash_table_init()

int isl_hash_table_init ( struct isl_ctx ctx,
struct isl_hash_table table,
int  min_size 
)

◆ isl_hash_table_remove()

void isl_hash_table_remove ( struct isl_ctx ctx,
struct isl_hash_table table,
struct isl_hash_table_entry entry 
)

Variable Documentation

◆ isl_hash_table_entry_none

struct isl_hash_table_entry* isl_hash_table_entry_none
extern