Some more cleanup: Put the return type and other specifiers on the same line as the...
[libfirm] / ir / opt / opt_polymorphy.h
1 /*
2  * Copyright (C) 1995-2008 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  * @brief
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 /**
34  * Transform  Sel(Alloc)[method]
35  * to SymC[method] under the following conditions:
36  *
37  * - opt_dyn_meth_dispatch must be set
38  * - the method is not overwritten OR
39  * - the dynamic type is known
40  */
41 ir_node *transform_node_Sel(ir_node *node);
42
43 /** Transform  Load(Sel(Alloc)[constant static entity])
44  *  to Const[constant static entity value].
45  *
46  *  This function returns a node replacing the Proj(Load)[Value].
47  *  If this is actually called in transform_node, we must build
48  *  a tuple, or replace the Projs of the load.
49  *  Therefore we call this optimization in ldstopt.
50  */
51 ir_node *transform_polymorph_Load(ir_node *n);
52
53 #endif /* FIRM_OPT_OPT_POLYMORPHY_H */