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;
}
/********************************************************************/
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 */
VERBOSE_PRINT((stdout, "verify graph\n"));
irg_vrfy(irg);
VERBOSE_PRINT((stdout, "finalize construction\n"));
- finalize_cons (irg);
+ irg_finalize_cons (irg);
}
/********************************************************************/
typ = find_type_in_module(module, xmlent -> owner);
assert(typ && "class not found in module");
type = typ -> f_tp;
- assert(is_class_type(type));
+ assert(is_Class_type(type));
num = get_class_n_members(type);
ent = NULL;
for(i = 0; i < num; i++) {
class_typ = get_irp_type(i);
VERBOSE_PRINT((stdout, "test type %s\n", get_type_name(class_typ)));
- if(is_class_type(class_typ)
- && (type -> type_ident == get_type_ident(class_typ))) {
- /* found class type */
- VERBOSE_PRINT((stdout, "found type %s\n", get_type_name(class_typ)));
- break;
+ if (is_Class_type(class_typ)
+ && (type -> type_ident == get_type_ident(class_typ))) {
+ /* found class type */
+ VERBOSE_PRINT((stdout, "found type %s\n", get_type_name(class_typ)));
+ break;
}
class_typ = NULL;
}
VERBOSE_PRINT((stdout, "found global type %s\n", get_type_name(class_typ)));
}
assert(class_typ && "type not found");
- assert(is_class_type(class_typ) && "is not a class type");
+ assert(is_Class_type(class_typ) && "is not a class type");
type -> f_tp = class_typ;
/* find entity for procedure in class */
}
-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.23 2005/11/18 09:46:50 beck
+ * removed depency of bool type and stdbool.h (not C89)
+ *
+ * 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
+ *
+ * Revision 1.20 2005/01/05 14:28:35 beck
+ * renames all is_x*_type() functions to is_X*_type() to prevent name clash with EDG frontend
+ *
* Revision 1.19 2004/12/10 15:14:34 beck
* used xmalloc instead of malloc
*