aet_entity_ident() added
[libfirm] / testprograms / oo_program_example.c
index 20e8348..22fe94a 100644 (file)
@@ -73,7 +73,7 @@ main(void)
   class_prima = new_type_class(new_id_from_chars ("PRIMA", 5));
   /* We need type information for pointers to the class: */
   class_p_ptr = new_type_pointer (new_id_from_chars("class_prima_ptr", 15),
-                                 class_prima);
+                                 class_prima, mode_P);
   /* An entity for the field (a).  The entity constructor automatically adds
      the entity as member of the owner. */
   a_e = new_entity(class_prima, new_id_from_chars ("a", 1), prim_t_int);
@@ -120,7 +120,7 @@ main(void)
   /* There is only one block in main, it contains the allocation and the calls. */
   /* Allocate the defined object and generate the type information. */
   symconst_symbol sym = {class_prima};
-  obj_size = new_SymConst(sym, symconst_size);
+  obj_size = new_SymConst(sym, symconst_type_size);
   obj_o    = new_Alloc(get_store(), obj_size, class_prima, heap_alloc);
   set_store(new_Proj(obj_o, mode_M, 0));  /* make the changed memory visible */
   obj_o    = new_Proj(obj_o, mode_P, 2);  /* remember the pointer to the object */
@@ -170,7 +170,7 @@ main(void)
   mature_immBlock (get_irg_end_block(main_irg));
 
   irg_vrfy(main_irg);
-  finalize_cons (main_irg);
+  irg_finalize_cons (main_irg);
 
   /****************************************************************************/
 
@@ -200,7 +200,7 @@ main(void)
 
   /* verify the graph */
   irg_vrfy(set_a_irg);
-  finalize_cons (set_a_irg);
+  irg_finalize_cons (set_a_irg);
 
   /****************************************************************************/
 
@@ -215,7 +215,7 @@ main(void)
 
   /* Select the entity and load the value */
   a_ptr = new_simpleSel(get_store(), self, a_e);
-  a_val = new_Load(get_store(), a_ptr);
+  a_val = new_Load(get_store(), a_ptr, mode_Is);
   set_store(new_Proj(a_val, mode_M, 0));
   a_val = new_Proj(a_val, mode_Is, 2);
 
@@ -234,7 +234,7 @@ main(void)
 
   /* verify the graph */
   irg_vrfy(c_irg);
-  finalize_cons (c_irg);
+  irg_finalize_cons (c_irg);
 
   /****************************************************************************/
 
@@ -257,15 +257,16 @@ main(void)
   dump_all_ir_graphs(dump_ir_graph_w_types, "");
   dump_all_ir_graphs(dump_ir_block_graph_w_types, "");
   dump_all_ir_graphs(dump_type_graph, "");
+  dump_all_ir_graphs(dump_graph_as_text, "");
   dump_all_types("");
-  dump_class_hierarchy (true, "");
+  dump_class_hierarchy (1, "");
 
   entity **free_methods;
   int arr_len;
-  cgana(&arr_len, &free_methods, 0);
+  cgana(&arr_len, &free_methods);
   cg_construct(arr_len, free_methods);
 
-  interprocedural_view = 1;
+  set_interprocedural_view(1);
   dump_ir_graph(main_irg, "");
   dump_ir_block_graph(main_irg, "");
   dump_ir_graph_w_types(main_irg, "");