2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief Functionality to modify the type graph.
23 * @author Goetz Lindenmaier, Michael Beck
26 #ifndef FIRM_TR_TYPEGMOD_H
27 #define FIRM_TR_TYPEGMOD_H
29 #include "firm_types.h"
34 * This module supplies routines that support changing the type graph.
37 /** Replaces one type by the other.
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.
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.
51 void exchange_types(ir_type *old_type, ir_type *new_type);
53 /** Skip id types until a useful type is reached.
55 * @param tp - A type of arbitrary kind.
58 * tp if it is not an id type.
59 * If tp is an id type returns the real type it stands for.
61 ir_type *skip_tid(ir_type *tp);
63 #endif /*FIRM_TR_TYPEGMOD_H */