X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fident%2Fident_t.h;h=74332f7e8c37689ddd5d72c4db580a6f923ea541;hb=b59e22a229aa1227ef992c184c79fdafe34908cf;hp=51e0e0111d8ba59c64d458e26a557ff6146468c9;hpb=c201fe69b5fcb5a8430afafe2e15946cab4e45c4;p=libfirm diff --git a/ir/ident/ident_t.h b/ir/ident/ident_t.h index 51e0e0111..74332f7e8 100644 --- a/ir/ident/ident_t.h +++ b/ir/ident/ident_t.h @@ -1,73 +1,45 @@ -/* Declarations for ident. - Copyright (C) 1995, 1996 Markus Armbruster */ +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ + +/** + * @file + * @brief Hash table to store names -- private header. + * @author Goetz Lindenmaier + */ +#ifndef FIRM_IDENT_IDENT_T_H +#define FIRM_IDENT_IDENT_T_H -/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -** All rights reserved. -** -** Authors: Martin Trapp, Christian Schaefer -*/ - -# ifndef _IDENT_T_H_ -# define _IDENT_T_H_ - -#include -#include -#include "misc.h" -#include "debug.h" -#include "set.h" #include "ident.h" -# include "xprintf.h" -# include "xp_help.h" - -/* Caution: strings _not_ zero-terminated! */ -#define ID_FROM_STR(str, len) \ - (assert ((len) > 0), \ - (const set_entry *)set_hinsert (id_set, (str), (len), ID_HASH ((str), (len)))) -#define ID_TO_STR(id) ((const char *)&(id)->dptr[0]) -#define ID_TO_STRLEN(id) ((id)->size) -#define ID_TO_HASH(id) ((long)(id) + (id)->hash) - -ident *new_id_derived (const char *pfx, ident *); -ident *new_id_internal (void); -bool id_is_internal (ident *); -void id_init (void); - -#ifdef NDEBUG -# define ID_VRFY(id) ((void)0) -# define IDS_VRFY(id) ((void)0) -#else -# define ID_VRFY(id) \ - assert ( (id) \ - && ( !d_ (df_vrfy_level, 1) \ - || (ID_FROM_STR (ID_TO_STR((id)), ID_TO_STRLEN((id))) == (id)))) -# define IDS_VRFY(id) ids_vrfy ((id)) -void ids_vrfy (ident **id); -#endif - -#ifdef STATS -# define id_stats() set_stats (id_set) -#else -# define id_stats() ((void)0) -#endif +/** + * Initialize the ident module. + */ +void init_ident(void); -/* Private */ +/** + * Finishes the ident module, frees all entries. + */ +void finish_ident(void); -/* @@@ tune */ -#define ID_HASH(str, len) \ - ((( ((unsigned char *)(str))[0] * 33 \ - + ((unsigned char *)(str))[(len)>>1]) * 31 \ - + ((unsigned char *)(str))[(len)-1]) * 9 \ - + (len)) +/** initializes the name mangling code */ +void firm_init_mangle(void); -extern set *id_set; +void firm_finish_mangle(void); -#if 0 -# define id_from_str ID_FROM_STR -# define id_to_str ID_TO_STR -# define id_to_strlen ID_TO_STRLEN #endif - -int ident_print (XP_PAR1, const xprintf_info *, XP_PARN); - -# endif /* _IDENT_T_H_ */