-/* The codegenerator (transform FIRM into ppc FIRM) */
-/* $Id$ */
+/*
+ * 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 The codegenerator (transform FIRM into ppc FIRM)
+ * @author Moritz Kroll, Jens Mueller
+ * @version $Id$
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "iredges_t.h"
#include "irvrfy.h"
#include "ircons.h"
-#include "dbginfo.h"
#include "iropt_t.h"
#include "irprintf.h"
#include "debug.h"
#include "bearch_ppc32_t.h"
#include "ppc32_nodes_attr.h"
-#include "../arch/archop.h" /* we need this for Min and Max nodes */
+#include "archop.h"
#include "ppc32_transform.h"
#include "ppc32_new_nodes.h"
#include "ppc32_map_regs.h"
#include "gen_ppc32_regalloc_if.h"
-extern pset *symbol_pset;
extern ir_op *get_op_Mulh(void);
int is_direct_entity(ir_entity *ent);
if (ppc32_mode_Cond)
return ppc32_mode_Cond;
else {
- ppc32_mode_Cond = new_ir_mode("mode_Cond", irms_character, 4, 0, irma_none, 0);
+ ppc32_mode_Cond = new_ir_mode("mode_Cond", irms_int_number, 4, 0, irma_none, 0);
return ppc32_mode_Cond;
}
}
int size = get_type_size_bytes(type);
int offset = 0;
- ir_node *load, *store;
+ ir_node *load, *store = NULL;
- if(size/4>=1)
+ if(size/4 >= 1)
{
ir_node *res;
tarval *offset0 = new_tarval_from_long(0, mode_Is);
return add;
}
-/**
- * Transforms a StackParam into a ppc Load
- *
- * @param env The transformation environment
- */
-static ir_node *gen_be_StackParam(ppc32_transform_env_t *env) {
- ir_node *load = new_rd_ppc32_Lwz(env->dbg, env->irg, env->block, get_irn_n(env->irn, 0), new_NoMem());
- ir_node *proj = new_rd_Proj(env->dbg, env->irg, env->block, load, env->mode, pn_Load_res);
- set_ppc32_frame_entity(load, be_get_frame_entity(env->irn));
- return proj;
-}
-
/*********************************************************
* _ _ _
BAD(EndExcept);
FIRM_OP(be_FrameAddr);
- FIRM_OP(be_StackParam);
op_Mulh = get_op_Mulh();
if (op_Mulh)
FIRM_OP(Mulh);
static int cmp_tv_ent(const void *a, const void *b, size_t len) {
const struct tv_ent *e1 = a;
const struct tv_ent *e2 = b;
+ (void) len;
return !(e1->tv == e2->tv);
}
struct tv_ent *entry;
ir_node *cnst,*symcnst;
ir_graph *rem;
- ir_entity *ent;
+ ir_entity *ent = NULL;
if(!const_set)
const_set = new_set(cmp_tv_ent, 10);
* or false, if the address must be loaded first
*/
int is_direct_entity(ir_entity *ent) {
- return get_entity_visibility(ent)!=visibility_external_allocated;
+ return get_entity_visibility(ent) != visibility_external_allocated;
/* visibility vis = get_entity_visibility(ent);
if(is_Method_type(get_entity_type(ent)))
{
set_ppc32_symconst_ident(node, id_symconst);
set_ppc32_offset_mode(node, ppc32_ao_Lo16);
node = new_rd_Proj(env->dbg, env->irg, env->block, node, env->mode, pn_Load_res);
-// pset_insert_ptr(symbol_pset, ent);
}
break;
}