add dbg_dead_code case
[libfirm] / ir / debug / seqnumbers.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/debug/seqnumbers.h
4  * Purpose:     Implements simple sequence numbers for Firm debug info.
5  * Author:      Michael Beck
6  * Modified by:
7  * Created:     2005
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2001-2005 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  * @file seqnumbers.h
15  *
16  * Sequence numbers for Firm.
17  *
18  * A sequence number is an unique number representing a filename
19  * and a line number. The number 0 represents empty information.
20  * This module is an optional "snap-in" for the Firm debug info.
21  * In simple cases it should be possible to use sequence numbers
22  * as dbg_info.
23  */
24 #ifndef _SEQNUMBERS_H_
25 #define _SEQNUMBERS_H_
26
27 #include "ident.h"
28
29 /**
30  * An opaque type for a sequence number.
31  */
32 #ifndef _SEQNO_T_TYPEDEF_
33 #define _SEQNO_T_TYPEDEF_
34 typedef struct sn_entry *seqno_t;
35 #endif
36
37 /**
38  * Create a new sequence number from a filename and a line number.
39  *
40  * @param filename  a file name
41  * @param lineno    a line number
42  *
43  * @return  a sequence number for this position.
44  */
45 seqno_t firm_seqno_enter(const char *filename, unsigned lineno);
46
47 /**
48  * Retrieve filename and line number from a sequence number.
49  *
50  * @param seqno   a sequence number
51  * @param lineno  after return contains the line number of this position
52  *
53  * @return  the file name of this position.
54  */
55 const char *firm_seqno_retrieve(seqno_t seqno, unsigned *lineno);
56
57 /**
58  * Creates the sequence number pool.
59  * Is not called by init_firm(), because the sequence number
60  * support is optional. Call firm_seqno_init() after init_firm()
61  * if sequence numbers should be used.
62  */
63 void firm_seqno_init(void);
64
65 /**
66  * Terminates the sequence number pool.
67  * Sequence numbers cannot be resolved anymore.
68  * Call this function to terminate the sequence
69  * pool.
70  */
71 void firm_seqno_term(void);
72
73 #endif /* _SEQNUMBERS_H_ */