removde unused var
[libfirm] / ir / tr / typegmod.c
1 /* Copyright (C) 2001 by Universitaet Karlsruhe
2 ** All rights reserved.
3 **
4 ** Authors: Goetz Lindenmaier
5 **
6 */
7
8 /* $Id$ */
9
10 # include "typegmod_t.h"
11 # include "type_t.h"
12 # include "tpop_t.h"
13 # include "irmode.h"
14
15 inline void exchange_types(type *old_type, type *new_type) {
16   /* Deallocate datastructures not directly contained in the
17      old type.  We must do this now as it is the latest point
18      where we know the original kind of type.
19      */
20   free_type_attrs(old_type);
21
22   /* @@@@
23      Things to deal with:
24      * After exchange_types the type has two entries in the list of
25        all types in irp.  So far this is fine for the walker.
26        Maybe it's better to remove the id entry and shrink the list.
27        Does this conflict with the walker?  Might a type be left out
28        during the walk?
29      * Deallocation:  if the Id is removed from the list it will eventualle
30        disappear in a memory leak.  When is impossible to determine so we
31        need to hold it in a seperate list for deallocation.
32   */
33
34   /* Exchange the types */
35   old_type->type_op = type_id;
36   old_type->mode = (ir_mode *) new_type;
37 }
38
39 inline type *skip_tid(type *tp) {
40   while (tp->type_op == type_id)
41     tp = (type *) tp->mode;
42   return tp;
43 }