3 * File name: testprograms/indentify_types.c
4 * Purpose: Shows use of ir_type identification
5 * Author: Christian Schaefer, Goetz Lindenmaier
9 * Copyright: (c) 1999-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 #include <libfirm/firm.h>
21 ir_type *t1, *t2, *t3;
22 firm_parameter_t params;
23 type_identify_if_t params2;
25 printf("\nCreating ir_type information for IDENTIFY_TYPES ...\n");
28 memset (¶ms, 0, sizeof(params));
29 params.size = sizeof(params);
30 params2.cmp = compare_names;
32 params.ti_if = ¶ms2;
36 i1 = new_id_from_str("type1");
37 i2 = new_id_from_str("type2");
39 t1 = new_type_class(i1);
44 t2 = new_type_class(i1);
47 t3 = new_type_class(i2);
51 printf(" t1: "); DDMT(t1);
52 printf(" t2: "); DDMT(t2);
53 printf(" t3: "); DDMT(t3);
56 printf("Done building the graph. Dumping it.\n");
59 printf("Use ycomp to view this graph:\n");
60 printf("ycomp GRAPHNAME\n\n");