X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fdebug%2Fseqnumbers.c;h=ff790cd0d4149163e849acd51904590afd1cdd9b;hb=0d47065647b5315c1098467a63ca5d32e7276cce;hp=b6a982d1dc1e644bcae607895c1e591fe89c802e;hpb=02be155780584ba0b64cc0acc516a1e91638129c;p=libfirm diff --git a/ir/debug/seqnumbers.c b/ir/debug/seqnumbers.c index b6a982d1d..ff790cd0d 100644 --- a/ir/debug/seqnumbers.c +++ b/ir/debug/seqnumbers.c @@ -1,28 +1,36 @@ /* - * Project: libFIRM - * File name: ir/debug/seqnumbers.c - * Purpose: Implements simple sequence numbers for Firm debug info. - * Author: Michael Beck - * Modified by: - * Created: 2005 - * CVS-ID: $Id$ - * Copyright: (c) 2001-2005 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * 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 seqnumbers.c - * - * Sequence numbers for Firm. + * @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. + * 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. */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "set.h" #include "hashptr.h" @@ -49,9 +57,11 @@ 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. */ @@ -65,6 +75,19 @@ seqno_t firm_seqno_enter(const char *filename, unsigned 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 */