X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fberaextern.c;h=d4fdb352b6bf2c246c6093e411f0b8626e6510c4;hb=8974b94349462d835b33ad4f896d1821986458bd;hp=5a75d9f8620e85f11c714a521567c50565dcf7da;hpb=4d5c3365a58cba59993045a9e08e686d8ae079a7;p=libfirm diff --git a/ir/be/beraextern.c b/ir/be/beraextern.c index 5a75d9f86..d4fdb352b 100644 --- a/ir/be/beraextern.c +++ b/ir/be/beraextern.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -18,12 +18,11 @@ */ /** - * Author: Daniel Grund - * Date: 17.01.2006 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - * - * Implementation of the RA-Interface for an external, (non-SSA) register allocator. + * @file + * @brief Implementation of the RA-Interface for an external, (non-SSA) register allocator. + * @author Daniel Grund + * @date 17.01.2006 + * @version $Id$ * * The external register allocator is a program: * PROG -i INPUTFILE -o OUTPUTFILE @@ -70,8 +69,7 @@ allocs ::= 'allocs' alloc* . alloc ::= node-nr reg-nr . - -******** End of file format docu ********/ +*/ #ifdef NOT_PORTED #ifdef HAVE_CONFIG_H #include "config.h" @@ -80,8 +78,8 @@ alloc ::= node-nr reg-nr . #include #include #include -#include -#include +#include "lc_opts.h" +#include "lc_opts_enum.h" #include "set.h" #include "pset.h" @@ -99,7 +97,6 @@ alloc ::= node-nr reg-nr . #include "phiclass.h" #include "bemodule.h" -#include "beraextern.h" #include "beabi.h" #include "bearch_t.h" #include "benode_t.h" @@ -430,13 +427,18 @@ static void dump_affinities_walker(ir_node *irn, void *env) { /* should_be_equal constraints are affinites */ for (pos = 0, max = get_irn_arity(irn); posaenv, irn, pos); - if (arch_register_req_is(req, should_be_same)) { - ir_node *other = get_irn_n(irn, req->other_same); - if(arch_irn_is(raenv->aenv, other, ignore)) { - vi2 = be_get_var_info(other); + const int* i; + for (i = req->other_same; i != ENDOF(req->other_same); ++i) { + ir_node *other; - fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn)); + if (*i == -1) break; + + other = get_irn_n(skip_Proj(irn), *i); + if(arch_irn_is(raenv->aenv, other, ignore)) { + vi2 = be_get_var_info(other); + fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn)); + } } } } @@ -458,8 +460,7 @@ static void dump_to_file(be_raext_env_t *raenv, char *filename) { if (!(f = fopen(filename, "wt"))) { fprintf(stderr, "Could not open file %s for writing\n", filename); - assert(0); - exit(0xdeadbeef); + abort(); } raenv->f = f; @@ -628,8 +629,7 @@ static int read_and_apply_results(be_raext_env_t *raenv, char *filename) { if (!(f = fopen(filename, "rt"))) { fprintf(stderr, "Could not open file %s for reading\n", filename); - assert(0); - exit(0xdeadbeef); + abort(); } raenv->f = f; @@ -786,7 +786,7 @@ static void be_ra_extern_main(be_irg_t *birg) { /* Clean up */ free_ssa_destr_simple(raenv.vars); - be_invalidate_liveness(birg); + be_liveness_invalidate(be_get_birg_liveness(birg)); } /****************************************************************************** @@ -832,4 +832,4 @@ void be_init_raextern(void) { } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_raextern); -#endif +#endif /* NOT_PORTED */