fixed some depencies between irdump.c and irdumptxt.c
[libfirm] / ir / external / read.c
index db7073d..780655b 100644 (file)
@@ -30,6 +30,7 @@
 #include "read.h"
 #include "irprog.h"
 #include "irgraph.h"
+#include "pseudo_irg.h"
 #include "ircons.h"
 #include "irmode.h"
 #include "irdump.h"
@@ -1379,9 +1380,12 @@ static void create_abstract_firm(module_t *module, proc_t *proc, entity *fent)
      && peculiarity_existent == get_entity_peculiarity(fent)
      && "not an abstract entity");
   /* create irg in entity */
-  irg = new_ir_graph(fent, 0);
+  irg = new_pseudo_ir_graph(fent, 0);
   set_irg_inline_property(irg, irg_inline_forbidden);
 
+  /* @@@ If the spec says so: */
+  set_entity_visibility(fent, visibility_local);
+
   VERBOSE_PRINT((stdout, "create effects for %s\n",
          get_id_str(proc -> proc_ident)));
 
@@ -1557,13 +1561,22 @@ void create_abstract_proc_effect(module_t *module, proc_t *proc)
       /* @@@ TODO check args types - not in xml yet */
       /* create Firm stuff */
       create_abstract_firm(module, proc, fent);
-      break;
+      return;
     }
     else {
       fent = NULL;
     }
   }
-  assert(fent && "procedure not found in class");
+
+  /* fail */
+  fprintf(stderr,
+         "method %s not found\nNo effects generated\nCandidates are:\n",
+         get_id_str(proc -> proc_ident));
+  for(i = 0; i < num; i++) {
+    fent = get_class_member(class_typ, i);
+    fprintf(stderr, "%s\n", get_entity_name(fent));
+  }
+  //assert(fent && "procedure not found in class");
 }
 
 static
@@ -1620,11 +1633,32 @@ void create_abstraction(const char *filename)
   modules = NULL;
 }
 
+
+void free_abstraction(void) {
+  int i, n_pseudo_irgs = get_irp_n_pseudo_irgs();
+  for (i = 0; i < n_pseudo_irgs; ++i) {
+    ir_graph *p_irg = get_irp_pseudo_irg(i);
+    set_entity_visibility(get_irg_entity(p_irg), visibility_external_allocated);
+    // @@@ free_pseudo_ir_graph(p_irg);
+  }
+}
+
+
 /********************************************************************/
 
 \f
 /*
  * $Log$
+ * Revision 1.16  2004/11/11 12:24:52  goetz
+ * fixes
+ *
+ * Revision 1.15  2004/11/11 09:28:32  goetz
+ * treat pseudo irgs special
+ * parse 'local' from xml files
+ *
+ * Revision 1.14  2004/11/10 14:42:00  boesler
+ * be more helpful if a method does not exist
+ *
  * Revision 1.13  2004/11/05 14:00:53  liekweg
  * added raise
  *