Commit d6768d8d authored by Christian Würdig's avatar Christian Würdig
Browse files

unified header

fixed include structure (files should include all needed headers - not more and not less)

[r13523]
parent a142727a
......@@ -17,8 +17,14 @@
* PURPOSE.
*/
#ifndef _BE_MAIN_H
#define _BE_MAIN_H
/**
* @file
* @brief Generic backend types and interfaces.
* @author Sebastian Hack
* @version $Id$
*/
#ifndef FIRM_BE_MAIN_H
#define FIRM_BE_MAIN_H
#include <stdio.h>
#include "irarch.h"
......@@ -96,4 +102,4 @@ const char *be_retrieve_dbg_info(const dbg_info *dbg, unsigned *line);
typedef struct be_main_env_t be_main_env_t;
typedef struct be_options_t be_options_t;
#endif /* _BE_MAIN_H */
#endif /* FIRM_BE_MAIN_H */
......@@ -24,8 +24,8 @@
* @date 11.9.2006
* @version $Id$
*/
#ifndef __BE_DBGOUT_H__
#define __BE_DBGOUT_H__
#ifndef FIRM_BE_BE_DBGOUT_H
#define FIRM_BE_BE_DBGOUT_H
#include "obst.h"
#include "beabi_t.h"
......@@ -109,4 +109,4 @@ dbg_handle *be_nulldbg_open(void);
/** Opens a stabs handler. */
dbg_handle *be_stabs_open(FILE *out);
#endif /* __BE_DBGOUT_H__ */
#endif /* FIRM_BE_BE_DBGOUT_H */
......@@ -18,13 +18,13 @@
*/
/**
* Internal backend global data structures.
* @author Sebastian Hack
* @date 8.12.2004
* @file
* @brief Internal backend global data structures.
* @author Sebastian Hack
* @version $Id$
*/
#ifndef FIRM_BE_T_H
#define FIRM_BE_T_H
#ifndef FIRM_BE_BE_T_H
#define FIRM_BE_BE_T_H
#include "firm_types.h"
#include "obst.h"
......@@ -94,4 +94,4 @@ struct be_main_env_t {
int be_put_ignore_regs(const be_irg_t *birg, const arch_register_class_t *cls,
bitset_t *bs);
#endif
#endif /* FIRM_BE_BE_T_H */
/**
* @file becopyheur4.c
* @brief ABI lowering
* @author Sebastian Hack
* @date 7.3.2005
* @version $Id$
* @license
*
* Copyrigth (C) 1995-2007 University of Karlsruhe. All right reserved.
/*
* Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
......@@ -22,7 +15,13 @@
* 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 Backend ABI implementation.
* @author Sebastian Hack
* @version $Id$
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
......
......@@ -18,10 +18,13 @@
*/
/**
* Backend ABI implementation.
* @file
* @brief Backend ABI implementation.
* @author Sebastian Hack
* @version $Id$
*/
#ifndef FIRM_BEABI_H
#define FIRM_BEABI_H
#ifndef FIRM_BE_BEABI_H
#define FIRM_BE_BEABI_H
#include "firm_types.h"
......@@ -195,4 +198,4 @@ const be_stack_layout_t *be_abi_get_stack_layout(const be_abi_irg_t *abi);
*/
int be_abi_omit_fp(const be_abi_irg_t *abi);
#endif /* _BEABI_H */
#endif /* FIRM_BE_BEABI_H */
......@@ -18,11 +18,13 @@
*/
/**
* Type declarations for the ABI module.
* @file
* @brief Type declarations for the ABI module.
* @author Sebastian Hack
* @version $Id$
*/
#ifndef _BEABI_T_H_
#define _BEABI_T_H_
#ifndef FIRM_BE_BEABI_T_H
#define FIRM_BE_BEABI_T_H
typedef struct _be_abi_call_flags_bits_t be_abi_call_flags_bits_t;
typedef union _be_abi_call_flags_t be_abi_call_flags_t;
......@@ -31,4 +33,4 @@ typedef struct _be_abi_call_t be_abi_call_t;
typedef struct _be_abi_irg_t be_abi_irg_t;
typedef struct _be_stack_layout_t be_stack_layout_t;
#endif /* _BEABI_T_H_ */
#endif /* FIRM_BE_BEABI_T_H */
......@@ -18,11 +18,10 @@
*/
/**
* Processor architecture specification.
* @author Sebastian Hack
* @date 11.2.2005
*
* $Id$
* @file
* @brief Processor architecture specification.
* @author Sebastian Hack
* @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
......
......@@ -17,8 +17,14 @@
* PURPOSE.
*/
#ifndef _FIRM_BEARCH_H_
#define _FIRM_BEARCH_H_
/**
* @file
* @brief Processor architecture specification.
* @author Sebastian Hack
* @version $Id$
*/
#ifndef FIRM_BE_BEARCH_H
#define FIRM_BE_BEARCH_H
#include "firm_types.h"
#include "bitset.h"
......@@ -287,4 +293,4 @@ extern const arch_irn_handler_t *arch_env_pop_irn_handler(arch_env_t *env);
*/
void be_register_isa_if(const char *name, const arch_isa_if_t *isa);
#endif /* _FIRM_BEARCH_H_ */
#endif /* FIRM_BE_BEARCH_H */
......@@ -17,8 +17,14 @@
* PURPOSE.
*/
#ifndef FIRM_BEARCH_T_H
#define FIRM_BEARCH_T_H
/**
* @file
* @brief Processor architecture specification - internal data structures.
* @author Sebastian Hack
* @version $Id$
*/
#ifndef FIRM_BE_BEARCH_T_H
#define FIRM_BE_BEARCH_T_H
#include "bearch.h"
......@@ -557,4 +563,4 @@ struct arch_env_t {
*/
#define arch_env_get_isa(env) ((env)->isa)
#endif
#endif /* FIRM_BE_BEARCH_T_H */
......@@ -17,12 +17,12 @@
* PURPOSE.
*/
/*
* Author: Matthias Braun, Christoph Mallon
* Date: 27.09.2006
* Copyright: (c) Universitaet Karlsruhe
* License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
* CVS-Id: $Id$
/**
* @file
* @brief Block-scheduling strategies.
* @author Matthias Braun, Christoph Mallon
* @date 27.09.2006
* @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
......
......@@ -17,21 +17,20 @@
* PURPOSE.
*/
/*
* Block schedule calculator
*
* $Id$
/**
* @file
* @brief Block schedule calculation.
* @author Matthias Braun, Christoph Mallon
* @date 27.09.2006
* @version $Id$
*/
#ifndef _BEBLOCKSCHED_H
#define _BEBLOCKSCHED_H
#include "firm_config.h"
#ifndef FIRM_BE_BEBLOCKSCHED_H
#define FIRM_BE_BEBLOCKSCHED_H
#include "obst.h"
#include "execfreq.h"
#include "irnode.h"
#include "irgraph.h"
ir_node **be_create_block_schedule(ir_graph *irg, ir_exec_freq *execfreqs);
#endif /* _BEBLOCKSCHED_H */
#endif /* FIRM_BE_BEBLOCKSCHED_H */
......@@ -18,13 +18,11 @@
*/
/**
* Chordal register allocation.
* @author Sebastian Hack
* @date 8.12.2004
* @cvs-id $Id$
*
* Copyright (C) Universitaet Karlsruhe
* Released under the GPL
* @file
* @brief Chordal register allocation.
* @author Sebastian Hack
* @date 08.12.2004
* @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -62,9 +60,10 @@
#include "beinsn_t.h"
#include "bestatevent.h"
#include "beirg_t.h"
#include "bera.h"
#include "bechordal_t.h"
#include "bechordal_draw.h"
#include "bemodule.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
......
......@@ -17,19 +17,18 @@
* PURPOSE.
*/
/**
* Chordal register allocation.
* @author Sebastian Hack
* @date 14.12.2004
* @file
* @brief Chordal register allocation.
* @author Sebastian Hack
* @date 14.12.2004
* @version $Id$
*/
#ifndef FIRM_BE_BECHORDAL_H
#define FIRM_BE_BECHORDAL_H
#ifndef __BECHORDAL_H
#define __BECHORDAL_H
#include "bearch_t.h"
#include "bera.h"
typedef struct be_chordal_env_t be_chordal_env_t;
typedef struct be_chordal_env_t be_chordal_env_t;
typedef struct be_ra_chordal_opts_t be_ra_chordal_opts_t;
typedef struct border_t border_t;
#endif
#endif /* FIRM_BE_BECHORDAL_H */
This diff is collapsed.
......@@ -17,74 +17,66 @@
* PURPOSE.
*/
/**
* @file bechordal_draw.h
* @date 13.05.2005
* @author Sebastian Hack
*
* Drawing chordal graphs.
*
* Copyright (C) 2005 Universitaet Karlsruhe
* Released under the GPL
* @file
* @brief Paint chordal graphs.
* @author Sebastian Hack
* @date 12.05.2005
* @version $Id$
*/
#ifndef FIRM_BE_BECHORDAL_DRAW_H
#define FIRM_BE_BECHORDAL_DRAW_H
#ifndef _BECHORDAL_DRAW_H
#define _BECHORDAL_DRAW_H
#include "bechordal.h"
#include "bearch_t.h"
typedef struct _plotter_t plotter_t;
typedef struct _plotter_if_t plotter_if_t;
typedef struct _rect_t rect_t;
typedef struct _plotter_t plotter_t;
typedef struct _plotter_if_t plotter_if_t;
typedef struct _rect_t rect_t;
typedef struct _draw_chordal_opts_t draw_chordal_opts_t;
typedef struct _color_t color_t;
typedef struct _color_t color_t;
struct _color_t {
double r, g, b;
double r, g, b;
};
struct _rect_t {
int x, y, w, h;
int x, y, w, h;
};
struct _plotter_if_t {
void (*begin)(plotter_t *self, const rect_t *visible_area);
void (*set_color)(plotter_t *self, const color_t * color);
const color_t * (*get_color)(const plotter_t *self);
void (*set_width)(plotter_t *self, int width);
int (*get_width)(const plotter_t *self);
void (*line)(plotter_t *self, int x1, int y1, int x2, int y2);
void (*box)(plotter_t *self, const rect_t *rect);
void (*text)(plotter_t *self, int x, int y, const char *str);
void (*finish)(plotter_t *self);
void (*free)(plotter_t *self);
void (*begin)(plotter_t *self, const rect_t *visible_area);
void (*set_color)(plotter_t *self, const color_t * color);
const color_t *(*get_color)(const plotter_t *self);
void (*set_width)(plotter_t *self, int width);
int (*get_width)(const plotter_t *self);
void (*line)(plotter_t *self, int x1, int y1, int x2, int y2);
void (*box)(plotter_t *self, const rect_t *rect);
void (*text)(plotter_t *self, int x, int y, const char *str);
void (*finish)(plotter_t *self);
void (*free)(plotter_t *self);
};
extern void plotter_free(plotter_t *self);
struct _plotter_t {
const plotter_if_t *vtab;
const plotter_if_t *vtab;
};
struct _draw_chordal_opts_t {
int h_gap;
int h_inter_gap;
int v_gap;
int v_inter_gap;
int x_margin;
int y_margin;
int h_gap;
int h_inter_gap;
int v_gap;
int v_inter_gap;
int x_margin;
int y_margin;
};
extern const draw_chordal_opts_t draw_chordal_def_opts;
extern plotter_t *new_plotter_ps(const char *filename);
extern void draw_interval_tree(
const draw_chordal_opts_t *opts,
const be_chordal_env_t *chordal_env,
plotter_t *plotter);
extern void draw_interval_tree(const draw_chordal_opts_t *opts, const be_chordal_env_t *chordal_env, plotter_t *plotter);
#endif /* _BECHORDAL_DRAW_H */
#endif /* FIRM_BE_BECHORDAL_DRAW_H */
......@@ -18,20 +18,17 @@
*/
/**
* @file bechordal_main.c
* @date 29.11.2005
* @author Sebastian Hack
* @cvs-id $Id$
*
* Copyright (C) 2005-2006 Universitaet Karlsruhe
* Released under the GPL
*
* Driver for the chordal register allocator.
* @file
* @brief Driver for the chordal register allocator.
* @author Sebastian Hack
* @date 29.11.2005
* @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <time.h>
#include "obst.h"
......@@ -76,6 +73,8 @@
#include "bestat.h"
#include "bemodule.h"
#include "be_t.h"
#include "bera.h"
#include "beirg_t.h"
#include "bespillbelady.h"
#include "bespillmorgan.h"
......
......@@ -17,40 +17,26 @@
* PURPOSE.
*/
/**
* Internal data structures for the chordal register allocator.
* @author Sebastian Hack
* @date 25.1.2005
* @file
* @brief Internal data structures for the chordal register allocator.
* @author Sebastian Hack
* @date 25.01.2005
* @version $Id$
*/
#ifndef FIRM_BE_BECHORDAL_T_H
#define FIRM_BE_BECHORDAL_T_H
#ifndef _BECHORDAL_T_H
#define _BECHORDAL_T_H
#include "firm_types.h"
#include "firm_config.h"
#include <stdlib.h>
#include "bitset.h"
#include "list.h"
#include "obst.h"
#include "pset.h"
#include "pmap.h"
#include "set.h"
#include "execfreq.h"
#include "irnode.h"
#include "bitset.h"
#include "obst.h"
#include "debug.h"
#include "be_t.h"
#include "beifg.h"
#include "bera.h"
#include "bearch_t.h"
#include "bechordal.h"
#include "belive.h"
#include "beirg_t.h"
typedef struct be_ra_chordal_opts_t be_ra_chordal_opts_t;
typedef struct border_t border_t;
#include "beirg.h"
#include "beifg.h"
/** Defines an invalid register index. */
#define NO_COLOR (-1)
......@@ -65,7 +51,7 @@ struct border_t {
ir_node *irn; /**< The node. */
unsigned step; /**< The number equal to the interval border. */
unsigned pressure; /**< The pressure at this interval border. (The border itself is counting). */
unsigned is_def : 1; /**< Does this border denote a use or a def. */
unsigned is_def : 1; /**< Does this border denote a use or a def. */
unsigned is_real : 1; /**< Is the def/use real? Or is it just
inserted at block beginnings or ends
to ensure that inside a block, each
......@@ -137,4 +123,4 @@ struct be_ra_chordal_opts_t {
void be_pre_spill_prepare_constr(be_chordal_env_t *cenv);
#endif /* _BECHORDAL_T_H */
#endif /* FIRM_BE_BECHORDAL_T_H */
......@@ -18,11 +18,12 @@
*/
/**
* Author: Daniel Grund
* Date: 12.04.2005
* Copyright: (c) Universitaet Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
* @file
* @brief First simple copy minimization heuristics.
* @author Daniel Grund
* @date 12.04.2005
* @version $Id$
*
* Heuristic for minimizing copies using a queue which holds 'qnodes' not yet
* examined. A qnode has a 'target color', nodes out of the opt unit and
* a 'conflict graph'. 'Conflict graph' = "Interference graph' + 'conflict edges'
......@@ -36,13 +37,15 @@
#endif
#include "debug.h"
#include "bitset.h"
#include "raw_bitset.h"
#include "xmalloc.h"
#include "becopyopt_t.h"
#include "becopystat.h"
#include "benodesets.h"
#include "bitset.h"
#include "raw_bitset.h"
#include "xmalloc.h"
#include "bera.h"
#include "beirg_t.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
......@@ -68,29 +71,29 @@ typedef struct _conflict_t {
*/
typedef struct _node_stat_t {
ir_node *irn;
int new_color;
int pinned_local :1;
int new_color;
int pinned_local :1;
} node_stat_t;
/**
* Represents a node in the optimization queue.
*/
typedef struct _qnode_t {
struct list_head queue; /**< chaining of unit_t->queue */
const unit_t *ou; /**< the opt unit this qnode belongs to */
int color; /**< target color */
set *conflicts; /**< contains conflict_t's. All internal conflicts */
int mis_costs; /**< costs of nodes/copies in the mis. */
int mis_size; /**< size of the array below */
ir_node **mis; /**< the nodes of unit_t->nodes[] being part of the max independent set */
set *changed_nodes; /**< contains node_stat_t's. */
struct list_head queue; /**< chaining of unit_t->queue */
const unit_t *ou; /**< the opt unit this qnode belongs to */
int color; /**< target color */
set *conflicts; /**< contains conflict_t's. All internal conflicts */
int mis_costs; /**< costs of nodes/copies in the mis. */
int mis_size; /**< size of the array below */
ir_node **mis; /**< the nodes of unit_t->nodes[] being part of the max independent set */
set *changed_nodes; /**< contains node_stat_t's. */
} qnode_t;
static pset *pinned_global; /**< optimized nodes should not be altered any more */
static INLINE int nodes_interfere(const be_chordal_env_t *env, const ir_node *a, const ir_node *b)
{
if(env->ifg)
if (env->ifg)
return be_ifg_connected(env->ifg, a, b);
else
return values_interfere(env->birg->lv, a, b);
......
......@@ -18,9 +18,11 @@
*/
/**
* More experiments on coalescing.
* @author Sebastian Hack
* @date 14.04.2006
* @file
* @brief More experiments on coalescing.
* @author Sebastian Hack
* @date 14.04.2006
* @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -52,6 +54,7 @@
#include "becopyopt.h"
#include "becopyopt_t.h"
#include "bechordal_t.h"
#include "beirg_t.h"
#define DUMP_BEFORE 1
#define DUMP_AFTER 2
......@@ -1247,9 +1250,9 @@ static be_ifg_dump_dot_cb_t ifg_dot_cb = {
int co_solve_heuristic_new(copy_opt_t *co)
{
char buf[256];
char buf[256];