-/**
- * Author: Daniel Grund
- * Date: 17.01.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/*
+ * Copyright (C) 1995-2008 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.
*
- * Implementation of the RA-Interface for an external, (non-SSA) register allocator.
+ * 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 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
alloc ::= node-nr reg-nr .
-
-******** End of file format docu ********/
-
+*/
+#ifdef NOT_PORTED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef HAVE_MALLOC_H
- #include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
- #include <alloca.h>
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
+#include "lc_opts.h"
+#include "lc_opts_enum.h"
#include "set.h"
#include "pset.h"
#include "pmap.h"
#include "bitset.h"
#include "raw_bitset.h"
+#include "xmalloc.h"
#include "irprintf_t.h"
#include "irnode_t.h"
#include "phiclass.h"
#include "bemodule.h"
-#include "beraextern.h"
#include "beabi.h"
-#include "bearch.h"
+#include "bearch_t.h"
#include "benode_t.h"
#include "beirgmod.h"
#include "besched_t.h"
/* should_be_equal constraints are affinites */
for (pos = 0, max = get_irn_arity(irn); pos<max; ++pos) {
req = arch_get_register_req(raenv->aenv, 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;
+
+ if (*i == -1) break;
- fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn));
+ 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));
+ }
}
}
}
/* Clean up */
free_ssa_destr_simple(raenv.vars);
- be_invalidate_liveness(birg);
+ be_liveness_invalidate(be_get_birg_liveness(birg));
}
/******************************************************************************
be_register_allocator("ext", &be_ra_external_allocator);
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_raextern);
+
+#endif /* NOT_PORTED */