don't emit vfp copies
[libfirm] / testprograms / inheritance_example.c
index a13c3da..5dd4b85 100644 (file)
@@ -1,38 +1,44 @@
-/* Copyright (C) 2000 by Universitaet Karlsruhe
-** All rights reserved.
-**
-** Author: Goetz Lindenmaier
-**
-** testprogram.
-*/
+/*
+ * Project:     libFIRM
+ * File name:   testprograms/inheritance_example.c
+ * Purpose:     Shows type graph with inheritance.
+ * Author:      Christian Schaefer, Goetz Lindenmaier
+ * Modified by:
+ * Created:
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 1999-2003 Universität Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
 
-#include <stdio.h>
+# include <stdio.h>
+# include <string.h>
 
+# include "irvrfy.h"
 # include "irdump.h"
 # include "firm.h"
 
 /**
-***  This file constructs type information for the following pseudo-program.
-***  The procedure code is not constructed.
-***
-***  interface I {
-***    void m1 (void);
-***  }
-***
-***  class C implements I {
-***    void m1 (void) {return};
-***    void m2 (int)  {return 0};
-***  }
-***
-***  class D {
-***    int b;
-***  }
-***
-***  class E extends C, D {
-***    void m2 (int) {return 1};
-***    int a;
-***  }
-***
+*  This file constructs type information for the following pseudo-program.
+*  The procedure code is not constructed.
+*
+*  interface I {
+*    void m1 (void);
+*  }
+*
+*  class C implements I {
+*    void m1 (void) {return};
+*    void m2 (int)  {return 0};
+*  }
+*
+*  class D {
+*    int b;
+*  }
+*
+*  class E extends C, D {
+*    void m2 (int) {return 1};
+*    int a;
+*  }
+*
 **/
 
 int main(int argc, char **argv)
@@ -43,25 +49,25 @@ int main(int argc, char **argv)
   type  *intt;
   entity *i_m1e, *c_m1e, *c_m2e, *e_m2e, *d_be, *e_ae;   /*        e names entities    */
 
-  printf("\nCreating type information...\n");
+  printf("\nCreating type information for INHERITANCE_EXAMPLE ...\n");
 
   /** init library */
-  init_firm ();
+  init_firm (NULL);
 
   /** make idents for all used identifiers in the program. */
-  ii  = id_from_str("i",  strlen("i"));
-  ci  = id_from_str("c",  strlen("c"));
-  di  = id_from_str("d",  strlen("d"));
-  ei  = id_from_str("e",  strlen("e"));
-  m1i = id_from_str("m1", strlen("m1"));
-  m2i = id_from_str("m2", strlen("m2"));
-  inti= id_from_str("int",strlen("int"));
-  ai  = id_from_str("a",  strlen("a"));
-  bi  = id_from_str("b",  strlen("b"));
+  ii  = new_id_from_chars("i",  strlen("i"));
+  ci  = new_id_from_chars("c",  strlen("c"));
+  di  = new_id_from_chars("d",  strlen("d"));
+  ei  = new_id_from_chars("e",  strlen("e"));
+  m1i = new_id_from_chars("m1", strlen("m1"));
+  m2i = new_id_from_chars("m2", strlen("m2"));
+  inti= new_id_from_chars("int",strlen("int"));
+  ai  = new_id_from_chars("a",  strlen("a"));
+  bi  = new_id_from_chars("b",  strlen("b"));
 
   /** make the type information needed */
   /* Language defined types */
-  intt = new_type_primitive(inti, mode_I);
+  intt = new_type_primitive(inti, mode_Iu);
   /* Program defined types */
   it = new_type_class(ii);           /* The fact that this is an interface is
                                        of no interest.  It's just a class without
@@ -98,7 +104,7 @@ int main(int argc, char **argv)
 
 
   printf("Done building the graph.  Dumping it.\n");
-  dump_all_types();
+  dump_all_types(0);
 
   printf("use xvcg to view this graph:\n");
   printf("/ben/goetz/bin/xvcg GRAPHNAME\n\n");