be_abi_put_ignore_regs returns now number of ignore registers as unsigned
[libfirm] / ir / be / ppc32 / ppc32_transform.c
index 2bab558..a0437e5 100644 (file)
@@ -1,6 +1,28 @@
-/* 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 "gen_ppc32_regalloc_if.h"
 
-extern pset *symbol_pset;
 extern ir_op *get_op_Mulh(void);
 
-int is_direct_entity(entity *ent);
+int is_direct_entity(ir_entity *ent);
 
 ir_mode* ppc32_mode_Cond = NULL;
 
@@ -964,7 +985,7 @@ static ir_node *ldst_insert_const(ir_node *ptr, tarval **ptv, ident **pid, ppc32
        }
        else if(is_ppc32_SymConst(ptr))
        {
-               entity *ent = get_ppc32_frame_entity(ptr);
+               ir_entity *ent = get_ppc32_frame_entity(ptr);
                if(is_direct_entity(ent))
                {
                        id_symconst = get_entity_ident(ent);
@@ -1119,9 +1140,9 @@ static ir_node *gen_CopyB(ppc32_transform_env_t *env) {
        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);
@@ -1404,7 +1425,7 @@ void ppc32_transform_node(ir_node *node, void *env) {
  */
 
 struct tv_ent {
-       entity *ent;
+       ir_entity *ent;
        tarval *tv;
 };
 
@@ -1424,7 +1445,7 @@ static ir_node *gen_fp_known_symconst(ppc32_transform_env_t *env, tarval *known_
        struct tv_ent *entry;
        ir_node       *cnst,*symcnst;
        ir_graph      *rem;
-       entity        *ent;
+       ir_entity     *ent = NULL;
 
        if(!const_set)
                const_set = new_set(cmp_tv_ent, 10);
@@ -1564,7 +1585,7 @@ static ir_node *gen_ppc32_fConst(ppc32_transform_env_t *env) {
                {
                        ir_node *addr, *load;
                        ir_mode *mode = env->mode;
-                       entity *ent;
+                       ir_entity *ent;
                        env->irn = gen_fp_known_symconst(env, tv_const);
                        env->mode = mode_P;
                        ent = get_ppc32_frame_entity(env->irn);
@@ -1605,8 +1626,8 @@ static ir_node *gen_ppc32_fConst(ppc32_transform_env_t *env) {
  * Returns true, if the entity can be accessed directly,
  * or false, if the address must be loaded first
  */
-int is_direct_entity(entity *ent) {
-       return get_entity_visibility(ent)!=visibility_external_allocated;
+int is_direct_entity(ir_entity *ent) {
+       return get_entity_visibility(ent) != visibility_external_allocated;
 /*     visibility vis = get_entity_visibility(ent);
        if(is_Method_type(get_entity_type(ent)))
        {
@@ -1628,7 +1649,7 @@ int is_direct_entity(entity *ent) {
  * @return the created ppc Load immediate node
  */
 static ir_node *gen_ppc32_SymConst(ppc32_transform_env_t *env) {
-       entity *ent = get_ppc32_frame_entity(env->irn);
+       ir_entity *ent = get_ppc32_frame_entity(env->irn);
        ident *id_symconst = get_entity_ident(ent);
        ir_node *node;
        switch(get_nice_modecode(env->mode)){
@@ -1648,7 +1669,6 @@ static ir_node *gen_ppc32_SymConst(ppc32_transform_env_t *env) {
                                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;
                }