-/* -*- c -*- */
-
-
/*
- * Project: libFIRM
- * File name: ir/external/read.c
- * Purpose: Read descriptions of external effects
- * Author: Florian
- * Modified by: Boris Boesler
- * Created: 11.10.2004
- * CVS-ID: $Id$
- * Copyright: (c) 1999-2004 Universität Karlsruhe
- * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
*/
+/**
+ * @file
+ * @brief Read descriptions of external effects
+ * @author Florian, Boris Boesler
+ * @date 11.10.2004
+ * @version $Id$
+ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-/* get prototype for alloca somehow */
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
static const char
*getNodeEntityStr (xmlNodePtr node)
{
- const char *ent_str = (char*) xmlGetProp (node, BAD_CAST "entity");
+ const char *ent_str = (char*) xmlGetProp (node, BAD_CAST "ir_entity");
assert (ent_str);
return (ent_str);
VERBOSE_PRINT ((stdout, "select node \t0x%08x\n", (int) selelm));
ent = getEntityById (entity_id);
- assert(ent && "entity not found");
- VERBOSE_PRINT ((stdout, "select entity %s\n", get_id_str(ent -> ent_ident)));
+ assert(ent && "ir_entity not found");
+ VERBOSE_PRINT ((stdout, "select ir_entity %s\n", get_id_str(ent -> ent_ident)));
child = selelm->xmlChildrenNode;
if(NODE_NAME (child, select)) {
sel = parseSelect (doc, child);
load-> effect.load.ent = sel-> effect.select.ent;
- VERBOSE_PRINT ((stdout, "load entity \t%s\n",
+ VERBOSE_PRINT ((stdout, "load ir_entity \t%s\n",
get_id_str(load -> effect.load.ent -> ent_ident)));
}
else {
types = type;
}
-/** parse an entity node and insert it into the list */
+/** parse an ir_entity node and insert it into the list */
static void
parseEntity (xmlDocPtr doc, xmlNodePtr entelm)
{
/* parse it */
const char *ent_id = getNodeId (entelm);
- /* fprintf (stdout, "entity node \t0x%08x (%d)\n", (int) entelm, ent_id); */
+ /* fprintf (stdout, "ir_entity node \t0x%08x (%d)\n", (int) entelm, ent_id); */
VERBOSE_PRINT ((stdout, "ent = \"%s.%s\"\n",
getNodeTypeStr (entelm),
getNodeEntityStr (entelm)));
while (cur != NULL) {
if (NODE_NAME (cur, type)) {
parseType (doc, cur);
- } else if (NODE_NAME (cur, entity)) {
+ } else if (NODE_NAME (cur, ir_entity)) {
parseEntity (doc, cur);
} else if (NODE_NAME (cur, effect)) {
parseEffect (doc, cur);
static void create_abstract_arg(ir_graph *irg, proc_t *proc, eff_t *eff)
{
ir_node *arg;
- entity *ent;
+ ir_entity *ent;
ir_mode *mode;
ir_type *typ;
int num;
static void create_abstract_load(ir_graph *irg, proc_t *proc, eff_t *eff)
{
ir_node *sel, *load;
- entity *ent;
+ ir_entity *ent;
ir_mode *mode;
eff_t *addr;
static void create_abstract_store(ir_graph *irg, proc_t *proc, eff_t *eff)
{
ir_node *sel, *store;
- entity *ent;
+ ir_entity *ent;
eff_t *addr, *val;
VERBOSE_PRINT((stdout, "create store in %s\n",
if(eff -> effect.store.ent) {
ent = eff -> effect.store.ent -> f_ent;
- VERBOSE_PRINT((stdout, "store to entity %s\n", get_entity_name(ent)));
+ VERBOSE_PRINT((stdout, "store to ir_entity %s\n", get_entity_name(ent)));
}
else {
VERBOSE_PRINT((stdout, "store to memory\n"));
static void create_abstract_call(ir_graph *irg, proc_t *proc, eff_t *eff)
{
ir_node *sel, *call;
- entity *ent;
+ ir_entity *ent;
eff_t *addr;
ir_node **irns;
int i, num;
}
-static void create_abstract_firm(module_t *module, proc_t *proc, entity *fent)
+static void create_abstract_firm(module_t *module, proc_t *proc, ir_entity *fent)
{
eff_t *eff;
ir_graph *irg;
int i, num;
- /* test entity */
+ /* test ir_entity */
assert(visibility_external_allocated == get_entity_visibility(fent)
&& peculiarity_existent == get_entity_peculiarity(fent)
- && "not an abstract entity");
- /* create irg in entity */
+ && "not an abstract ir_entity");
+ /* create irg in ir_entity */
irg = new_pseudo_ir_graph(fent, 0);
set_irg_inline_property(irg, irg_inline_forbidden);
}
}
- /* close irg in entity */
+ /* close irg in ir_entity */
/* Now we can mature the end block as all it's predecessors are known. */
mature_immBlock (get_irg_end_block(irg));
int i, num;
type_t *typ;
ir_type *type;
- entity *ent;
+ ir_entity *ent;
- VERBOSE_PRINT((stdout, "assign entity %s to typeid %s\n",
+ VERBOSE_PRINT((stdout, "assign ir_entity %s to typeid %s\n",
get_id_str(xmlent -> ent_ident),
get_id_str(xmlent -> owner)));
ent = NULL;
for(i = 0; i < num; i++) {
ent = get_class_member(type, i);
- VERBOSE_PRINT((stdout, "compare entity %s and %s\n",
+ VERBOSE_PRINT((stdout, "compare ir_entity %s and %s\n",
get_id_str(xmlent -> ent_ident), get_entity_name(ent)));
if(get_entity_ident(ent) == xmlent -> ent_ident) {
}
ent = NULL;
}
- assert(ent && "did not find a entity");
+ assert(ent && "did not find a ir_entity");
xmlent -> f_ent = ent;
}
int i, num;
ir_type *class_typ = NULL;
type_t *type;
- entity *fent;
+ ir_entity *fent;
/* find the class of a procedure */
VERBOSE_PRINT((stdout, "do find owner id %s\n", get_id_str(proc -> ownerid)));
assert(is_Class_type(class_typ) && "is not a class type");
type -> f_tp = class_typ;
- /* find entity for procedure in class */
+ /* find ir_entity for procedure in class */
VERBOSE_PRINT((stdout, "find method %s\n",
get_id_str(proc -> proc_ident)));
\f
/*
* $Log$
+ * Revision 1.27 2007/02/02 12:38:35 matze
+ * entity is ir_entity now
+ *
* Revision 1.26 2006/12/15 12:37:40 matze
* fix warnings
*