added visibility flag for types.
[libfirm] / ir / tr / typegmod.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/tr/typegmod.h
4  * Purpose:     Functionality to modify the type graph.
5  * Author:      Goetz Lindenmaier
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2001-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13
14 # ifndef _TYPEGMOD_H_
15 # define _TYPEGMOD_H_
16
17 # include "type.h"
18
19 /**
20  *
21  * @file typegmod.h
22  *  This module supplies routines that support changing the type graph.
23  */
24
25 /** Replaces one type by the other.
26  *
27  *  Old type is replaced by new_type.  All references to old_type
28  *  now point to new_type.  The memory for the old type is destroyed,
29  *  but still used.  Therefore it is not freed.
30  *  All referenced to this memory will be lost after a certain while.
31  *  An exception is the list of types in irp (irprog.h).
32  *  In the future there might be a routine to recover the memory, but
33  *  this will be at considerable runtime cost.
34  *
35  *  @param old_type  - The old type that shall be replaced by the new type.
36  *  @param new_type  - The new type that will replace old_type.
37  *
38  */
39 void exchange_types(type *old_type, type *new_type);
40
41 /** Skip id types until a useful type is reached.
42  *
43  *  @param tp - A type of arbitrary kind.
44  *
45  *  @return
46  *    tp if it is not an id type.
47  *    If tp is an id type returns the real type it stands for.
48  */
49 type *skip_tid(type *tp);
50
51 # endif /*_TYPEGMOD_H_ */