more headers
[libfirm] / testprograms / identify_types.c
1 /*
2  * Project:     libFIRM
3  * File name:   testprograms/indentify_types.c
4  * Purpose:     Shows use of type identification
5  * Author:      Christian Schaefer, Goetz Lindenmaier
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1999-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 # include <stdio.h>
14 # include <string.h>
15
16 # include "irvrfy.h"
17 # include "irdump.h"
18 # include "firm.h"
19 # include "type_identify.h"
20
21
22
23 int main(int argc, char **argv)
24 {
25   ident *i1, *i2;
26   type  *t1, *t2, *t3;
27
28   printf("\nCreating type information for IDENTIFY_TYPES ...\n");
29
30
31   compare_types_func = compare_names;
32
33   /** init library */
34   init_firm (NULL);
35
36   i1 = new_id_from_str("type1");
37   i2 = new_id_from_str("type2");
38
39   t1 = new_type_class(i1);
40   t1 = mature_type(t1);
41
42   t1 = mature_type(t1);
43
44   t2 = new_type_class(i1);
45   t2 = mature_type(t2);
46
47   t3 = new_type_class(i2);
48   t3 = mature_type(t3);
49
50   /*
51   printf(" t1: "); DDMT(t1);
52   printf(" t2: "); DDMT(t2);
53   printf(" t3: "); DDMT(t3);
54   */
55
56   printf("Done building the graph.  Dumping it.\n");
57   dump_all_types();
58
59   printf("use xvcg to view this graph:\n");
60   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");
61
62   return (0);
63 }