3 * File name: ir/ana/cgana.h
4 * Purpose: Intraprozedural analyses to estimate the call graph.
5 * Author: Hubert Schmid
9 * Copyright: (c) 1999-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
14 * Intraprozedurale Analyse zur Abschätzung der Aufrulrelation. Es
15 * wird eine Menge von freien Methoden und anschließend die an den
16 * Call-Operationen aufrufbaren Methoden bestimmt.
25 /* Methoden sind "frei", wenn ihr Funktionszeiger (potentiell)
26 *"explizit" bekannt ist, d.h.:
28 * - die Methode ist von aussen sichtbar (external_visible).
30 * - ihr Funktionszeiger ist "frei", d.h. der Funktionszeiger wurde
31 * nicht ausschliesslich an den entsprechenden Eingang eines
32 * Call-Knotens weitergegeben, sondern z.B. in den Speicher
33 * geschrieben, als Parameter uebergeben, ...
35 * Die main-Methode ist immer in der Menge enthalten.
37 * Die Links an den "ir_node"s werden geloescht. */
39 /** Analyses a rough estimation of the possible call graph.
41 * Bestimmt fuer jede Call-Operation die Menge der aufrufbaren Methode
42 * und speichert das Ergebnis in der Call-Operation. (siehe
43 * "set_Call_callee"). Die Methode gibt die Menge der
44 * "freien" Methoden zurueck, die vom Aufrufer wieder freigegeben
46 * The algorithm implements roughly Static Class Hierarchy Analysis
47 * as described in "Optimization of Object-Oriented Programs Using
48 * Static Class Hierarchy Analysis" by Jeffrey Dean and David Grove
51 * Performs some optimizations possible by the analysed information:
52 * - Replace SymConst nodes by Const nodes if possible,
53 * - Replace (Sel-method(Alloc)) by Const method,
54 * - Replaces unreachable Sel nodes by Bad (@@@ was genau meint unreachable?)
55 * - Replaces Sel-method by Const if the Method is never overwritten */
56 /* @@@ I assume this can not be called via JNI :-( -- how to obtain the array pointer? */
57 void cgana(int *len, entity ***free_methods);
59 /* Optimize the address expressions passed to call nodes.
60 * Performs only the optimizations done by cgana. */
61 /* @@@ move to irgopt ?! */
62 /* @@@ not fully implemented as buggy !!! */
63 void opt_call_addrs(void);
64 #endif /* _CGANA_H_ */