/* -*- c -*- */
+
/*
* Project: libFIRM
* File name: ir/external/read.c
static
-void read_extern (const char *filename)
+int read_extern (const char *filename)
{
/* xmlNsPtr ns = NULL; */ /* no namespace for us */
xmlDocPtr doc; /* whole document */
LIBXML_TEST_VERSION xmlKeepBlanksDefault (0);
VERBOSE_PRINT((stdout, "read file %s\n", filename));
doc = xmlParseFile (filename);
- CHECK (doc, "xmlParseFile");
+ if (! doc)
+ return 0;
cur = xmlDocGetRootElement (doc);
CHECK (cur, "xmlDocGetRootElement");
module -> next = modules;
modules = module;
+
+ return 1;
}
/********************************************************************/
ir_node *arg;
entity *ent;
ir_mode *mode;
- type *typ;
+ ir_type *typ;
int num;
VERBOSE_PRINT((stdout, "create effect:arg %d in %s\n",
static void create_abstract_alloc(ir_graph *irg, proc_t *proc, eff_t *eff)
{
- type *ftype;
+ ir_type *ftype;
ir_node *alloc;
type_t *xtype;
symconst_symbol sym;
ftype = xtype -> f_tp;
sym.type_p = ftype;
- alloc = new_Alloc(get_store(), new_SymConst(sym, symconst_size), ftype,
+ alloc = new_Alloc(get_store(), new_SymConst(sym, symconst_type_size), ftype,
heap_alloc);
set_store(new_Proj(alloc, mode_M, 0));
eff -> firmnode = new_Proj(alloc, mode_P, 2);
eff_t *addr;
ir_node **irns;
int i, num;
- type *mtype;
+ ir_type *mtype;
int mik; /* is method somehow known? */
VERBOSE_PRINT((stdout, "create call in %s\n",
addr = find_valueid_in_proc_effects(eff -> effect.call.valrefid, proc);
assert(addr && "no address for load");
- /* if addr is Unknown, set propper mode */
+ /* if addr is Unknown, set proper mode */
if(iro_Unknown == get_irn_opcode(addr -> firmnode)) {
set_irn_mode(addr -> firmnode, mode_P);
}
if(ent) {
/* the address */
sel = new_simpleSel(get_store(), addr -> firmnode, ent);
- /* mthod type */
+ /* method type */
mtype = get_entity_type(ent);
- mik = true;
+ mik = 1;
}
else {
/* the address */
sel = addr -> firmnode;
- /* mthod type */
+ /* method type */
mtype = get_unknown_type();
- mik = false;
+ mik = 0;
}
/* the args */
{
int i, num;
type_t *typ;
- type *type;
+ ir_type *type;
entity *ent;
VERBOSE_PRINT((stdout, "assign entity %s to typeid %s\n",
static void assign_firm_type(type_t *xmltype)
{
int i;
- type *typ = NULL;
+ ir_type *typ = NULL;
int num;
VERBOSE_PRINT((stdout, "assign firm type to type %s\n",
void create_abstract_proc_effect(module_t *module, proc_t *proc)
{
int i, num;
- type *class_typ = NULL;
+ ir_type *class_typ = NULL;
type_t *type;
entity *fent;
}
-void create_abstraction(const char *filename)
+int create_abstraction(const char *filename)
{
module_t *module;
/* read and parse XML file */
- read_extern(filename);
+ if (! read_extern(filename))
+ return 0;
/* finished reading and parsing here */
/* build FIRM graphs */
entities = NULL;
procs = NULL;
modules = NULL;
+
+ return 1;
}
\f
/*
* $Log$
+ * Revision 1.25 2006/06/09 11:26:35 firm
+ * renamed type to ir_type
+ *
+ * Revision 1.24 2006/05/29 13:34:49 beck
+ * renamed symconst_size to symconst_type_size
+ *
+ * Revision 1.22 2005/08/16 10:18:35 beck
+ * create_abstraction() now returns an error code if the file could not
+ * be opened.
+ *
* Revision 1.21 2005/03/10 10:05:38 goetz
* chanmged method name
*