rta.h 3.78 KB
Newer Older
Götz Lindenmaier's avatar
Götz Lindenmaier committed
1
/*
Michael Beck's avatar
Michael Beck committed
2
 * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
Matthias Braun's avatar
Matthias Braun committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 *
 * 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.
Götz Lindenmaier's avatar
Götz Lindenmaier committed
18
19
20
 */

/**
Matthias Braun's avatar
Matthias Braun committed
21
22
23
24
25
26
27
 * @file
 * @brief    Interprocedural analysis to improve the call graph estimate.
 * @author   Florian
 * @date     09.06.2002
 * @version  $Id$
 * @summary
 * (TODO translate to english)
Götz Lindenmaier's avatar
Götz Lindenmaier committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 * Intraprozedurale Analyse zur Abschtzung der Aufrufrelation. Es wird
 * die Menge der instantiierten Klassen bestimmt, und daraus eine Abschtzung
 * der aufgerufenen Methoden.
 *
 * Voraussetzung ist, dass das Programm keine Methodenzeiger handhaben kann.
 * In diesem Fall koennten Methoden verloren gehen.  Oder wir muessen nach
 * allen "freien" Methoden suchen (siehe cgana).
 *
 * @@@ Die Analyse sollte wissen, von welchen Klassen Instanzen ausserhalb
 * der Uebersetzungseinheit alloziert werden koennen.  Diese muessen in
 * die initiale Menge allozierter Klassen aufgenommern werden.
 *
 * Nach: David F. Bacon and Peter F. Sweeney,
 *       Fast static analysis of C++ virtual function calls
 *       OOPSLA 1996
 */
Matthias Braun's avatar
Matthias Braun committed
44
45
#ifndef FIRM_ANA_RTA_H
#define FIRM_ANA_RTA_H
Florian Liekweg's avatar
Florian Liekweg committed
46

Michael Beck's avatar
Michael Beck committed
47
#include "firm_types.h"
Florian Liekweg's avatar
Florian Liekweg committed
48

49
50
/**
 * Initialise the RTA data structures and perform RTA.
51
 * Expects that all allocations are done by Alloc nodes.
52
 */
53
void rta_init(void);
54
55
56
57

/**
 * Delete all graphs that have been found to be dead.
 */
58
void rta_delete_dead_graphs (void);
59
60
61
62

/** Clean up our data structures.
 * Finishes the RTA.
 */
63
void rta_cleanup(void);
Florian Liekweg's avatar
Florian Liekweg committed
64

65
/** Returns non-zero if the given class is alive. */
66
int rta_is_alive_class(ir_type *clazz);
67
68

/** Returns non-zero if the given graph is alive. */
69
int rta_is_alive_graph(ir_graph *graph);
70

Florian Liekweg's avatar
Florian Liekweg committed
71
/** report for all graphs and types whether they are alive */
Michael Beck's avatar
Michael Beck committed
72
void rta_report(void);
Florian Liekweg's avatar
Florian Liekweg committed
73

Matthias Braun's avatar
Matthias Braun committed
74
#endif
Florian Liekweg's avatar
Florian Liekweg committed
75
76
77

/*
 * $Log$
Michael Beck's avatar
Michael Beck committed
78
79
80
 * Revision 1.15  2006/12/18 16:02:21  beck
 * removed useles include
 *
81
82
83
 * Revision 1.14  2006/01/13 21:52:00  beck
 * renamed all types 'type' to 'ir_type'
 *
Götz Lindenmaier's avatar
Götz Lindenmaier committed
84
85
86
 * Revision 1.13  2004/10/21 07:23:34  goetz
 * comments
 *
Florian Liekweg's avatar
Florian Liekweg committed
87
88
89
 * Revision 1.12  2004/10/20 14:59:27  liekweg
 * Removed ecg
 *
Florian Liekweg's avatar
Florian Liekweg committed
90
91
92
 * Revision 1.11  2004/10/18 12:47:46  liekweg
 * minor fix
 *
93
94
95
 * Revision 1.10  2004/09/24 13:59:04  beck
 * fixed doxygen comments, removed initialization for description entities
 *
96
97
98
 * Revision 1.9  2004/08/19 16:51:02  goetz
 * fixed some errors, pushed closer to inteded firm semantics
 *
Florian Liekweg's avatar
Florian Liekweg committed
99
100
101
 * Revision 1.8  2004/06/18 17:34:31  liekweg
 * Removed field checks --flo
 *
102
103
104
 * Revision 1.7  2004/06/18 13:12:43  liekweg
 * final bug fix (calls via consts)
 *
Florian Liekweg's avatar
Florian Liekweg committed
105
106
107
 * Revision 1.6  2004/06/17 14:21:14  liekweg
 * major bugfix
 *
108
109
110
 * Revision 1.5  2004/06/17 08:33:01  liekweg
 * Added comments; added remove_irg
 *
111
112
113
114
115
116
117
118
119
 * Revision 1.4  2004/06/15 11:44:54  beck
 * New inlining schema implemented:
 *
 * small functions that should be inlined in libFirm are implemented in _t.h files
 * with a __ prefix.
 * Preprocessor magic is used to automatically inline these functions whenever a _t.h
 * file is included instead of a .h file.
 * Note that this magic did not work outside libFirm without accessing _t.h files.
 *
120
121
122
 * Revision 1.3  2004/06/13 15:03:45  liekweg
 * RTA auf Iterative RTA aufgebohrt --flo
 *
123
124
125
 * Revision 1.2  2004/06/12 17:09:46  liekweg
 * RTA works, outedges breaks.  "Yay." --flo
 *
Florian Liekweg's avatar
Florian Liekweg committed
126
127
128
129
 * Revision 1.1  2004/06/11 18:24:18  liekweg
 * Added RTA --flo
 *
 */