typegmod.h 1.42 KB
Newer Older
Michael Beck's avatar
Michael Beck committed
1
/*
2
3
4
5
6
7
8
9
10
 * Project:     libFIRM
 * File name:   ir/tr/typegmod.h
 * Purpose:     Functionality to modify the type graph.
 * Author:      Goetz Lindenmaier
 * Modified by:
 * Created:
 * CVS-ID:      $Id$
 * Copyright:   (c) 2001-2003 Universität Karlsruhe
 * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
Michael Beck's avatar
Michael Beck committed
11
 */
Boris Boesler's avatar
Boris Boesler committed
12

13

Götz Lindenmaier's avatar
Götz Lindenmaier committed
14
15
16
17
18
# ifndef _TYPEGMOD_H_
# define _TYPEGMOD_H_

# include "type.h"

Sebastian Felis's avatar
Sebastian Felis committed
19
/**
Götz Lindenmaier's avatar
Götz Lindenmaier committed
20
 *
Michael Beck's avatar
Michael Beck committed
21
 * @file typegmod.h
Götz Lindenmaier's avatar
Götz Lindenmaier committed
22
23
24
 *  This module supplies routines that support changing the type graph.
 */

Sebastian Felis's avatar
Sebastian Felis committed
25
/**
Michael Beck's avatar
Michael Beck committed
26
 *   replaces one type by the other.
Götz Lindenmaier's avatar
Götz Lindenmaier committed
27
28
29
 *
 *   Old type is replaced by new_type.  All references to old_type
 *   now point to new_type.  The memory for the old type is destroyed,
30
31
32
 *   but still used.  Therefore it is not freed.
 *   All referenced to this memory will be lost after a certain while.
 *   An exception is the list of types in irp (irprog.h).
Götz Lindenmaier's avatar
Götz Lindenmaier committed
33
34
 *   In the future there might be a routine to recover the memory, but
 *   this will be at considerable runtime cost.
Sebastian Felis's avatar
Sebastian Felis committed
35
 *
Michael Beck's avatar
Michael Beck committed
36
37
38
 *  @param old_type  - The old type that shall be replaced by the new type.
 *  @param new_type  - The new type that will replace old_type.
 *
Götz Lindenmaier's avatar
Götz Lindenmaier committed
39
 */
Götz Lindenmaier's avatar
Götz Lindenmaier committed
40
void exchange_types(type *old_type, type *new_type);
Götz Lindenmaier's avatar
Götz Lindenmaier committed
41

Sebastian Felis's avatar
Sebastian Felis committed
42
/**
43
 *   Skip id types until a useful type is reached.
Götz Lindenmaier's avatar
Götz Lindenmaier committed
44
 *
Michael Beck's avatar
Michael Beck committed
45
 *   @param tp - A type of arbitrary kind.
Sebastian Felis's avatar
Sebastian Felis committed
46
 *
Michael Beck's avatar
Michael Beck committed
47
48
49
 *   @return
 *   tp if it is not an id type.
 *   If tp is an id type returns the real type it stands for.
Götz Lindenmaier's avatar
Götz Lindenmaier committed
50
 */
Götz Lindenmaier's avatar
Götz Lindenmaier committed
51
type *skip_tid(type *tp);
Götz Lindenmaier's avatar
Götz Lindenmaier committed
52
53

# endif /*_TYPEGMOD_H_ */