beifg: Factorise code to count interference components.
[libfirm] / ir / be / bera.h
index 5afee30..ee107fb 100644 (file)
@@ -1,51 +1,28 @@
-/**
- * Register allocation functions.
- * @author Sebastian Hack
- * @date 13.1.2005
+/*
+ * This file is part of libFirm.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
-#ifndef _BERA_H
-#define _BERA_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef WITH_LIBCORE
-#include <libcore/lc_opts.h>
-#endif
-
-#include "irnode.h"
-#include "irgraph.h"
+/**
+ * @file
+ * @brief       Base routines for register allocation.
+ * @author      Sebastian Hack
+ * @date        13.01.2005
+ */
+#ifndef FIRM_BE_BERA_H
+#define FIRM_BE_BERA_H
 
-#include "be.h"
+#include "firm_types.h"
 
-typedef struct {
-#ifdef WITH_LIBCORE
-       void (*register_options)(lc_opt_entry_t *grp);
-#endif
-       void (*allocate)(const be_main_env_t *env, ir_graph *irg);
+typedef struct be_ra_t {
+       void (*allocate)(ir_graph *irg);   /**< allocate registers on a graph */
 } be_ra_t;
 
-
+void be_register_allocator(const char *name, be_ra_t *allocator);
 
 /**
- * Check, if two values interfere.
- * @param a The first value.
- * @param b The second value.
- * @return 1, if @p a and @p b interfere, 0 if not.
+ * Do register allocation with currently selected register allocator
  */
-int values_interfere(const ir_node *a, const ir_node *b);
+void be_allocate_registers(ir_graph *irg);
 
-/**
- * Check, if a value dominates the other one.
- * Note, that this function also considers the schedule and does thus
- * more than block_dominates().
- *
- * @param a The first.
- * @param b The second value.
- * @return 1 if a dominates b, 0 else.
- */
-int value_dominates(const ir_node *a, const ir_node *b);
-
-#endif /* _BERA_H */
+#endif