projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added Load/Store addres counter
[libfirm]
/
ir
/
external
/
read.c
diff --git
a/ir/external/read.c
b/ir/external/read.c
index
09d09c3
..
388b570
100644
(file)
--- a/
ir/external/read.c
+++ b/
ir/external/read.c
@@
-1,5
+1,6
@@
/* -*- c -*- */
/* -*- c -*- */
+
/*
* Project: libFIRM
* File name: ir/external/read.c
/*
* Project: libFIRM
* File name: ir/external/read.c
@@
-91,7
+92,7
@@
static const char *effect_string[] = {
};
#endif /* defined VERBOSE_PRINTING */
};
#endif /* defined VERBOSE_PRINTING */
-static
const
ident*
+static ident*
getNodeModuleIdent (xmlNodePtr node)
{
const char *mod_str = (const char*) xmlGetProp (node, BAD_CAST "module");
getNodeModuleIdent (xmlNodePtr node)
{
const char *mod_str = (const char*) xmlGetProp (node, BAD_CAST "module");
@@
-99,7
+100,7
@@
getNodeModuleIdent (xmlNodePtr node)
if (NULL == mod_str) {
return (NULL);
} else {
if (NULL == mod_str) {
return (NULL);
} else {
-
const
ident *res = new_id_from_str (mod_str);
+ ident *res = new_id_from_str (mod_str);
return (res);
}
}
return (res);
}
}
@@
-177,7
+178,7
@@
static const char
*/
# ifdef NEEDED
static
*/
# ifdef NEEDED
static
-type_t *getTypeByIdent (
const
ident *id)
+type_t *getTypeByIdent (ident *id)
{
type_t *curr = types; // @@@ TODO module -> types
{
type_t *curr = types; // @@@ TODO module -> types
@@
-194,7
+195,7
@@
type_t *getTypeByIdent (const ident *id)
# ifdef NEEDED
static
# ifdef NEEDED
static
-type_t *getTypeById (
const
ident *id)
+type_t *getTypeById (ident *id)
{
type_t *curr = types; // which ones?
{
type_t *curr = types; // which ones?
@@
-211,7
+212,7
@@
type_t *getTypeById (const ident *id)
# ifdef NEEDED
static
# ifdef NEEDED
static
-entity_t *getEntityByIdents (
const ident *name, const
ident *tp_ident)
+entity_t *getEntityByIdents (
ident *name,
ident *tp_ident)
{
entity_t *curr = entities; // TODO module -> entities
{
entity_t *curr = entities; // TODO module -> entities
@@
-228,7
+229,7
@@
entity_t *getEntityByIdents (const ident *name, const ident *tp_ident)
# endif /* defined NEEDED */
static
# endif /* defined NEEDED */
static
-entity_t *getEntityById (
const
ident *id)
+entity_t *getEntityById (ident *id)
{
entity_t *curr = entities;
{
entity_t *curr = entities;
@@
-244,7
+245,7
@@
entity_t *getEntityById (const ident *id)
# ifdef NEEDED
static
# ifdef NEEDED
static
-proc_t *getEffectByName (
const
ident *proc_ident)
+proc_t *getEffectByName (ident *proc_ident)
{
proc_t *curr_effs = procs;
{
proc_t *curr_effs = procs;
@@
-336,7
+337,7
@@
parseValref (xmlDocPtr doc, xmlNodePtr valelm)
static eff_t*
parseSelect (xmlDocPtr doc, xmlNodePtr selelm)
{
static eff_t*
parseSelect (xmlDocPtr doc, xmlNodePtr selelm)
{
-
const
ident *entity_id = new_id_from_str(getNodeEntityStr (selelm));
+ ident *entity_id = new_id_from_str(getNodeEntityStr (selelm));
entity_t *ent;
xmlNodePtr child;
eff_t *valref = NULL;
entity_t *ent;
xmlNodePtr child;
eff_t *valref = NULL;
@@
-369,7
+370,7
@@
parseSelect (xmlDocPtr doc, xmlNodePtr selelm)
static eff_t*
parseLoad (xmlDocPtr doc, xmlNodePtr loadelm)
{
static eff_t*
parseLoad (xmlDocPtr doc, xmlNodePtr loadelm)
{
-
const
ident *id;
+ ident *id;
xmlNodePtr child;
eff_t *sel;
eff_t *load = NEW (eff_t);
xmlNodePtr child;
eff_t *sel;
eff_t *load = NEW (eff_t);
@@
-436,8
+437,8
@@
parseStore (xmlDocPtr doc, xmlNodePtr storeelm)
static eff_t*
parseAlloc (xmlDocPtr doc, xmlNodePtr allocelm)
{
static eff_t*
parseAlloc (xmlDocPtr doc, xmlNodePtr allocelm)
{
-
const
ident *id;
-
const
ident *type_id;
+ ident *id;
+ ident *type_id;
eff_t *alloc = NEW (eff_t); /* ...! */
alloc->kind = eff_alloc;
eff_t *alloc = NEW (eff_t); /* ...! */
alloc->kind = eff_alloc;
@@
-457,7
+458,7
@@
parseAlloc (xmlDocPtr doc, xmlNodePtr allocelm)
static eff_t*
parseCall (xmlDocPtr doc, xmlNodePtr callelm)
{
static eff_t*
parseCall (xmlDocPtr doc, xmlNodePtr callelm)
{
-
const
ident *id;
+ ident *id;
xmlNodePtr child;
eff_t *sel;
xmlNodePtr arg;
xmlNodePtr child;
eff_t *sel;
xmlNodePtr arg;
@@
-496,7
+497,7
@@
parseCall (xmlDocPtr doc, xmlNodePtr callelm)
free (sel);
if (0 != n_args) {
free (sel);
if (0 != n_args) {
-
const ident **args = (const ident**) xmalloc(n_args * sizeof(const
ident*));
+
ident **args = (ident**) xmalloc(n_args * sizeof(
ident*));
int i = 0;
while (NULL != arg) {
int i = 0;
while (NULL != arg) {
@@
-515,9
+516,9
@@
parseCall (xmlDocPtr doc, xmlNodePtr callelm)
static eff_t*
parseJoin (xmlDocPtr doc, xmlNodePtr joinelm)
{
static eff_t*
parseJoin (xmlDocPtr doc, xmlNodePtr joinelm)
{
-
const
ident *id;
+ ident *id;
int n_ins;
int n_ins;
-
const
ident **ins;
+ ident **ins;
int i;
xmlNodePtr child;
eff_t *join = NEW (eff_t);
int i;
xmlNodePtr child;
eff_t *join = NEW (eff_t);
@@
-536,7
+537,7
@@
parseJoin (xmlDocPtr doc, xmlNodePtr joinelm)
child = child->next;
}
child = child->next;
}
- ins = (
const ident **) xmalloc (n_ins * sizeof (const
ident *) );
+ ins = (
ident **) xmalloc (n_ins * sizeof (
ident *) );
i = 0;
child = get_valid_child(joinelm);
i = 0;
child = get_valid_child(joinelm);
@@
-557,7
+558,7
@@
parseJoin (xmlDocPtr doc, xmlNodePtr joinelm)
static eff_t*
parseUnknown (xmlDocPtr doc, xmlNodePtr unknownelm)
{
static eff_t*
parseUnknown (xmlDocPtr doc, xmlNodePtr unknownelm)
{
-
const
ident *id;
+ ident *id;
eff_t *unknown = NEW (eff_t);
unknown->kind = eff_unknown;
eff_t *unknown = NEW (eff_t);
unknown->kind = eff_unknown;
@@
-982,7
+983,7
@@
void free_data(void)
/********************************************************************/
static
/********************************************************************/
static
-type_t *find_type_in_module(module_t *module,
const
ident *typeid)
+type_t *find_type_in_module(module_t *module, ident *typeid)
{
type_t *type;
{
type_t *type;
@@
-1006,7
+1007,7
@@
static void add_value_to_proc(proc_t *proc, eff_t *eff)
}
}
-eff_t *find_valueid_in_proc_effects(
const
ident *id, proc_t *proc)
+eff_t *find_valueid_in_proc_effects(ident *id, proc_t *proc)
{
eff_t *val;
{
eff_t *val;
@@
-1057,7
+1058,7
@@
static void create_abstract_arg(ir_graph *irg, proc_t *proc, eff_t *eff)
ir_node *arg;
entity *ent;
ir_mode *mode;
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",
int num;
VERBOSE_PRINT((stdout, "create effect:arg %d in %s\n",
@@
-1166,7
+1167,7
@@
static void create_abstract_store(ir_graph *irg, proc_t *proc, eff_t *eff)
static void create_abstract_alloc(ir_graph *irg, proc_t *proc, eff_t *eff)
{
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;
ir_node *alloc;
type_t *xtype;
symconst_symbol sym;
@@
-1179,7
+1180,7
@@
static void create_abstract_alloc(ir_graph *irg, proc_t *proc, eff_t *eff)
ftype = xtype -> f_tp;
sym.type_p = ftype;
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);
heap_alloc);
set_store(new_Proj(alloc, mode_M, 0));
eff -> firmnode = new_Proj(alloc, mode_P, 2);
@@
-1209,7
+1210,7
@@
static void create_abstract_call(ir_graph *irg, proc_t *proc, eff_t *eff)
eff_t *addr;
ir_node **irns;
int i, num;
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",
int mik; /* is method somehow known? */
VERBOSE_PRINT((stdout, "create call in %s\n",
@@
-1226,7
+1227,7
@@
static void create_abstract_call(ir_graph *irg, proc_t *proc, eff_t *eff)
addr = find_valueid_in_proc_effects(eff -> effect.call.valrefid, proc);
assert(addr && "no address for load");
addr = find_valueid_in_proc_effects(eff -> effect.call.valrefid, proc);
assert(addr && "no address for load");
- /* if addr is Unknown, set prop
p
er mode */
+ /* if addr is Unknown, set proper mode */
if(iro_Unknown == get_irn_opcode(addr -> firmnode)) {
set_irn_mode(addr -> firmnode, mode_P);
}
if(iro_Unknown == get_irn_opcode(addr -> firmnode)) {
set_irn_mode(addr -> firmnode, mode_P);
}
@@
-1234,16
+1235,16
@@
static void create_abstract_call(ir_graph *irg, proc_t *proc, eff_t *eff)
if(ent) {
/* the address */
sel = new_simpleSel(get_store(), addr -> firmnode, ent);
if(ent) {
/* the address */
sel = new_simpleSel(get_store(), addr -> firmnode, ent);
- /* mthod type */
+ /* m
e
thod type */
mtype = get_entity_type(ent);
mtype = get_entity_type(ent);
- mik =
true
;
+ mik =
1
;
}
else {
/* the address */
sel = addr -> firmnode;
}
else {
/* the address */
sel = addr -> firmnode;
- /* mthod type */
+ /* m
e
thod type */
mtype = get_unknown_type();
mtype = get_unknown_type();
- mik =
false
;
+ mik =
0
;
}
/* the args */
}
/* the args */
@@
-1477,7
+1478,7
@@
static void assign_firm_entity(module_t *module, entity_t *xmlent)
{
int i, num;
type_t *typ;
{
int i, num;
type_t *typ;
- type *type;
+
ir_
type *type;
entity *ent;
VERBOSE_PRINT((stdout, "assign entity %s to typeid %s\n",
entity *ent;
VERBOSE_PRINT((stdout, "assign entity %s to typeid %s\n",
@@
-1511,7
+1512,7
@@
static void assign_firm_entity(module_t *module, entity_t *xmlent)
static void assign_firm_type(type_t *xmltype)
{
int i;
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",
int num;
VERBOSE_PRINT((stdout, "assign firm type to type %s\n",
@@
-1544,7
+1545,7
@@
static
void create_abstract_proc_effect(module_t *module, proc_t *proc)
{
int i, num;
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;
type_t *type;
entity *fent;
@@
-1683,6
+1684,15
@@
void free_abstraction(void) {
\f
/*
* $Log$
\f
/*
* $Log$
+ * Revision 1.26 2006/12/15 12:37:40 matze
+ * fix warnings
+ *
+ * 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.22 2005/08/16 10:18:35 beck
* create_abstraction() now returns an error code if the file could not
* be opened.