Fixed the last fix again:
[libfirm] / ir / opt / opt_polymorphy.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Optimize polymorphic Sel and Load nodes.
23  * @author  Goetz Lindenmaier, Michael Beck
24  * @version $Id$
25  * @summary
26  *  This file subsumes optimization code from cgana.
27  */
28 #ifndef FIRM_OPT_OPT_POLYMORPHY_H
29 #define FIRM_OPT_OPT_POLYMORPHY_H
30
31 #include "firm_types.h"
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /**
38  * Transform  Sel(Alloc)[method]
39  * to SymC[method] under the following conditions:
40  *
41  * - opt_dyn_meth_dispatch must be set
42  * - the method is not overwritten OR
43  * - the dynamic type is known
44  */
45 ir_node *transform_node_Sel(ir_node *node);
46
47 /** Transform  Load(Sel(Alloc)[constant static entity])
48  *  to Const[constant static entity value].
49  *
50  *  This function returns a node replacing the Proj(Load)[Value].
51  *  If this is actually called in transform_node, we must build
52  *  a tuple, or replace the Projs of the load.
53  *  Therefore we call this optimization in ldstopt.
54  */
55 ir_node *transform_node_Load(ir_node *n);
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif /* FIRM_OPT_OPT_POLYMORPHY_H */