added new licence header
[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  * Project:     libFIRM
22  * File name:   ir/opt/opt_polymorphy.h
23  * Purpose:     Optimize polymorphic Sel and Load nodes.
24  * Author:
25  * Created:
26  * CVS-ID:      $Id$
27  * Copyright:   (c) 2005 Universität Karlsruhe
28  */
29
30 /** @file
31  *
32  *  This file subsumes optimization code from cgana.
33  */
34 #ifndef _OPT_POLYMORPHY_H_
35 #define _OPT_POLYMORPHY_H_
36
37 #include "firm_types.h"
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /**
44  * Transform  Sel(Alloc)[method]
45  * to SymC[method] under the following conditions:
46  *
47  * - opt_dyn_meth_dispatch must be set
48  * - the method is not overwritten OR
49  * - the dynamic type is known
50  */
51 ir_node *transform_node_Sel(ir_node *node);
52
53 /** Transform  Load(Sel(Alloc)[constant static entity])
54  *  to Const[constant static entity value].
55  *
56  *  This function returns a node replacing the Proj(Load)[Value].
57  *  If this is actually called in transform_node, we must build
58  *  a tuple, or replace the Projs of the load.
59  *  Therefore we call this optimization in ldstopt.
60  */
61 ir_node *transform_node_Load(ir_node *n);
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif /* _OPT_POLYMORPHY_H_ */