#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
-
+#ifdef HAVE_STRING_H
# include <string.h>
+#endif
+
+#include <assert.h>
+
+#include <libxml/xmlmemory.h>
+#include <libxml/parser.h>
+#include <libxml/encoding.h>
#include "read_t.h"
#include "read.h"
#include "irvrfy.h"
#include "type.h"
#include "tv.h"
+#include "xmalloc.h"
+
+# define MY_ENCODING "ISO-8859-1"
+
+# define CHECK(ptr,msg) assert (ptr && msg)
+
+# define NODE_NAME(n, m) (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
+# define CHECK_NAME(n, m) assert (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
+
+# define NEW(T) (T*)xmalloc(sizeof (T))
+
#define VERBOSE_PRINTING 0
#if VERBOSE_PRINTING
/* this is only used inside a VERBOSE_PRINT() call */
-static char *effect_string[] = {
+static const char *effect_string[] = {
"arg",
"valref",
"select",
return (proc_str);
}
+# ifdef NEEDED
static char*
getNodeClassName (xmlNodePtr node)
{
assert (proc_str);
return ( (proc_str));
}
+# endif /* defined NEEDED */
static const char*
getNodeId (xmlNodePtr node)
/*
was Public Interface
*/
+# ifdef NEEDED
static
type_t *getTypeByIdent (const ident *id)
{
return (NULL);
}
+# endif /* defined NEEDED */
+# ifdef NEEDED
static
type_t *getTypeById (const ident *id)
{
return (NULL);
}
+# endif /* defined NEEDED */
+# ifdef NEEDED
static
entity_t *getEntityByIdents (const ident *name, const ident *tp_ident)
{
return (NULL);
}
+# endif /* defined NEEDED */
static
entity_t *getEntityById (const ident *id)
return (NULL);
}
+# ifdef NEEDED
static
proc_t *getEffectByName (const ident *proc_ident)
{
return (NULL);
}
+# endif /* defined NEEDED */
static
xmlNodePtr get_any_valid_child(xmlNodePtr elem)
free (sel);
if (0 != n_args) {
- const ident **args = (const ident**) malloc(n_args * sizeof(const ident*));
+ const ident **args = (const ident**) xmalloc(n_args * sizeof(const ident*));
int i = 0;
while (NULL != arg) {
child = child->next;
}
- ins = (const ident **) malloc (n_ins * sizeof (const ident *) );
+ ins = (const ident **) xmalloc (n_ins * sizeof (const ident *) );
i = 0;
child = get_valid_child(joinelm);
VERBOSE_PRINT ((stdout, "type node \t0x%08x (%s)\n", (int) typeelm, tp_id));
VERBOSE_PRINT ((stdout, "type = \"%s\"\n", getNodeTypeStr (typeelm)));
- type = (type_t*) malloc (sizeof (type_t));
+ type = (type_t*) xmalloc (sizeof (type_t));
type -> type_ident = new_id_from_str(getNodeTypeStr (typeelm));
type -> id = new_id_from_str(tp_id);
curr_effs = NEW (proc_t);
curr_effs -> proc_ident = new_id_from_str(procname);
curr_effs -> ownerid = new_id_from_str(ownerid);
- curr_effs->effs = (eff_t**) malloc (n_effs * sizeof (eff_t*));
+ curr_effs->effs = (eff_t**) xmalloc (n_effs * sizeof (eff_t*));
cur = effelm -> xmlChildrenNode;
while (NULL != cur) {
c_block = new_immBlock (); /* for the Phi after the branch(es) */
- ins = (ir_node**) malloc (n_ins * sizeof (ir_node*));
+ ins = (ir_node**) xmalloc (n_ins * sizeof (ir_node*));
for (i = 0; i < n_ins; i ++) {
ir_node *projX = NULL;
ir_node *s_block = NULL;
irg = new_pseudo_ir_graph(fent, 0);
set_irg_inline_property(irg, irg_inline_forbidden);
- /* If the spec says so: */
+ /* @@@ If the spec says so: */
set_entity_visibility(fent, visibility_local);
VERBOSE_PRINT((stdout, "create effects for %s\n",
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 */
/* fail */
fprintf(stderr,
- "method %s not found\nNo effects generated\nCandidates are:\n",
- get_id_str(proc -> proc_ident));
+ "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));
\f
/*
* $Log$
+ * 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
+ *
+ * Revision 1.18 2004/12/02 16:21:42 beck
+ * fixed config.h include
+ *
+ * Revision 1.17 2004/11/23 14:17:31 liekweg
+ * fenced out currently unneeded static functions
+ *
+ * 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