From c9b883c7432e59cc91d0e5eac9bb22cd7d778889 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 4 Nov 2010 12:15:24 +0000 Subject: [PATCH] remove unused seqnumbers modules [r28125] --- include/libfirm/firm.h | 1 - include/libfirm/seqnumbers.h | 96 --------------------------- ir/debug/seqnumbers.c | 125 ----------------------------------- 3 files changed, 222 deletions(-) delete mode 100644 include/libfirm/seqnumbers.h delete mode 100644 ir/debug/seqnumbers.c diff --git a/include/libfirm/firm.h b/include/libfirm/firm.h index cc44fb747..3dcf90ea1 100644 --- a/include/libfirm/firm.h +++ b/include/libfirm/firm.h @@ -106,7 +106,6 @@ #include "irverify.h" #include "lowering.h" #include "rta.h" -#include "seqnumbers.h" #include "structure.h" #include "timing.h" #include "trouts.h" diff --git a/include/libfirm/seqnumbers.h b/include/libfirm/seqnumbers.h deleted file mode 100644 index 97c919295..000000000 --- a/include/libfirm/seqnumbers.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 Implements simple sequence numbers for Firm debug info. - * @author Michael Beck - * @date 2005 - * @version $Id$ - * @brief - * Sequence numbers for Firm. - * - * A sequence number is an unique number representing a filename - * and a line number. The number 0 represents empty information. - * This module is an optional "snap-in" for the Firm debug info. - * In simple cases it should be possible to use sequence numbers - * as dbg_info. - */ -#ifndef FIRM_DEBUG_SEQNUMBERS_H -#define FIRM_DEBUG_SEQNUMBERS_H - -#include "ident.h" - -#include "begin.h" - -/** - * @typedef seqno_t - * - * An opaque type for a sequence number. - */ - -/** - * Create a new sequence number from a filename and a line number. - * - * @param filename a file name - * @param lineno a line number - * - * @return a sequence number for this position. - */ -FIRM_API seqno_t firm_seqno_enter(const char *filename, unsigned lineno); - -/** - * Create a new sequence number from a filename ident and a line number. - * - * @param filename an ident - * @param lineno a line number - * - * @return a sequence number for this position. - */ -FIRM_API seqno_t firm_seqno_enter_id(ident *filename, unsigned lineno); - -/** - * Retrieve filename and line number from a sequence number. - * - * @param seqno a sequence number - * @param lineno after return contains the line number of this position - * - * @return the file name of this position. - */ -FIRM_API const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno); - -/** - * Creates the sequence number pool. - * Is not called by init_firm(), because the sequence number - * support is optional. Call firm_seqno_init() after init_firm() - * if sequence numbers should be used. - */ -FIRM_API void firm_seqno_init(void); - -/** - * Terminates the sequence number pool. - * Sequence numbers cannot be resolved anymore. - * Call this function to terminate the sequence - * pool. - */ -FIRM_API void firm_seqno_term(void); - -#include "end.h" - -#endif diff --git a/ir/debug/seqnumbers.c b/ir/debug/seqnumbers.c deleted file mode 100644 index ff790cd0d..000000000 --- a/ir/debug/seqnumbers.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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 Implements simple sequence numbers for Firm debug info. - * @author Michael Beck - * @date 2005 - * @version $Id$ - * @brief - * Sequence numbers for Firm. - * - * A sequence number is an unique number representing a filename - * and a line number. The number 0 represents empty information. - * This module is an optional "snap-in" for the Firm debug info. - */ -#include "config.h" - -#include "set.h" -#include "hashptr.h" -#include "ident.h" -#include "seqnumbers.h" - -/** - * A entry in the sequence number table. - */ -struct sn_entry { - ident *filename; /**< the filename */ - unsigned lineno; /**< the line number */ -}; - -static set *seqnos = NULL; - -/** hash a seqno entry */ -#define HASH(key) (HASH_PTR((key).filename) ^ (key).lineno) - -/** - * Compare two seqno entries. - */ -static int seqno_cmp(const void *elt, const void *key, size_t size) -{ - seqno_t e1 = (seqno_t)elt; - seqno_t e2 = (seqno_t)key; - (void) size; - - return (e1->filename != e2->filename) | (e1->lineno - e2->lineno); -} - -/* - * Create a new sequence number from a filename and a line number. - */ -seqno_t firm_seqno_enter(const char *filename, unsigned lineno) -{ - struct sn_entry key; - - key.filename = new_id_from_str(filename); - key.lineno = lineno; - - return set_insert(seqnos, &key, sizeof(key), HASH(key)); -} - -/* - * Create a new sequence number from a filename ident and a line number. - */ -seqno_t firm_seqno_enter_id(ident *filename, unsigned lineno) -{ - struct sn_entry key; - - key.filename = filename; - key.lineno = lineno; - - return set_insert(seqnos, &key, sizeof(key), HASH(key)); -} - -/** - * Retrieve filename and line number form a sequence number - */ -const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno) -{ - if (seqnos && seqno) { - *lineno = seqno->lineno; - return get_id_str(seqno->filename); - } - *lineno = 0; - return NULL; -} - -/* - * Creates the seqno pool. - */ -void firm_seqno_init(void) -{ - if (seqnos) - firm_seqno_term(); - - seqnos = new_set(seqno_cmp, 8); -} - -/* - * Terminates the seqno pool. - * Sequence numbers cannot be resolved anymore. - */ -void firm_seqno_term(void) -{ - if (seqnos) { - del_set(seqnos); - seqnos = NULL; - } -} -- 2.20.1