GCC Middle and Back End API Reference
hash-table.h File Reference
#include "hashtab.h"
Include dependency graph for hash-table.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  xcallocator< Type >
struct  typed_free_remove< Type >
struct  typed_noop_remove< Type >
struct  pointer_hash< Type >
struct  prime_ent
struct  hash_table_control< T >
class  hash_table< Descriptor, Allocator >
class  hash_table< Descriptor, Allocator >::iterator

Macros

#define FOR_EACH_HASH_TABLE_ELEMENT(HTAB, RESULT, TYPE, ITER)

Functions

unsigned int hash_table_higher_prime_index (unsigned long n)
hashval_t hash_table_mod1 (hashval_t hash, unsigned int index)
hashval_t hash_table_mod2 (hashval_t hash, unsigned int index)

Variables

struct prime_ent const prime_tab []

Macro Definition Documentation

#define FOR_EACH_HASH_TABLE_ELEMENT (   HTAB,
  RESULT,
  TYPE,
  ITER 
)
Value:
for ((ITER) = (HTAB).begin (); \
(ITER) != (HTAB).end () ? (RESULT = &*(ITER) , true) : false; \
++(ITER))

Iterate through the elements of hash_table HTAB, using hash_table <....>::iterator ITER, storing each element in RESULT, which is of type TYPE.

This macro has this form for compatibility with the FOR_EACH_HTAB_ELEMENT currently defined in tree-flow.h.

Referenced by gimplify_addr().


Function Documentation

unsigned int hash_table_higher_prime_index ( unsigned long  n)

Functions for computing hash table indexes.

hashval_t hash_table_mod1 ( hashval_t  hash,
unsigned int  index 
)
hashval_t hash_table_mod2 ( hashval_t  hash,
unsigned int  index 
)

Variable Documentation

struct prime_ent const prime_tab[]

A type-safe hash table template. Copyright (C) 2012-2013 Free Software Foundation, Inc. Contributed by Lawrence Crowl crowl.nosp@m.@goo.nosp@m.gle.c.nosp@m.om

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. This file implements a typed hash table. The implementation borrows from libiberty's hashtab. Table of primes and multiplicative inverses.

Note that these are not minimally reduced inverses. Unlike when generating code to divide by a constant, we want to be able to use the same algorithm all the time. All of these inverses (are implied to) have bit 32 set.

For the record, here's the function that computed the table; it's a vastly simplified version of the function of the same name from gcc.

Referenced by hash_table< Descriptor, Allocator >::elements(), and hash_table< Descriptor, Allocator >::find_empty_slot_for_expand().