allow specification of names for in parameters in spec file
[libfirm] / ir / tr / typegmod.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    typegmod.h
22  * @brief   Functionality to modify the type graph.
23  * @author  Goetz Lindenmaier, Michael Beck
24  * @version $Id$
25  */
26 #ifndef FIRM_TR_TYPEGMOD_H
27 #define FIRM_TR_TYPEGMOD_H
28
29 #include "firm_types.h"
30
31 /**
32  *
33  * @file typegmod.h
34  *  This module supplies routines that support changing the type graph.
35  */
36
37 /** Replaces one type by the other.
38  *
39  *  Old type is replaced by new_type.  All references to old_type
40  *  now point to new_type.  The memory for the old type is destroyed,
41  *  but still used.  Therefore it is not freed.
42  *  All referenced to this memory will be lost after a certain while.
43  *  An exception is the list of types in irp (irprog.h).
44  *  In the future there might be a routine to recover the memory, but
45  *  this will be at considerable runtime cost.
46  *
47  *  @param old_type  - The old type that shall be replaced by the new type.
48  *  @param new_type  - The new type that will replace old_type.
49  *
50  */
51 void exchange_types(ir_type *old_type, ir_type *new_type);
52
53 /** Skip id types until a useful type is reached.
54  *
55  *  @param tp - A type of arbitrary kind.
56  *
57  *  @return
58  *    tp if it is not an id type.
59  *    If tp is an id type returns the real type it stands for.
60  */
61 ir_type *skip_tid(ir_type *tp);
62
63 #endif /*FIRM_TR_TYPEGMOD_H */