make firm (mostly) -Wmissing-prototypes clean
authorMatthias Braun <matze@braunis.de>
Tue, 9 Mar 2010 21:14:15 +0000 (21:14 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 9 Mar 2010 21:14:15 +0000 (21:14 +0000)
[r27277]

127 files changed:
include/libfirm/ircons.h
include/libfirm/irdump.h
include/libfirm/iredges.h
include/libfirm/old_fctnames.h
include/libfirm/pseudo_irg.h
ir/adt/array.c
ir/adt/cpset.c
ir/adt/gaussjordan.c
ir/adt/gaussseidel.c
ir/adt/pset_new.c
ir/ana/callgraph.c
ir/ana/execution_frequency.c
ir/ana/height.c
ir/ana/interval_analysis.c
ir/ana/ircfscc.c
ir/ana/irconsconfirm.c
ir/ana/irlivechk.c
ir/ana/irouts.c
ir/ana/irscc.c
ir/ana/trouts.c
ir/be/TEMPLATE/TEMPLATE_emitter.c
ir/be/TEMPLATE/TEMPLATE_new_nodes.c
ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/arm/arm_emitter.c
ir/be/arm/arm_new_nodes.h
ir/be/arm/bearch_arm.c
ir/be/be_dbgout_t.h
ir/be/beabi.c
ir/be/beblocksched.c
ir/be/bechordal.c
ir/be/bechordal_common.c
ir/be/bechordal_draw.c
ir/be/bechordal_main.c
ir/be/becopyheur.c
ir/be/becopyheur2.c
ir/be/becopyheur4.c
ir/be/becopyilp.c
ir/be/becopyilp2.c
ir/be/becopyopt.c
ir/be/becopystat.c
ir/be/bedbgout.c
ir/be/beifg.c
ir/be/beifg_clique.c
ir/be/beifg_list.c
ir/be/beifg_pointer.c
ir/be/beifg_std.c
ir/be/beilpsched.c
ir/be/beirgmod.c
ir/be/belistsched.c
ir/be/belive.c
ir/be/beloopana.c
ir/be/bemodule.c
ir/be/bemodule.h
ir/be/benode.c
ir/be/bepeephole.c
ir/be/beprefalloc.c
ir/be/bepressurestat.c
ir/be/bera.c
ir/be/besched.c
ir/be/besched.h
ir/be/beschednormal.c
ir/be/beschedrss.c
ir/be/bespill.c
ir/be/bespillbelady.c
ir/be/bespillbelady2.c
ir/be/bespillbelady3.c
ir/be/bespilldaemel.c
ir/be/bespillslots.c
ir/be/bespillutil.c
ir/be/bessaconstr.c
ir/be/bessadestr.c
ir/be/bestabs.c
ir/be/bestate.c
ir/be/ia32/bearch_ia32.c
ir/be/ia32/ia32_new_nodes.c
ir/be/ia32/ia32_new_nodes.h
ir/be/mips/bearch_mips.c
ir/be/mips/mips_emitter.c
ir/be/ppc32/bearch_ppc32.c
ir/be/ppc32/ppc32_emitter.c
ir/be/ppc32/ppc32_map_regs.c
ir/be/ppc32/ppc32_new_nodes.c
ir/be/ppc32/ppc32_transform.c
ir/be/ppc32/ppc32_transform_conv.c
ir/be/scripts/generate_new_opcodes.pl
ir/be/sparc/bearch_sparc.c
ir/be/sparc/sparc_emitter.c
ir/be/sparc/sparc_new_nodes.c
ir/common/firm.c
ir/debug/debugger.c
ir/debug/debugger.h
ir/ident/ident.c
ir/ir/irargs.c
ir/ir/ircons.c
ir/ir/irdump.c
ir/ir/irdumptxt.c
ir/ir/iredges.c
ir/ir/iredges_t.h
ir/ir/irflag.c
ir/ir/irflag_t.def
ir/ir/irflag_t.h
ir/ir/irgraph.c
ir/ir/irgwalk_blk.c
ir/ir/irlinkednodemap.c
ir/ir/irlinkednodeset.c
ir/ir/irmode.c
ir/ir/irnode.c
ir/ir/irnode_t.h
ir/ir/irnodemap.c
ir/ir/irnodeset.c
ir/ir/irpass.c
ir/ir/valueset.c
ir/libcore/lc_config_lexer.c
ir/libcore/lc_config_lexer.l
ir/libcore/lc_config_parser.c
ir/libcore/lc_config_parser.h
ir/libcore/lc_opts.c
ir/libcore/lc_type.c [deleted file]
ir/lower/lower_switch.c
ir/opt/code_placement.c
ir/opt/gvn_pre.c
ir/opt/loop.c
ir/opt/opt_blocks.c
ir/opt/opt_polymorphy.c
ir/opt/reassoc.c
ir/stat/pattern.c
ir/stat/pattern.h

index 80b2bbe..7b1ef65 100644 (file)
@@ -1270,7 +1270,8 @@ ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg,
  */
 ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con);
 
-/** Constructor for a Const node.
+/**
+ * Constructor for a Const node.
  *
  * Adds the node to the start block.
  *
@@ -2902,6 +2903,15 @@ ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp);
  */
 ir_node *new_d_Const(dbg_info *db, tarval *con);
 
+/**
+ * @see new_rd_Const_long()
+ *
+ * @param *db    A pointer for debug information.
+ * @param *mode  The mode of the operands and results.
+ * @param value  A value from which the tarval is made.
+ */
+ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value);
+
 /** Constructor for a SymConst_type node.
  *
  *  This is the constructor for a symbolic constant.
@@ -4343,15 +4353,41 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs,
                  int n_outs, ir_asm_constraint *outputs,
                  int n_clobber, ident *clobber[], ident *asm_text);
 
-/** Constructor for a Dummy node.
+/**
+ * @brief Constructor for a Dummy node.
  *
+ * @param *db       debug info for the node
  * @param *mode     The mode of the node.
+ * @param *irg      the graph to put the node into
+ * @returns         the newly created note
  */
-ir_node *new_Dummy(ir_mode *mode);
+ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode);
 
+/**
+ * @copybrief new_rd_Dummy()
+ *
+ * @param *mode     The mode of the node.
+ * @param *irg      the graph to put the node into
+ * @returns         the newly created note
+ */
 ir_node *new_r_Dummy(ir_graph *irg, ir_mode *mode);
 
-ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode);
+/**
+ * @copybrief new_rd_Dummy()
+ *
+ * @param *db       debug info for the node
+ * @param *mode     The mode of the node.
+ * @returns         the newly created note
+ */
+ir_node *new_d_Dummy(dbg_info *db, ir_mode *mode);
+
+/**
+ * @copybrief new_rd_Dummy()
+ *
+ * @param *mode     The mode of the node.
+ * @returns         the newly created note
+ */
+ir_node *new_Dummy(ir_mode *mode);
 
 /*---------------------------------------------------------------------*/
 /* The comfortable interface.                                          */
index 78c69f6..ba17cda 100644 (file)
@@ -270,6 +270,13 @@ void dump_ir_graph_w_types_file(ir_graph *irg, FILE *out);
  */
 void dump_ir_block_graph_w_types(ir_graph *irg, const char *suffix);
 
+/**
+ * same as @see dump_ir_block_graph_w_types() but dumps to a stream
+ * @param irg  the graph to dump
+ * @param out  stream to dump to
+ */
+void dump_ir_block_graph_w_types_file(ir_graph *irg, FILE *out);
+
 /** The type of a dump function that is called for each graph.
  *
  *  @param irg     current visited graph
index 9d3484f..4e51f37 100644 (file)
@@ -161,6 +161,12 @@ void edges_reroute_kind(ir_node *old, ir_node *nw, ir_edge_kind_t kind, ir_graph
  */
 int edges_verify(ir_graph *irg);
 
+/**
+ * veriy a certrain kind of out edges of graph @p irg.
+ * @returns 1 if a problem was found, 0 otherwise
+ */
+int edges_verify_kind(ir_graph *irg, ir_edge_kind_t kind);
+
 /**
  * Set edge verification flag.
  */
index cadbe48..9126eed 100644 (file)
@@ -40,7 +40,6 @@
 #define get_irg_params        get_irg_n_locs
 #define get_irg_n_loc         get_irg_n_locs
 #define set_irg_ent(X, Y)     set_irg_entity(X, Y)
-#define set_irg_params        set_irg_n_loc
 #define no_dom                dom_none
 #define no_outs               outs_none
 
index 063ed25..1ac8756 100644 (file)
@@ -43,10 +43,12 @@ int      is_pseudo_ir_graph(ir_graph *irg);
 /** Returns the number of pseudo graphs in the program. */
 int get_irp_n_pseudo_irgs(void);
 
+/** Add a graph as pseudo irg */
+void add_irp_pseudo_irg(ir_graph *irg);
+
 /** Returns the pos'th  pseudo graph in the program. */
 ir_graph *get_irp_pseudo_irg(int pos);
 
-
 /** If set, get_irp_n_irgs() and get_irp_irg() behave as if all pseudo
     graphs are in the irg list. If not set, get_entity_irg() returns
     NULL if the entity refers to a pseudo irg. */
index f25fb28..75ce38b 100644 (file)
@@ -207,6 +207,7 @@ void *ir_arr_resize(void *elts, int nelts, size_t eltsize)
  * Do NOT use is in code, use ARR_LEN() macro!
  * This function is intended to be called from a debugger.
  */
+int array_len(const void *arr);
 int array_len(const void *arr)
 {
        return ARR_LEN(arr);
@@ -217,6 +218,7 @@ int array_len(const void *arr)
  * Do NOT use is in code!.
  * This function is intended to be called from a debugger.
  */
+ir_arr_descr *array_descr(const void *arr);
 ir_arr_descr *array_descr(const void *arr)
 {
        if (! arr)
index ead80eb..5273068 100644 (file)
 #define SCALAR_RETURN
 #define SetRangeEmpty(ptr,size)   memset(ptr, 0, (size) * sizeof(cpset_hashset_entry_t))
 
-#define hashset_init            _cpset_init
-#define hashset_init_size       _cpset_init_size
+void cpset_init_(cpset_t *self);
+#define hashset_init            cpset_init_
+void cpset_init_size_(cpset_t *self, size_t expected_elems);
+#define hashset_init_size       cpset_init_size_
 #define hashset_destroy         cpset_destroy
 #define hashset_insert          cpset_insert
 #define hashset_remove          cpset_remove
@@ -59,7 +61,7 @@ void cpset_init(cpset_t *this, cpset_hash_function hash_function,
 {
        this->hash_function = hash_function;
        this->cmp_function = cmp_function;
-       _cpset_init(this);
+       cpset_init_(this);
 }
 
 void cpset_init_size(cpset_t *this, cpset_hash_function hash_function,
@@ -67,5 +69,5 @@ void cpset_init_size(cpset_t *this, cpset_hash_function hash_function,
 {
        this->hash_function = hash_function;
        this->cmp_function = cmp_function;
-       _cpset_init_size(this, expected_elems);
+       cpset_init_size_(this, expected_elems);
 }
index 0d77761..3318fec 100644 (file)
@@ -38,6 +38,8 @@
 #include <stdlib.h>
 #include "xmalloc.h"
 
+#include "gaussjordan.h"
+
 #define SMALL 0.00001
 
 int firm_gaussjordansolve(double *A, double *vec, int nsize)
index d1bc696..be0651d 100644 (file)
@@ -325,18 +325,3 @@ void gs_matrix_dump(const gs_matrix_t *m, int a, int b, FILE *out)
 
        xfree(elems);
 }
-
-void gs_matrix_self_test(int d)
-{
-       int i, o;
-       gs_matrix_t *m = gs_new_matrix(10, 10);
-
-       for (i=0; i<d; ++i)
-               for (o=0; o<d; ++o)
-                       gs_matrix_set(m, i, o, i*o);
-
-       for (i=0; i<d; ++i)
-               for (o=0; o<d; ++o)
-                       assert(gs_matrix_get(m, i, o) == i*o);
-       gs_delete_matrix(m);
-}
index a2e5339..ed2a176 100644 (file)
 #define hashset_destroy         pset_new_destroy
 #define hashset_insert          pset_new_insert
 #define hashset_remove          pset_new_remove
-#define hashset_find            pset_new_find
+#define hashset_find            pset_new_contains
 #define hashset_size            pset_new_size
 #define hashset_iterator_init   pset_new_iterator_init
 #define hashset_iterator_next   pset_new_iterator_next
 #define hashset_remove_iterator pset_new_remove_iterator
 
 #include "hashset.c"
-
-int pset_new_contains(const pset_new_t *pset_new, const ValueType val)
-{
-       return pset_new_find(pset_new, val);
-}
index f589706..ae525d8 100644 (file)
@@ -204,8 +204,7 @@ int get_irg_callee_loop_depth(const ir_graph *irg, int pos)
        return -1;
 }
 
-
-double get_irg_callee_execution_frequency(const ir_graph *irg, int pos)
+static double get_irg_callee_execution_frequency(const ir_graph *irg, int pos)
 {
        ir_node **arr = irg->callees[pos]->call_list;
        int i, n_Calls = ARR_LEN(arr);
@@ -217,15 +216,16 @@ double get_irg_callee_execution_frequency(const ir_graph *irg, int pos)
        return freq;
 }
 
-double get_irg_callee_method_execution_frequency(const ir_graph *irg, int pos)
+static double get_irg_callee_method_execution_frequency(const ir_graph *irg,
+                                                        int pos)
 {
        double call_freq = get_irg_callee_execution_frequency(irg, pos);
        double meth_freq = get_irg_method_execution_frequency(irg);
        return call_freq * meth_freq;
 }
 
-
-double get_irg_caller_method_execution_frequency(const ir_graph *irg, int pos)
+static double get_irg_caller_method_execution_frequency(const ir_graph *irg,
+                                                        int pos)
 {
        ir_graph *caller     = get_irg_caller(irg, pos);
        int       pos_callee = reverse_pos(irg, pos);
@@ -234,7 +234,6 @@ double get_irg_caller_method_execution_frequency(const ir_graph *irg, int pos)
 }
 
 
-
 /* --------------------- Compute the callgraph ------------------------ */
 
 /**
index b69bd48..844ab6a 100644 (file)
@@ -130,7 +130,7 @@ static int just_passed_a_Raise = 0;
 static ir_node *Cond_list = NULL;
 
 /* We do not use an extra set, as Projs are not yet in the existing one. */
-void set_ProjX_probability(ir_node *n, Cond_prob prob)
+static void set_ProjX_probability(ir_node *n, Cond_prob prob)
 {
   reg_exec_freq ef;
   ef.reg  = n;
@@ -138,7 +138,7 @@ void set_ProjX_probability(ir_node *n, Cond_prob prob)
   set_insert(exec_freq_set, &ef, sizeof(ef), exec_freq_hash(&ef));
 }
 
-Cond_prob get_ProjX_probability(ir_node *n)
+static Cond_prob get_ProjX_probability(ir_node *n)
 {
   reg_exec_freq ef, *found;
   ef.reg  = n;
@@ -245,7 +245,7 @@ static void walk_post(ir_node *n, void *env)
 /** Precompute which Conds test for an exception.
  *
  *  Operates on current_ir_graph. */
-void precompute_cond_evaluation(void)
+static void precompute_cond_evaluation(void)
 {
   ir_node *c;
 
index 7cec319..c45f159 100644 (file)
  */
 #include "config.h"
 
+#include "height.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 
 #include "list.h"
-
 #include "irdump.h"
 #include "irgwalk.h"
 #include "irtools.h"
 #include "irphase_t.h"
 #include "iredges_t.h"
 
-typedef struct _heights_t heights_t;
-
 struct _heights_t {
        ir_phase ph;
        unsigned visited;
index 344b0fc..db3a3cf 100644 (file)
@@ -131,7 +131,7 @@ int get_region_n_exc_outs(void *region)
        return get_region_attr(region)->n_exc_outs;
 }
 
-void inc_region_n_exc_outs(void *region)
+static void inc_region_n_exc_outs(void *region)
 {
        (get_region_attr(region)->n_exc_outs)++;
 }
@@ -463,7 +463,7 @@ void free_intervals(void)
 /*                                                                  */
 /*------------------------------------------------------------------*/
 
-void dump_region_edges(FILE *F, void *reg)
+static void dump_region_edges(FILE *F, void *reg)
 {
        int i, n_ins = get_region_n_ins(reg);
 
index 50cc712..afb1cda 100644 (file)
@@ -788,6 +788,7 @@ int construct_ip_cf_backedges (void)
 }
 #endif
 
+#if 0
 /**
  * Clear the intra- and the interprocedural
  * backedge information pf a block.
@@ -828,7 +829,7 @@ static void loop_reset_backedges(ir_loop *l)
 
 /* Removes all cfloop information.
    Resets all backedges */
-void free_cfloop_information(ir_graph *irg)
+static void free_cfloop_information(ir_graph *irg)
 {
        ir_loop *loop = get_irg_loop(irg);
        if (loop != NULL) {
@@ -854,3 +855,5 @@ void free_all_cfloop_information(void)
        set_interprocedural_view(rem);
 #endif
 }
+
+#endif
index a25e7fb..05c394c 100644 (file)
@@ -26,6 +26,8 @@
  */
 #include "config.h"
 
+#include "irconsconfirm.h"
+
 #include "irgraph_t.h"
 #include "irnode_t.h"
 #include "ircons_t.h"
index f3d436f..fc2a1b2 100644 (file)
@@ -314,6 +314,7 @@ void lv_chk_free(lv_chk_t *lv)
        xfree(lv);
 }
 
+#if 0
 /**
  * Check if a node is live at the end of a block.
  * This function is for internal use as its code is shared between
@@ -483,6 +484,7 @@ unsigned lv_chk_bl_end_mask(const lv_chk_t *lv, const ir_node *bl, const ir_node
 end:
        return res;
 }
+#endif
 
 /**
  * Check a nodes liveness situation of a block.
index 12031b8..815977b 100644 (file)
@@ -659,48 +659,3 @@ void free_irg_outs(ir_graph *irg)
        irg_walk_graph (irg, reset_outs, NULL, NULL);
 #endif /* defined DEBUG_libfirm */
 }
-
-static void check_out_edges(ir_node *irn, void *env)
-{
-       int i, j, pos;
-       int *pError = env;
-       int error = *pError;
-       int last = is_Block(irn) ? 0 : -1;
-
-       /* check forward: every input must have an out edge */
-       for (i = get_irn_arity(irn) - 1; i >= last; --i) {
-               ir_node *pred = get_irn_n(irn, i);
-
-               for (j = get_irn_n_outs(pred) - 1; j >= 0; --j) {
-                       ir_node *user = get_irn_out_ex(pred, j, &pos);
-
-                       if (user == irn && pos == i) {
-                               break;
-                       }
-               }
-               if (j < 0) {
-                       ir_fprintf(stderr, "Missing out edge from %+F input %d to %+F", irn, i, pred);
-                       ++error;
-               }
-       }
-
-       /* checking backward */
-       for (i = get_irn_n_outs(irn) - 1; i >= 0; --i) {
-               ir_node *user = get_irn_out_ex(irn, i, &pos);
-
-               if (get_irn_n(user, pos) != irn) {
-                       ir_fprintf(stderr, "Spurious out edge from %+F output %d to %+F", irn, i, user);
-                       ++error;
-               }
-       }
-       *pError = error;
-}
-
-/* verify outs edges. */
-void verify_outs(ir_graph *irg)
-{
-       int errors = 0;
-       irg_walk_graph(irg, NULL, check_out_edges, &errors);
-       if (errors > 0)
-               panic("Out edges are corrupt");
-}
index 8b541f9..95a992d 100644 (file)
@@ -1196,79 +1196,11 @@ void free_all_loop_information(void)
 #endif
 }
 
-
-
-
-
-/* Debug stuff *************************************************/
-
-static int test_loop_node(ir_loop *l)
-{
-       int i, has_node = 0, found_problem = 0;
-       loop_element le;
-
-       assert(l && l->kind == k_ir_loop);
-
-       if (get_loop_n_elements(l) == 0) {
-               found_problem = 1;
-               dump_loop(l, "-ha");
-       }
-
-       le = get_loop_element(l, 0);
-       if (*(le.kind) != k_ir_node) {
-               assert(le.kind && *(le.kind) == k_ir_loop);
-
-               found_problem = 1;
-               dump_loop(l, "-ha");
-       }
-
-       if ((*(le.kind) == k_ir_node) && !is_possible_loop_head(le.node)) {
-               found_problem = 1;
-               dump_loop(l, "-ha");
-       }
-
-       if ((get_loop_depth(l) != 0) &&
-               (*(le.kind) == k_ir_node) && !has_backedges(le.node)) {
-                       found_problem = 1;
-                       dump_loop(l, "-ha");
-       }
-
-       /* Recur */
-       has_node = 0;
-       for (i = 0; i < get_loop_n_elements(l); ++i) {
-               le = get_loop_element(l, i);
-               if (*(le.kind) == k_ir_node)
-                       has_node++;
-               else
-                       if (test_loop_node(le.son)) found_problem = 1;
-       }
-
-       if (has_node == 0) {
-               found_problem = 1;
-               dump_loop(l, "-ha");
-       }
-
-       return found_problem;
-}
-
-/** Prints all loop nodes that
- *  - do not have any firm nodes, only loop sons
- *  - the header is not a Phi, Block or Filter.
- */
-void find_strange_loop_nodes(ir_loop *l)
-{
-       int found_problem = 0;
-       found_problem = test_loop_node(l);
-       printf("Finished Test\n\n");
-       if (found_problem) exit(0);
-
-}
-
 /* ------------------------------------------------------------------- */
 /* Simple analyses based on the loop information                       */
 /* ------------------------------------------------------------------- */
 
-int is_loop_variant(ir_loop *l, ir_loop *b)
+static int is_loop_variant(ir_loop *l, ir_loop *b)
 {
        int i, n_elems;
 
index 9809a23..d8557db 100644 (file)
  */
 #include "config.h"
 
-#include "irnode.h"
 #include "trouts.h"
 
 #include "array.h"
 #include "pmap.h"
 
+#include "irnode_t.h"
 #include "irprog_t.h"
 #include "irgwalk.h"
 #include "irnode.h"
@@ -196,7 +196,7 @@ static ir_type **get_type_arraytype_array(const ir_type *tp)
        return res;
 }
 
-void set_type_arraytype_array(const ir_type *tp, ir_type **pts)
+static void set_type_arraytype_array(const ir_type *tp, ir_type **pts)
 {
        ir_type **old = pmap_get(type_arraytype_map, tp);
        if (old != pts)
@@ -245,6 +245,7 @@ static void add_entity_access(const ir_entity *ent, ir_node *n)
        set_entity_access_array(ent, accs);
 }
 
+#if 0
 void set_entity_access(const ir_entity *ent, int pos, ir_node *n)
 {
        ir_node ** accs;
@@ -255,6 +256,7 @@ void set_entity_access(const ir_entity *ent, int pos, ir_node *n)
        accs = get_entity_access_array(ent);
        accs[pos] = n;
 }
+#endif
 
 /*------------------------------------------------------------------*/
 
@@ -290,6 +292,7 @@ static void add_entity_reference(const ir_entity *ent, ir_node *n)
        set_entity_reference_array(ent, refs);
 }
 
+#if 0
 void set_entity_reference(const ir_entity *ent, int pos, ir_node *n)
 {
        ir_node ** refs;
@@ -300,7 +303,7 @@ void set_entity_reference(const ir_entity *ent, int pos, ir_node *n)
        refs = get_entity_reference_array(ent);
        refs[pos] = n;
 }
-
+#endif
 
 /**------------------------------------------------------------------*/
 /*   Access routines for types                                       */
@@ -339,6 +342,7 @@ static void add_type_alloc(const ir_type *tp, ir_node *n)
        set_type_alloc_array(tp, allocs);
 }
 
+#if 0
 void set_type_alloc(const ir_type *tp, int pos, ir_node *n)
 {
        ir_node **allocs;
@@ -349,6 +353,7 @@ void set_type_alloc(const ir_type *tp, int pos, ir_node *n)
        allocs = get_type_alloc_array(tp);
        allocs[pos] = n;
 }
+#endif
 
 /* Number of Cast nodes that create an instance of this type */
 int get_type_n_casts(const ir_type *tp)
@@ -408,6 +413,7 @@ void add_type_cast(const ir_type *tp, ir_node *n)
        set_type_cast_array(tp, casts);
 }
 
+#if 0
 void set_type_cast(const ir_type *tp, int pos, ir_node *n)
 {
        ir_node **casts;
@@ -418,6 +424,7 @@ void set_type_cast(const ir_type *tp, int pos, ir_node *n)
        casts = get_type_cast_array(tp);
        casts[pos] = n;
 }
+#endif
 
 /*------------------------------------------------------------------*/
 
@@ -453,6 +460,7 @@ void add_type_pointertype_to(const ir_type *tp, ir_type *ptp)
        set_type_pointertype_array(tp, pts);
 }
 
+#if 0
 void set_type_pointertype_to(const ir_type *tp, int pos, ir_type *ptp)
 {
        ir_type ** pts;
@@ -463,7 +471,7 @@ void set_type_pointertype_to(const ir_type *tp, int pos, ir_type *ptp)
        pts = get_type_pointertype_array(tp);
        pts[pos] = ptp;
 }
-
+#endif
 
 /*------------------------------------------------------------------*/
 
@@ -499,6 +507,7 @@ void  add_type_arraytype_of(const ir_type *tp, ir_type *atp)
        set_type_arraytype_array(tp, pts);
 }
 
+#if 0
 void  set_type_arraytype_of(const ir_type *tp, int pos, ir_type *atp)
 {
        ir_type ** pts;
@@ -509,6 +518,7 @@ void  set_type_arraytype_of(const ir_type *tp, int pos, ir_type *atp)
        pts = get_type_arraytype_array(tp);
        pts[pos] = atp;
 }
+#endif
 
 /*------------------------------------------------------------------*/
 /* Building and Removing the out datastructure                      */
index f855453..48524a0 100644 (file)
@@ -195,7 +195,7 @@ typedef void (*emit_func_ptr) (const ir_node *);
 /**
  * Emits code for a node.
  */
-void TEMPLATE_emit_node(const ir_node *node)
+static void TEMPLATE_emit_node(const ir_node *node)
 {
        ir_op               *op       = get_irn_op(node);
 
@@ -211,7 +211,7 @@ void TEMPLATE_emit_node(const ir_node *node)
  * Walks over the nodes in a block connected by scheduling edges
  * and emits code for each node.
  */
-void TEMPLATE_gen_block(ir_node *block, void *data)
+static void TEMPLATE_gen_block(ir_node *block, void *data)
 {
        ir_node *node;
        (void) data;
@@ -232,7 +232,7 @@ void TEMPLATE_gen_block(ir_node *block, void *data)
 /**
  * Emits code for function start.
  */
-void TEMPLATE_emit_func_prolog(ir_graph *irg)
+static void TEMPLATE_emit_func_prolog(ir_graph *irg)
 {
        const char *irg_name = get_entity_name(get_irg_entity(irg));
 
@@ -246,7 +246,7 @@ void TEMPLATE_emit_func_prolog(ir_graph *irg)
 /**
  * Emits code for function end
  */
-void TEMPLATE_emit_func_epilog(ir_graph *irg)
+static void TEMPLATE_emit_func_epilog(ir_graph *irg)
 {
        const char *irg_name = get_entity_name(get_irg_entity(irg));
 
@@ -259,9 +259,8 @@ void TEMPLATE_emit_func_epilog(ir_graph *irg)
 
 /**
  * Sets labels for control flow nodes (jump target)
- * TODO: Jump optimization
  */
-void TEMPLATE_gen_labels(ir_node *block, void *env)
+static void TEMPLATE_gen_labels(ir_node *block, void *env)
 {
        ir_node *pred;
        int n = get_Block_n_cfgpreds(block);
index 100150b..b1fc946 100644 (file)
@@ -128,10 +128,10 @@ void set_TEMPLATE_req_in(ir_node *node, const arch_register_req_t *req, int pos)
 /**
  * Initializes the nodes attributes.
  */
-void init_TEMPLATE_attributes(ir_node *node, arch_irn_flags_t flags,
-                              const arch_register_req_t **in_reqs,
-                              const be_execution_unit_t ***execution_units,
-                              int n_res)
+static void init_TEMPLATE_attributes(ir_node *node, arch_irn_flags_t flags,
+                                     const arch_register_req_t **in_reqs,
+                                     const be_execution_unit_t ***execution_units,
+                                     int n_res)
 {
        ir_graph        *irg  = get_irn_irg(node);
        struct obstack  *obst = get_irg_obstack(irg);
index f7a8f5e..667a082 100644 (file)
@@ -268,7 +268,7 @@ static const arch_register_class_t *TEMPLATE_get_reg_class(unsigned i)
  * @param mode The mode in question.
  * @return A register class which can hold values of the given mode.
  */
-const arch_register_class_t *TEMPLATE_get_reg_class_for_mode(const ir_mode *mode)
+static const arch_register_class_t *TEMPLATE_get_reg_class_for_mode(const ir_mode *mode)
 {
        if (mode_is_float(mode))
                return &TEMPLATE_reg_classes[CLASS_TEMPLATE_fp];
@@ -362,8 +362,8 @@ static const be_abi_callbacks_t TEMPLATE_abi_callbacks = {
  * @param method_type The type of the method (procedure) in question.
  * @param abi         The abi object to be modified
  */
-void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
-                           be_abi_call_t *abi)
+static void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
+                                  be_abi_call_t *abi)
 {
        ir_type  *tp;
        ir_mode  *mode;
@@ -403,7 +403,7 @@ void TEMPLATE_get_call_abi(const void *self, ir_type *method_type,
        }
 }
 
-int TEMPLATE_to_appear_in_schedule(void *block_env, const ir_node *irn)
+static int TEMPLATE_to_appear_in_schedule(void *block_env, const ir_node *irn)
 {
        (void) block_env;
 
@@ -534,10 +534,10 @@ const arch_isa_if_t TEMPLATE_isa_if = {
        TEMPLATE_is_valid_clobber
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_TEMPLATE);
 void be_init_arch_TEMPLATE(void)
 {
        be_register_isa_if("TEMPLATE", &TEMPLATE_isa_if);
        FIRM_DBG_REGISTER(dbg, "firm.be.TEMPLATE.cg");
        TEMPLATE_init_transform();
 }
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_TEMPLATE);
index 86adead..847bd51 100644 (file)
@@ -193,21 +193,6 @@ void arm_emit_mode(const ir_node *node)
        arm_emit_fpa_postfix(mode);
 }
 
-/**
- * Emit a const or SymConst value.
- */
-void arm_emit_immediate(const ir_node *node)
-{
-       const arm_attr_t *attr = get_arm_attr_const(node);
-
-       if (ARM_GET_FPA_IMM(attr)) {
-               /* TODO */
-               //be_emit_irprintf("#%s", arm_get_fpa_imm_name(get_arm_imm_value(node)));
-       } else {
-               assert(!"not a Constant");
-       }
-}
-
 void arm_emit_load_mode(const ir_node *node)
 {
        const arm_load_store_attr_t *attr = get_arm_load_store_attr_const(node);
index 0984434..09214d1 100644 (file)
@@ -56,6 +56,8 @@ const arm_SwitchJmp_attr_t *get_arm_SwitchJmp_attr_const(const ir_node *node);
 arm_load_store_attr_t *get_arm_load_store_attr(ir_node *node);
 const arm_load_store_attr_t *get_arm_load_store_attr_const(const ir_node *node);
 
+arm_shifter_operand_t *get_arm_shifter_operand_attr(ir_node *node);
+
 /**
  * Returns the argument register requirements of an arm node.
  */
index c7b11b6..d52b140 100644 (file)
@@ -763,7 +763,7 @@ static const arch_register_class_t *arm_get_reg_class(unsigned i)
  * @param mode The mode in question.
  * @return A register class which can hold values of the given mode.
  */
-const arch_register_class_t *arm_get_reg_class_for_mode(const ir_mode *mode)
+static const arch_register_class_t *arm_get_reg_class_for_mode(const ir_mode *mode)
 {
        if (mode_is_float(mode))
                return &arm_reg_classes[CLASS_arm_fpa];
@@ -932,7 +932,7 @@ static const be_abi_callbacks_t arm_abi_callbacks = {
  * @param method_type The type of the method (procedure) in question.
  * @param abi         The abi object to be modified
  */
-void arm_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t *abi)
+static void arm_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t *abi)
 {
        ir_type  *tp;
        ir_mode  *mode;
@@ -994,7 +994,7 @@ void arm_get_call_abi(const void *self, ir_type *method_type, be_abi_call_t *abi
        }
 }
 
-int arm_to_appear_in_schedule(void *block_env, const ir_node *irn)
+static int arm_to_appear_in_schedule(void *block_env, const ir_node *irn)
 {
        (void) block_env;
        if (!is_arm_irn(irn))
@@ -1173,6 +1173,7 @@ const arch_isa_if_t arm_isa_if = {
        arm_is_valid_clobber
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_arm);
 void be_init_arch_arm(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -1185,5 +1186,3 @@ void be_init_arch_arm(void)
        arm_init_transform();
        arm_init_emitter();
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_arm);
index a885835..cc859ab 100644 (file)
@@ -27,6 +27,7 @@
 #ifndef FIRM_BE_BE_DBGOUT_T_H
 #define FIRM_BE_BE_DBGOUT_T_H
 
+#include "be_dbgout.h"
 #include "obst.h"
 #include "firm_types.h"
 #include "be_types.h"
@@ -47,7 +48,7 @@ typedef struct debug_ops {
        void (*main_program)(dbg_handle *handle);
 
        /** dumps the stabs for a method begin */
-       void (*method_begin)(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout);
+       void (*method_begin)(dbg_handle *handle, const ir_entity *ent, const be_stack_layout_t *layout);
 
        /** dumps the stabs for a method end */
        void (*method_end)(dbg_handle *handle);
@@ -56,7 +57,7 @@ typedef struct debug_ops {
        void (*types)(dbg_handle *handle);
 
        /** dump a variable in the global type */
-       void (*variable)(dbg_handle *h, ir_entity *ent);
+       void (*variable)(dbg_handle *h, const ir_entity *ent);
 
        /** notify debug info about position change */
        void (*set_dbg_info)(dbg_handle *h, dbg_info *dbgi);
index e631e02..2daec1f 100644 (file)
@@ -2665,9 +2665,8 @@ int be_abi_omit_fp(const be_abi_irg_t *abi)
        return abi->call->flags.bits.try_omit_fp;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_abi);
 void be_init_abi(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.abi");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_abi);
index c37cb2a..801db20 100644 (file)
@@ -734,6 +734,7 @@ static ir_node **create_block_schedule_ilp(ir_graph *irg, ir_exec_freq *execfreq
  * |_|  |_|\__,_|_|_| |_|
  *
  */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_blocksched);
 void be_init_blocksched(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -744,8 +745,6 @@ void be_init_blocksched(void)
        FIRM_DBG_REGISTER(dbg, "firm.be.blocksched");
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_blocksched);
-
 ir_node **be_create_block_schedule(ir_graph *irg, ir_exec_freq *execfreqs)
 {
        switch (algo) {
index e084b8c..54a9e1f 100644 (file)
@@ -607,6 +607,7 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env)
        del_pset(env.pre_colored);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal);
 void be_init_chordal(void)
 {
        static be_ra_chordal_coloring_t coloring = {
@@ -616,5 +617,3 @@ void be_init_chordal(void)
 
        be_register_chordal_coloring("default", &coloring);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal);
index f4ec6b1..a58d3da 100644 (file)
  * @date        08.12.2004
  * @version     $Id: bechordal.c 26750 2009-11-27 09:37:43Z bersch $
  */
-
 #include "config.h"
+
+#include "bechordal_common.h"
+
 #include "debug.h"
 
 #include "iredges.h"
@@ -292,9 +294,8 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
        return perm;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_common);
 void be_init_chordal_common(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.chordal_common");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_common);
index 30128de..d9ae4c3 100644 (file)
@@ -137,7 +137,7 @@ static void ps_box(plotter_t *_self, const rect_t *rect)
                rect->x, rect->y, rect->w, rect->h);
 }
 
-void ps_text(plotter_t *_self, int x, int y, const char *str)
+static void ps_text(plotter_t *_self, int x, int y, const char *str)
 {
        decl_self(ps_plotter_t, _self);
 
index 103f891..f2264be 100644 (file)
@@ -161,7 +161,7 @@ void be_register_chordal_coloring(const char *name, be_ra_chordal_coloring_t *co
        be_add_module_to_list(&colorings, name, coloring);
 }
 
-void be_ra_chordal_coloring(be_chordal_env_t *env)
+static void be_ra_chordal_coloring(be_chordal_env_t *env)
 {
        assert(selected_coloring != NULL);
        if (selected_coloring != NULL) {
@@ -169,7 +169,6 @@ void be_ra_chordal_coloring(be_chordal_env_t *env)
        }
 }
 
-
 static void dump(unsigned mask, ir_graph *irg,
                                 const arch_register_class_t *cls,
                                 const char *suffix,
@@ -488,6 +487,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
        be_timer_pop(T_RA_OTHER);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_main);
 void be_init_chordal_main(void)
 {
        static be_ra_t be_ra_chordal_allocator = {
@@ -503,5 +503,3 @@ void be_init_chordal_main(void)
        lc_opt_add_table(chordal_grp, be_chordal_options);
        be_add_module_list_opt(chordal_grp, "coloring", "select coloring methode", &colorings, (void**) &selected_coloring);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_main);
index 8d11440..6d4adff 100644 (file)
@@ -653,6 +653,7 @@ int co_solve_heuristic(copy_opt_t *co)
        return 0;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur);
 void be_init_copyheur(void)
 {
        static co_algo_info copyheur = {
@@ -662,5 +663,3 @@ void be_init_copyheur(void)
        be_register_copyopt("heur1", &copyheur);
        FIRM_DBG_REGISTER(dbg, "ir.be.copyoptheur");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur);
index c247865..322d03d 100644 (file)
@@ -228,7 +228,7 @@ static int col_cost_pair_lt(const void *a, const void *b)
        return QSORT_CMP(c, d);
 }
 
-int cmp_edges(const void *a, const void *b)
+static int cmp_edges(const void *a, const void *b)
 {
        const edge_t *p = a;
        const edge_t *q = b;
@@ -1265,6 +1265,7 @@ int co_solve_heuristic_new(copy_opt_t *co)
        return 0;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);
 void be_init_copyheur2(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -1279,5 +1280,3 @@ void be_init_copyheur2(void)
        lc_opt_add_table(co2_grp, options);
        be_register_copyopt("heur2", &copyheur);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);
index 59d39f6..ece1314 100644 (file)
@@ -1505,7 +1505,7 @@ static const lc_opt_table_entry_t options[] = {
        LC_OPT_LAST
 };
 
-
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur4);
 void be_init_copyheur4(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -1523,5 +1523,3 @@ void be_init_copyheur4(void)
 
        FIRM_DBG_REGISTER(dbg, "firm.be.co.heur4");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur4);
index 5f0134d..7d9c0fd 100644 (file)
@@ -65,6 +65,7 @@ static const lc_opt_table_entry_t options[] = {
        LC_OPT_LAST
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp);
 void be_init_copyilp(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -76,8 +77,6 @@ void be_init_copyilp(void)
        lc_opt_add_table(ilp_grp, options);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp);
-
 #include "becopyilp_t.h"
 #include "beifg_t.h"
 
index f274c5a..8c3abfb 100644 (file)
@@ -551,6 +551,7 @@ static void ilp2_apply(ilp_env_t *ienv)
 #endif
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp2);
 void be_init_copyilp2(void)
 {
        static co_algo_info copyheur = {
@@ -560,8 +561,6 @@ void be_init_copyilp2(void)
        be_register_copyopt("ilp", &copyheur);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyilp2);
-
 int co_solve_ilp2(copy_opt_t *co)
 {
        lpp_sol_state_t sol_state;
index 930233e..68597fb 100644 (file)
@@ -136,6 +136,7 @@ void be_register_copyopt(const char *name, co_algo_info *copyopt)
        be_add_module_to_list(&copyopts, name, copyopt);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyopt);
 void be_init_copyopt(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -148,14 +149,13 @@ void be_init_copyopt(void)
                                       &copyopts, (void**) &selected_copyopt);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyopt);
-
 static int void_algo(copy_opt_t *co)
 {
        (void) co;
        return 0;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copynone);
 void be_init_copynone(void)
 {
        static co_algo_info copyheur = {
@@ -165,8 +165,6 @@ void be_init_copynone(void)
        be_register_copyopt("none", &copyheur);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copynone);
-
 #undef QUICK_AND_DIRTY_HACK
 
 static int nodes_interfere(const be_chordal_env_t *env, const ir_node *a, const ir_node *b)
index a21f0db..220a43e 100644 (file)
@@ -113,6 +113,7 @@ int curr_vals[ASIZE];
 static ir_nodeset_t *all_phi_nodes;
 static ir_nodeset_t *all_copy_nodes;
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copystat);
 void be_init_copystat(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.copystat");
@@ -121,14 +122,13 @@ void be_init_copystat(void)
        all_copy_nodes = ir_nodeset_new(64);
        memset(curr_vals, 0, sizeof(curr_vals));
 }
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copystat);
 
+BE_REGISTER_MODULE_DESTRUCTOR(be_quit_copystat);
 void be_quit_copystat(void)
 {
        ir_nodeset_del(all_phi_nodes);
        ir_nodeset_del(all_copy_nodes);
 }
-BE_REGISTER_MODULE_DESTRUCTOR(be_quit_copystat);
 
 /**
  * @return 1 if the block at pos @p pos removed a critical edge
index 15e8f00..2889cff 100644 (file)
@@ -50,7 +50,7 @@ void be_dbg_main_program(void)
                handle->ops->main_program(handle);
 }
 
-void be_dbg_method_begin(ir_entity *ent, const be_stack_layout_t *layout)
+void be_dbg_method_begin(const ir_entity *ent, const be_stack_layout_t *layout)
 {
        if (handle->ops->method_begin)
                handle->ops->method_begin(handle, ent, layout);
@@ -68,7 +68,7 @@ void be_dbg_types(void)
                handle->ops->types(handle);
 }
 
-void be_dbg_variable(ir_entity *ent)
+void be_dbg_variable(const ir_entity *ent)
 {
        if (handle->ops->variable)
                handle->ops->variable(handle, ent);
@@ -103,6 +103,7 @@ static dbg_handle *create_null_dbgout_module(void)
        return &null_handle;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_dbgout);
 void be_init_dbgout(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -111,5 +112,3 @@ void be_init_dbgout(void)
                               &dbgout_modules, (void**) &selected_dbgout_module);
        be_register_dbgout_module("none", create_null_dbgout_module);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_dbgout);
index 126e7e4..2a3a5e5 100644 (file)
@@ -175,33 +175,6 @@ int (be_ifg_degree)(const be_ifg_t *ifg, const ir_node *irn)
 }
 
 
-int be_ifg_is_simplicial(const be_ifg_t *ifg, const ir_node *irn)
-{
-       int degree = be_ifg_degree(ifg, irn);
-       void *iter = be_ifg_neighbours_iter_alloca(ifg);
-
-       ir_node **neighbours = XMALLOCN(ir_node*, degree);
-
-       ir_node *curr;
-       int i, j;
-
-       i = 0;
-       be_ifg_foreach_neighbour(ifg, iter, irn, curr)
-               neighbours[i++] = curr;
-
-       for (i = 0; i < degree; ++i) {
-               for (j = 0; j < i; ++j)
-                       if (!be_ifg_connected(ifg, neighbours[i], neighbours[j])) {
-                               free(neighbours);
-                               return 0;
-                       }
-       }
-
-
-       free(neighbours);
-       return 1;
-}
-
 void be_ifg_check(const be_ifg_t *ifg)
 {
        void *iter1 = be_ifg_nodes_iter_alloca(ifg);
@@ -238,7 +211,7 @@ void be_ifg_check(const be_ifg_t *ifg)
        ir_printf("\n\nFound %d nodes in the 'check neighbour section'\n", neighbours_count);
 }
 
-int be_ifg_check_get_node_count(const be_ifg_t *ifg)
+static int be_ifg_check_get_node_count(const be_ifg_t *ifg)
 {
        void *iter = be_ifg_nodes_iter_alloca(ifg);
        int node_count = 0;
@@ -731,6 +704,7 @@ static const lc_opt_table_entry_t be_ifg_options[] = {
        LC_OPT_LAST
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ifg);
 void be_init_ifg(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -739,7 +713,6 @@ void be_init_ifg(void)
        lc_opt_add_table(ifg_grp, be_ifg_options);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ifg);
 
 static FILE *be_ifg_open(const be_chordal_env_t *env, const char *prefix)
 {
index 1976273..ef5b017 100644 (file)
@@ -40,6 +40,7 @@
 #include "be_t.h"
 #include "beintlive_t.h"
 #include "beifg_t.h"
+#include "beifg_impl.h"
 #include "bechordal_t.h"
 
 typedef struct _cli_head_t {
index 117815e..c853b97 100644 (file)
 #include "irgraph_t.h"
 #include "irgwalk.h"
 
+#include "beifg_impl.h"
 #include "bearch.h"
 #include "be_t.h"
 #include "bera.h"
 #include "beifg_t.h"
 #include "bechordal_t.h"
 
-
 typedef struct _adj_head_t adj_head_t;
 
 typedef struct _ifg_list_t {
index 9d39d3c..48e8aa2 100644 (file)
@@ -40,6 +40,7 @@
 #include "be_t.h"
 #include "bera.h"
 #include "beifg_t.h"
+#include "beifg_impl.h"
 #include "bechordal_t.h"
 
 typedef struct _ptr_element_t ptr_element_t;
index 084de31..a68a86f 100644 (file)
@@ -41,6 +41,7 @@
 #include "belive_t.h"
 #include "bera.h"
 #include "beifg_t.h"
+#include "beifg_impl.h"
 #include "bechordal_t.h"
 #include "beirg.h"
 #include "beintlive_t.h"
index 29e42d0..2324ef8 100644 (file)
@@ -69,6 +69,7 @@
 #include "beirg.h"
 #include "bemachine.h"
 #include "belistsched.h"
+#include "bemodule.h"
 
 typedef struct _ilpsched_options_t {
        unsigned regpress;
@@ -2072,6 +2073,7 @@ void be_ilp_sched(const be_irg_t *birg, be_options_t *be_opts)
 /**
  * Register ILP scheduler options.
  */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ilpsched);
 void be_init_ilpsched(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
index 5c9c623..0005b7b 100644 (file)
@@ -280,9 +280,8 @@ int be_remove_empty_blocks(ir_graph *irg)
        return blocks_removed;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod);
 void be_init_irgmod(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.irgmod");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_irgmod);
index 38f04a4..29cf285 100644 (file)
@@ -662,9 +662,7 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block,
        DEL_ARR_F(env.sched_info);
 }
 
-/**
- * Register list scheduler options.
- */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_listsched);
 void be_init_listsched(void)
 {
        lc_opt_entry_t *be_grp    = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -674,5 +672,3 @@ void be_init_listsched(void)
 
        FIRM_DBG_REGISTER(dbg, "firm.be.sched");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_listsched);
index 1f0a215..1cf291f 100644 (file)
@@ -77,16 +77,6 @@ static inline int is_liveness_node(const ir_node *irn)
        }
 }
 
-int (be_lv_next_irn)(const struct _be_lv_t *lv, const ir_node *bl, unsigned flags, int i)
-{
-       return _be_lv_next_irn(lv, bl, flags, i);
-}
-
-const ir_node * (be_lv_get_irn)(const struct _be_lv_t *lv, const ir_node *bl, int i)
-{
-       return _be_lv_get_irn(lv, bl, i);
-}
-
 int (be_is_live_in)(const be_lv_t *lv, const ir_node *block, const ir_node *irn)
 {
        return _be_is_live_xxx(lv, block, irn, be_lv_state_in);
@@ -915,9 +905,8 @@ void be_live_chk_compare(be_lv_t *lv, lv_chk_t *lvc)
        obstack_free(&obst, NULL);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_live);
 void be_init_live(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.liveness");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_live);
index 73c87c0..a5e7be2 100644 (file)
@@ -244,9 +244,8 @@ void be_free_loop_pressure(be_loopana_t *loop_ana)
        xfree(loop_ana);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_loopana);
 void be_init_loopana(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.loopana");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_loopana);
index deba924..b4369df 100644 (file)
@@ -202,8 +202,8 @@ static int set_opt_module(const char *name, lc_opt_type_t type, void *data,
 /**
  * Dump the names of all registered module options.
  */
-int dump_opt_module(char *buf, size_t buflen, const char *name,
-                    lc_opt_type_t type, void *data, size_t length)
+static int dump_opt_module(char *buf, size_t buflen, const char *name,
+                           lc_opt_type_t type, void *data, size_t length)
 {
        module_opt_data_t            *moddata = data;
        const be_module_list_entry_t *module;
@@ -225,8 +225,8 @@ int dump_opt_module(char *buf, size_t buflen, const char *name,
 /**
  * Dump the values of all register module options.
  */
-int dump_opt_module_vals(char *buf, size_t buflen, const char *name,
-                         lc_opt_type_t type, void *data, size_t len)
+static int dump_opt_module_vals(char *buf, size_t buflen, const char *name,
+                                lc_opt_type_t type, void *data, size_t len)
 {
        module_opt_data_t            *moddata = data;
        char                         *p       = buf;
index 95e6911..db84248 100644 (file)
  * Currently you have to add modules manually in the list in bemodule.c.
  * However future extensions might allow them to be automatically discovered
  * when they are marked with BE_REGISTER_MODULE_CONSTRUCTOR
+ *
+ * Add this before your constructor as it will declare the function
  */
-#define BE_REGISTER_MODULE_CONSTRUCTOR(func)
+#define BE_REGISTER_MODULE_CONSTRUCTOR(func)         void func(void);
 
 /**
  * Mark a function as module destructor.
+ *
+ * Add this before your constructor as it will declare the function
  */
-#define BE_REGISTER_MODULE_DESTRUCTOR(func)
+#define BE_REGISTER_MODULE_DESTRUCTOR(func)          void func(void);
 
 /**
  * Call all module constructors
index 46cf340..839220e 100644 (file)
@@ -832,15 +832,15 @@ ir_node *be_Barrier_append_node(ir_node *barrier, ir_node *node)
        return proj;
 }
 
-int be_has_frame_entity(const ir_node *irn)
+static bool be_has_frame_entity(const ir_node *irn)
 {
        switch (get_irn_opcode(irn)) {
        case beo_Spill:
        case beo_Reload:
        case beo_FrameAddr:
-               return 1;
+               return true;
        default:
-               return 0;
+               return false;
        }
 }
 
index 8410e86..cc726c9 100644 (file)
@@ -136,7 +136,8 @@ void be_peephole_new_node(ir_node * nw)
  * Note: killing a node and rewiring os only allowed if new_node produces
  * the same registers as old_node.
  */
-void be_peephole_before_exchange(const ir_node *old_node, ir_node *new_node)
+static void be_peephole_before_exchange(const ir_node *old_node,
+                                        ir_node *new_node)
 {
        const arch_register_t       *reg;
        const arch_register_class_t *cls;
@@ -402,14 +403,8 @@ void be_peephole_opt(be_irg_t *birg)
        irg_block_walk_graph(irg, process_block, NULL, NULL);
 }
 
-void be_peephole_init(void)
-{
-       clear_irp_opcodes_generic_func();
-}
-
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_peephole);
 void be_init_peephole(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.peephole");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_peephole);
index 2c47932..d77565b 100644 (file)
@@ -2024,9 +2024,7 @@ static void be_pref_alloc(be_irg_t *new_birg)
        obstack_free(&obst, NULL);
 }
 
-/**
- * Initializes this module.
- */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pref_alloc);
 void be_init_pref_alloc(void)
 {
        static be_ra_t be_ra_pref = {
@@ -2039,5 +2037,3 @@ void be_init_pref_alloc(void)
        be_register_allocator("pref", &be_ra_pref);
        FIRM_DBG_REGISTER(dbg, "firm.be.prefalloc");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pref_alloc);
index 59b05a4..345c892 100644 (file)
@@ -26,6 +26,8 @@
  */
 #include "config.h"
 
+#include "bepressurestat.h"
+
 #include <math.h>
 
 #include "hashptr.h"
index 2e7f801..4e408d8 100644 (file)
@@ -61,6 +61,7 @@ void be_allocate_registers(be_irg_t *birg)
        }
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ra);
 void be_init_ra(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -68,4 +69,3 @@ void be_init_ra(void)
        be_add_module_list_opt(be_grp, "regalloc", "register allocator",
                               &register_allocators, (void**) &selected_allocator);
 }
-BE_REGISTER_MODULE_CONSTRUCTOR(init_be_ra);
index 6f2b113..3bf0b69 100644 (file)
@@ -81,14 +81,12 @@ void be_sched_dump(FILE *f, ir_graph *irg)
        irg_block_walk_graph(irg, block_sched_dumper, NULL, f);
 }
 
-/* Init the scheduling stuff. */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_sched);
 void be_init_sched(void)
 {
        sched_irn_data_offset = firm_register_additional_node_data(sizeof(sched_info_t));
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_sched);
-
 void sched_renumber(const ir_node *block)
 {
        ir_node *irn;
index e78f978..439c45e 100644 (file)
@@ -54,6 +54,7 @@ void    sched_add_before(ir_node *before, ir_node *irn);
 void    sched_add_after(ir_node *after, ir_node *irn);
 void    sched_init_block(ir_node *block);
 void    sched_reset(ir_node *node);
+int     sched_comes_after(const ir_node *n1, const ir_node *n2);
 void    sched_remove(ir_node *irn);
 
 #define sched_is_end(irn)   is_Block(irn)
index 46aa21b..40251e0 100644 (file)
@@ -421,7 +421,7 @@ static void *normal_init_block(void *graph_env, ir_node *block)
        return inst;
 }
 
-void normal_finish_graph(void *env)
+static void normal_finish_graph(void *env)
 {
        instance_t *inst = env;
 
index e05ebb3..ca23f2d 100644 (file)
@@ -30,6 +30,8 @@
  */
 #include "config.h"
 
+#include "beschedrss.h"
+
 #include <limits.h>
 
 #include "obst.h"
@@ -2174,9 +2176,7 @@ static void process_block(ir_node *block, void *env)
        phase_free(&rss->ph);
 }
 
-/**
- * Register the options.
- */
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_schedrss);
 void be_init_schedrss(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -2186,8 +2186,6 @@ void be_init_schedrss(void)
        lc_opt_add_table(rss_grp, rss_option_table);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_schedrss);
-
 /**
  * Preprocess the irg for scheduling.
  */
index 523e96e..4b9a940 100644 (file)
@@ -281,6 +281,7 @@ void be_do_spill(be_irg_t *birg, const arch_register_class_t *cls)
        selected_spiller->spill(birg, cls);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spilloptions);
 void be_init_spilloptions(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -292,5 +293,3 @@ void be_init_spilloptions(void)
 
        FIRM_DBG_REGISTER(dbg, "firm.be.spillprepare");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spilloptions);
index 079606e..d9f7a09 100644 (file)
@@ -118,15 +118,6 @@ static int loc_compare(const void *a, const void *b)
        return p->time - q->time;
 }
 
-void workset_print(const workset_t *w)
-{
-       int i;
-
-       for (i = 0; i < w->len; ++i) {
-               ir_fprintf(stderr, "%+F %d\n", w->vals[i].node, w->vals[i].time);
-       }
-}
-
 /**
  * Alloc a new workset on obstack @p ob with maximum size @p max
  */
@@ -1003,6 +994,7 @@ static void be_spill_belady(be_irg_t *birg, const arch_register_class_t *rcls)
        obstack_free(&obst, NULL);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady);
 void be_init_spillbelady(void)
 {
        static be_spiller_t belady_spiller = {
@@ -1015,5 +1007,3 @@ void be_init_spillbelady(void)
        be_register_spiller("belady", &belady_spiller);
        FIRM_DBG_REGISTER(dbg, "firm.be.spill.belady");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady);
index ea454bb..9216650 100644 (file)
@@ -1471,7 +1471,7 @@ static void collect_blocks(ir_node *bl, void *data)
  * @param birg  The backend graph
  * @param cls   The register class to spill
  */
-void be_spill_belady(be_irg_t *birg, const arch_register_class_t *cls)
+static void be_spill_belady(be_irg_t *birg, const arch_register_class_t *cls)
 {
        ir_graph *irg = be_get_birg_irg(birg);
        belady_env_t env;
@@ -1534,6 +1534,7 @@ void be_spill_belady(be_irg_t *birg, const arch_register_class_t *cls)
        obstack_free(&env.ob, NULL);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady2);
 void be_init_spillbelady2(void)
 {
        lc_opt_entry_t *be_grp    = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -1548,5 +1549,3 @@ void be_init_spillbelady2(void)
        be_register_spiller("belady2", &belady_spiller);
        FIRM_DBG_REGISTER(dbg, "firm.be.spill.belady2");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady2);
index 2bac5bb..a504067 100644 (file)
@@ -1048,6 +1048,7 @@ static void be_spill_belady3(be_irg_t *birg, const arch_register_class_t *ncls)
        be_delete_spill_env(senv);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady3);
 void be_init_spillbelady3(void)
 {
        static be_spiller_t belady3_spiller = {
@@ -1057,5 +1058,3 @@ void be_init_spillbelady3(void)
        be_register_spiller("belady3", &belady3_spiller);
        FIRM_DBG_REGISTER(dbg, "firm.be.spill.belady3");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady3);
index ea89086..dbd9533 100644 (file)
@@ -377,7 +377,7 @@ static void spill_block(ir_node *block, void *data)
        ir_nodeset_destroy(&live_nodes);
 }
 
-void be_spill_daemel(be_irg_t *birg, const arch_register_class_t *new_cls)
+static void be_spill_daemel(be_irg_t *birg, const arch_register_class_t *new_cls)
 {
        ir_graph     *irg    = be_get_birg_irg(birg);
        n_regs = new_cls->n_regs - be_put_ignore_regs(birg, new_cls, NULL);
@@ -405,6 +405,7 @@ void be_spill_daemel(be_irg_t *birg, const arch_register_class_t *new_cls)
        spill_env = NULL;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_daemelspill);
 void be_init_daemelspill(void)
 {
        static be_spiller_t daemel_spiller = {
@@ -414,5 +415,3 @@ void be_init_daemelspill(void)
        be_register_spiller("daemel", &daemel_spiller);
        FIRM_DBG_REGISTER(dbg, "firm.be.spilldaemel");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_daemelspill);
index 6a6906b..fdf1922 100644 (file)
@@ -838,9 +838,8 @@ void be_coalesce_spillslots(be_irg_t *birg)
        be_free_frame_entity_coalescer(env);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillslots);
 void be_init_spillslots(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.spillslots");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillslots);
index c2ce660..cbb52bc 100644 (file)
@@ -1052,9 +1052,8 @@ void be_insert_spills_reloads(spill_env_t *env)
        be_timer_pop(T_RA_SPILL_APPLY);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spill);
 void be_init_spill(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.spill");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spill);
index e12f273..07d56ca 100644 (file)
@@ -420,9 +420,8 @@ void be_ssa_construction_update_liveness_phis(be_ssa_construction_env_t *env,
        be_timer_pop(T_SSA_CONSTR);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ssaconstr);
 void be_init_ssaconstr(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.ssaconstr");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ssaconstr);
index 08f6841..7b94722 100644 (file)
@@ -26,6 +26,8 @@
  */
 #include "config.h"
 
+#include "bessadestr.h"
+
 #include "debug.h"
 #include "set.h"
 #include "pmap.h"
index 36b6e1a..a591884 100644 (file)
@@ -116,7 +116,7 @@ enum stabs_types {
  */
 typedef struct stabs_handle {
        dbg_handle              base;         /**< the base class */
-       ir_entity               *cur_ent;     /**< current method entity */
+       const ir_entity               *cur_ent;     /**< current method entity */
        const be_stack_layout_t *layout;      /**< current stack layout */
        unsigned                next_type_nr; /**< next type number */
        pmap                    *type_map;    /**< a map from type to type number */
@@ -292,7 +292,7 @@ static void gen_enum_type(stabs_handle *h, ir_type *tp)
 /**
  * print a pointer type
  */
-void print_pointer_type(stabs_handle *h, ir_type *tp, int local)
+static void print_pointer_type(stabs_handle *h, ir_type *tp, int local)
 {
        unsigned     type_num = local ? h->next_type_nr++ : get_type_number(h, tp);
        ir_type      *el_tp   = get_pointer_points_to_type(tp);
@@ -677,7 +677,7 @@ static void stabs_set_dbg_info(dbg_handle *h, dbg_info *dbgi)
 /**
  * dump the stabs for a method begin
  */
-static void stabs_method_begin(dbg_handle *handle, ir_entity *ent, const be_stack_layout_t *layout)
+static void stabs_method_begin(dbg_handle *handle, const ir_entity *ent, const be_stack_layout_t *layout)
 {
        stabs_handle *h = (stabs_handle *)handle;
        ir_type      *mtp, *rtp;
@@ -749,7 +749,7 @@ static void stabs_method_begin(dbg_handle *handle, ir_entity *ent, const be_stac
 static void stabs_method_end(dbg_handle *handle)
 {
        stabs_handle            *h = (stabs_handle *)handle;
-       ir_entity               *ent = h->cur_ent;
+       const ir_entity         *ent = h->cur_ent;
        const be_stack_layout_t *layout = h->layout;
        const char              *ld_name = get_entity_ld_name(ent);
        int                     i, n, frame_size;
@@ -807,7 +807,7 @@ static void stabs_types(dbg_handle *handle)
 /**
  * dump a variable in the global type
  */
-static void stabs_variable(dbg_handle *handle, ir_entity *ent)
+static void stabs_variable(dbg_handle *handle, const ir_entity *ent)
 {
        stabs_handle *h = (stabs_handle *)handle;
        unsigned tp_num = get_type_number(h, get_entity_type(ent));
@@ -855,7 +855,7 @@ static const debug_ops stabs_ops = {
 };
 
 /* Opens a stabs handler */
-dbg_handle *be_stabs_open(void)
+static dbg_handle *be_stabs_open(void)
 {
        stabs_handle *h = XMALLOCZ(stabs_handle);
 
@@ -865,9 +865,8 @@ dbg_handle *be_stabs_open(void)
        return &h->base;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_stabs);
 void be_init_stabs(void)
 {
        be_register_dbgout_module("stabs", be_stabs_open);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_stabs);
index bb09616..c83bc6c 100644 (file)
@@ -599,9 +599,8 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
        obstack_free(&env.obst, NULL);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_state);
 void be_init_state(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.state");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_state);
index 9879794..4ff347a 100644 (file)
@@ -1771,7 +1771,7 @@ static const arch_register_class_t *ia32_get_reg_class(unsigned i)
  * @param mode The mode in question.
  * @return A register class which can hold values of the given mode.
  */
-const arch_register_class_t *ia32_get_reg_class_for_mode(const ir_mode *mode)
+static const arch_register_class_t *ia32_get_reg_class_for_mode(const ir_mode *mode)
 {
        if (mode_is_float(mode)) {
                return ia32_cg_config.use_sse2 ? &ia32_reg_classes[CLASS_ia32_xmm] : &ia32_reg_classes[CLASS_ia32_vfp];
@@ -1975,7 +1975,7 @@ static void ia32_get_call_abi(const void *self, ir_type *method_type,
        }
 }
 
-int ia32_to_appear_in_schedule(void *block_env, const ir_node *irn)
+static int ia32_to_appear_in_schedule(void *block_env, const ir_node *irn)
 {
        (void) block_env;
 
@@ -2505,6 +2505,7 @@ const arch_isa_if_t ia32_isa_if = {
        ia32_is_valid_clobber
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_ia32);
 void be_init_arch_ia32(void)
 {
        lc_opt_entry_t *be_grp   = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -2522,5 +2523,3 @@ void be_init_arch_ia32(void)
        ia32_init_x87();
        ia32_init_architecture();
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_ia32);
index dea7d5f..1954f4e 100644 (file)
@@ -975,7 +975,7 @@ void init_ia32_climbframe_attributes(ir_node *res, unsigned count)
  ***************************************************************************************/
 
 /* default compare operation to compare attributes */
-int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b)
+static int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b)
 {
        if (a->data.tp != b->data.tp)
                return 1;
index b65844b..5c35359 100644 (file)
@@ -79,6 +79,8 @@ const ia32_x87_attr_t *get_ia32_x87_attr_const(const ir_node *node);
 ia32_immediate_attr_t *get_ia32_immediate_attr(ir_node *node);
 const ia32_immediate_attr_t *get_ia32_immediate_attr_const(const ir_node *node);
 
+const ia32_asm_attr_t *get_ia32_asm_attr_const(const ir_node *node);
+
 /**
  * Gets the condcode attributes of a node.
  */
index 2a0491f..c53821e 100644 (file)
@@ -372,7 +372,7 @@ static const arch_register_class_t *mips_get_reg_class(unsigned i)
  * @param mode The mode in question.
  * @return A register class which can hold values of the given mode.
  */
-const arch_register_class_t *mips_get_reg_class_for_mode(const ir_mode *mode)
+static const arch_register_class_t *mips_get_reg_class_for_mode(const ir_mode *mode)
 {
        (void) mode;
        ASSERT_NO_FLOAT(mode);
@@ -728,9 +728,8 @@ const arch_isa_if_t mips_isa_if = {
        mips_is_valid_clobber
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_mips);
 void be_init_arch_mips(void)
 {
        be_register_isa_if("mips", &mips_isa_if);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_mips);
index 6a053fd..6490917 100644 (file)
@@ -50,8 +50,6 @@
 #include "mips_new_nodes.h"
 #include "mips_map_regs.h"
 
-DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
-
 #define SNPRINTF_BUF_LEN 128
 
 /**
@@ -679,7 +677,7 @@ static void mips_emit_node(const ir_node *node)
  * Walks over the nodes in a block connected by scheduling edges
  * and emits code for each node.
  */
-void mips_gen_block(const ir_node *block)
+static void mips_gen_block(const ir_node *block)
 {
        ir_node *node;
 
@@ -701,7 +699,7 @@ void mips_gen_block(const ir_node *block)
 /**
  * Emits code for function start.
  */
-void mips_emit_func_prolog(ir_graph *irg)
+static void mips_emit_func_prolog(ir_graph *irg)
 {
        ident *irg_ident = get_entity_ld_ident(get_irg_entity(irg));
 
@@ -736,7 +734,7 @@ void mips_emit_func_prolog(ir_graph *irg)
 /**
  * Emits code for function end
  */
-void mips_emit_func_epilog(ir_graph *irg)
+static void mips_emit_func_epilog(ir_graph *irg)
 {
        ident *irg_ident = get_entity_ident(get_irg_entity(irg));
 
@@ -749,7 +747,7 @@ void mips_emit_func_epilog(ir_graph *irg)
 /**
  * Sets labels for control flow nodes (jump target)
  */
-void mips_gen_labels(ir_node *block, void *env)
+static void mips_gen_labels(ir_node *block, void *env)
 {
        ir_node *pred;
        int n = get_Block_n_cfgpreds(block);
@@ -782,8 +780,3 @@ void mips_gen_routine(mips_code_gen_t *mips_cg, ir_graph *irg)
 
        mips_emit_func_epilog(irg);
 }
-
-void mips_init_emitter(void)
-{
-       FIRM_DBG_REGISTER(dbg, "firm.be.mips.emitter");
-}
index 4f49df1..0972131 100644 (file)
@@ -596,7 +596,7 @@ static const arch_register_class_t *ppc32_get_reg_class(unsigned i)
  * @param mode The mode in question.
  * @return A register class which can hold values of the given mode.
  */
-const arch_register_class_t *ppc32_get_reg_class_for_mode(const ir_mode *mode)
+static const arch_register_class_t *ppc32_get_reg_class_for_mode(const ir_mode *mode)
 {
        if (mode_is_float(mode))
                return &ppc32_reg_classes[CLASS_ppc32_fp];
@@ -686,7 +686,7 @@ static void ppc32_get_call_abi(const void *self, ir_type *method_type, be_abi_ca
        }
 }
 
-int ppc32_to_appear_in_schedule(void *block_env, const ir_node *irn)
+static int ppc32_to_appear_in_schedule(void *block_env, const ir_node *irn)
 {
        (void) block_env;
        if (!is_ppc32_irn(irn))
@@ -816,9 +816,8 @@ const arch_isa_if_t ppc32_isa_if = {
        ppc32_is_valid_clobber
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_ppc32);
 void be_init_arch_ppc32(void)
 {
        be_register_isa_if("ppc32", &ppc32_isa_if);
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_ppc32);
index b500605..faa0e34 100644 (file)
@@ -668,7 +668,7 @@ static void ppc32_emit_end(ir_graph *irg)
  * Sets labels for control flow nodes (jump target)
  * TODO: Jump optimization
  */
-void ppc32_gen_labels(ir_node *block, void *env)
+static void ppc32_gen_labels(ir_node *block, void *env)
 {
        ir_node *pred;
        int n;
index e5420cc..b4424cb 100644 (file)
@@ -71,7 +71,7 @@ const arch_register_t *ppc32_get_firm_reg(const ir_node *irn, set *reg_set)
 }
 
 
-int is_ppc32_Load(const ir_node *n)
+static int is_ppc32_Load(const ir_node *n)
 {
        ir_op *op = get_irn_op(n);
        if (op == op_ppc32_Lbz) return 1;
@@ -84,7 +84,7 @@ int is_ppc32_Load(const ir_node *n)
        return 0;
 }
 
-int is_ppc32_Store(const ir_node *n)
+static int is_ppc32_Store(const ir_node *n)
 {
        ir_op *op = get_irn_op(n);
        if (op == op_ppc32_Stb) return 1;
index 85dbbad..3ecb8b1 100644 (file)
@@ -314,10 +314,10 @@ ppc32_attr_offset_mode get_ppc32_offset_mode(const ir_node *node)
 /**
  * Initializes ppc specific node attributes
  */
-void init_ppc32_attributes(ir_node *node, int flags,
-                                                const arch_register_req_t **in_reqs,
-                                                const be_execution_unit_t ***execution_units,
-                                                int n_res)
+static void init_ppc32_attributes(ir_node *node, int flags,
+                                  const arch_register_req_t **in_reqs,
+                                  const be_execution_unit_t ***execution_units,
+                                  int n_res)
 {
        ir_graph       *irg  = get_irn_irg(node);
        struct obstack *obst = get_irg_obstack(irg);
index 75f064d..773c533 100644 (file)
@@ -69,7 +69,7 @@ static inline ir_node *get_succ_Proj(ir_node *node, long proj)
 /**
  * Returns a singleton condition mode
  */
-ir_mode *get_ppc32_mode_Cond(void)
+static ir_mode *get_ppc32_mode_Cond(void)
 {
        if (ppc32_mode_Cond)
                return ppc32_mode_Cond;
@@ -130,7 +130,7 @@ ppc32_modecode get_nice_modecode(ir_mode *irmode)
  * Returns true, if the given node is a Const node and it's value fits into
  * a signed 16-bit variable
  */
-int is_16bit_signed_const(ir_node *node)
+static int is_16bit_signed_const(ir_node *node)
 {
        tarval *tv_const;
 
@@ -191,7 +191,7 @@ int is_16bit_signed_const(ir_node *node)
  * Returns true, if the given node is a Const node and it's value fits into
  * a unsigned 16-bit variable
  */
-int is_16bit_unsigned_const(ir_node *node)
+static int is_16bit_unsigned_const(ir_node *node)
 {
        tarval *tv_const;
 
index 60d3232..e33dd91 100644 (file)
@@ -176,7 +176,7 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op)
        panic("Mode for Conv not supported: %F -> %F", from_mode, to_mode);
 }
 
-int search_from_node_in_block(ir_node *from, ir_node *to)
+static int search_from_node_in_block(ir_node *from, ir_node *to)
 {
        int n = get_irn_arity(from), i;
        for (i=0;i<n;i++)
@@ -191,14 +191,14 @@ int search_from_node_in_block(ir_node *from, ir_node *to)
        return 0;
 }
 
-int nodes_dependency_order(ir_node **a, ir_node **b)
+static int nodes_dependency_order(ir_node **a, ir_node **b)
 {
        if (search_from_node_in_block(*a,*b)) return 1;
        if (search_from_node_in_block(*b,*a)) return -1;
        return 0;
 }
 
-void finalize_block(ppc32_code_gen_t *cgenv)
+static void finalize_block(ppc32_code_gen_t *cgenv)
 {
        int i;
        ir_node *current_conv;
@@ -238,7 +238,7 @@ void finalize_block(ppc32_code_gen_t *cgenv)
        }
 }
 
-void init_block(void)
+static void init_block(void)
 {
        cw_block_attr *attr = XMALLOC(cw_block_attr);
        attr->first_conv    = NULL;
index 683aed8..ca98ff4 100755 (executable)
@@ -1108,6 +1108,7 @@ EOF
 print OUT @obst_enum_op;
 print OUT <<EOF;
 int is_${arch}_irn(const ir_node *node);
+int is_${arch}_op(const ir_op *op);
 
 int get_${arch}_opcode_first(void);
 int get_${arch}_opcode_last(void);
index 98dff71..e2ce5af 100644 (file)
@@ -415,7 +415,7 @@ static const arch_register_class_t *sparc_get_reg_class(unsigned i)
  * @param mode The mode in question.
  * @return A register class which can hold values of the given mode.
  */
-const arch_register_class_t *sparc_get_reg_class_for_mode(const ir_mode *mode)
+static const arch_register_class_t *sparc_get_reg_class_for_mode(const ir_mode *mode)
 {
        if (mode_is_float(mode))
                return &sparc_reg_classes[CLASS_sparc_fp];
@@ -501,8 +501,8 @@ static const be_abi_callbacks_t sparc_abi_callbacks = {
  * @param method_type The type of the method (procedure) in question.
  * @param abi         The abi object to be modified
  */
-void sparc_get_call_abi(const void *self, ir_type *method_type,
-                           be_abi_call_t *abi)
+static void sparc_get_call_abi(const void *self, ir_type *method_type,
+                               be_abi_call_t *abi)
 {
        ir_type  *tp;
        ir_mode  *mode;
@@ -545,7 +545,7 @@ void sparc_get_call_abi(const void *self, ir_type *method_type,
        }
 }
 
-int sparc_to_appear_in_schedule(void *block_env, const ir_node *irn)
+static int sparc_to_appear_in_schedule(void *block_env, const ir_node *irn)
 {
        (void) block_env;
 
@@ -676,6 +676,7 @@ const arch_isa_if_t sparc_isa_if = {
        sparc_is_valid_clobber
 };
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_sparc);
 void be_init_arch_sparc(void)
 {
        be_register_isa_if("sparc", &sparc_isa_if);
@@ -683,4 +684,3 @@ void be_init_arch_sparc(void)
        sparc_init_transform();
        sparc_init_emitter();
 }
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_arch_sparc);
index 3cd50be..ccc384a 100644 (file)
@@ -547,7 +547,7 @@ static void sparc_register_emitters(void)
 /**
  * Emits code for a node.
  */
-void sparc_emit_node(const ir_node *node)
+static void sparc_emit_node(const ir_node *node)
 {
        ir_op               *op       = get_irn_op(node);
 
@@ -565,7 +565,7 @@ void sparc_emit_node(const ir_node *node)
  * Walks over the nodes in a block connected by scheduling edges
  * and emits code for each node.
  */
-void sparc_gen_block(ir_node *block, void *data)
+static void sparc_gen_block(ir_node *block, void *data)
 {
        ir_node *node;
        (void) data;
@@ -586,7 +586,7 @@ void sparc_gen_block(ir_node *block, void *data)
 /**
  * Emits code for function start.
  */
-void sparc_emit_func_prolog(ir_graph *irg)
+static void sparc_emit_func_prolog(ir_graph *irg)
 {
        ir_entity *ent = get_irg_entity(irg);
 
@@ -601,7 +601,7 @@ void sparc_emit_func_prolog(ir_graph *irg)
 /**
  * Emits code for function end
  */
-void sparc_emit_func_epilog(ir_graph *irg)
+static void sparc_emit_func_epilog(ir_graph *irg)
 {
        ir_entity *ent = get_irg_entity(irg);
        const char *irg_name = get_entity_ld_name(ent);
@@ -620,7 +620,7 @@ void sparc_emit_func_epilog(ir_graph *irg)
  * TODO: Sets labels for control flow nodes (jump target).
  * Links control predecessors to there destination blocks.
  */
-void sparc_gen_labels(ir_node *block, void *env)
+static void sparc_gen_labels(ir_node *block, void *env)
 {
        ir_node *pred;
        int n = get_Block_n_cfgpreds(block);
index d0b4c49..6198ba6 100644 (file)
@@ -242,10 +242,10 @@ void set_sparc_req_in(ir_node *node, const arch_register_req_t *req, int pos)
 /**
  * Initializes the nodes attributes.
  */
-void init_sparc_attributes(ir_node *node, arch_irn_flags_t flags,
-                               const arch_register_req_t **in_reqs,
-                               const be_execution_unit_t ***execution_units,
-                               int n_res)
+static void init_sparc_attributes(ir_node *node, arch_irn_flags_t flags,
+                                  const arch_register_req_t **in_reqs,
+                                  const be_execution_unit_t ***execution_units,
+                                  int n_res)
 {
        ir_graph        *irg  = get_irn_irg(node);
        struct obstack  *obst = get_irg_obstack(irg);
index 724e6e0..9756939 100644 (file)
@@ -37,7 +37,6 @@
 #include "ident_t.h"
 #include "firm.h"
 #include "irflag_t.h"
-/* init functions are not public */
 #include "tv_t.h"
 #include "tpop_t.h"
 #include "irprog_t.h"
@@ -55,6 +54,7 @@
 #include "opt_init.h"
 #include "debugger.h"
 #include "be_t.h"
+#include "irtools.h"
 
 /* returns the firm root */
 lc_opt_entry_t *firm_opt_get_root(void)
@@ -137,6 +137,8 @@ void ir_init(const firm_parameter_t *param)
        arch_dep_init(arch_dep_default_factory);
        arch_dep_set_opts(0);
 
+       init_irnode();
+
 #ifdef DEBUG_libfirm
        /* integrated debugger extension */
        firm_init_debugger();
index 0ac3ad6..a12597b 100644 (file)
@@ -33,6 +33,8 @@
 #include <windows.h>
 #endif
 
+#include "debugger.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <signal.h>
@@ -188,9 +190,6 @@ do {                                        \
 static const char firm_debug_info_string[] =
        API_VERSION(FIRM_DBG_MAJOR, FIRM_DBG_MINOR);
 
-/**
- * Returns non-zero, if the debug extension is active
- */
 int firm_debug_active(void)
 {
        return is_active;
@@ -204,19 +203,11 @@ static void reset_dbg_buf(void)
        firm_dbg_msg_buf[0] = '\0';
 }  /* reset_dbg_buf */
 
-/**
- * Add text to the debug text buffer.
- */
 static void add_to_dbg_buf(const char *buf)
 {
        strncat(firm_dbg_msg_buf, buf, sizeof(firm_dbg_msg_buf));
 }  /* add_to_dbg_buf */
 
-/**
- * Return the content of the debug text buffer.
- *
- * To be called from the debugger.
- */
 const char *firm_debug_text(void)
 {
        firm_dbg_msg_buf[sizeof(firm_dbg_msg_buf) - 1] = '\0';
@@ -1058,11 +1049,6 @@ static unsigned get_token(void)
        return c;
 }  /* get_token */
 
-/**
- * High level function to use from debugger interface
- *
- * See show_commands() for supported commands.
- */
 void firm_debug(const char *cmd)
 {
        char name[1024], fname[1024];
@@ -1277,7 +1263,6 @@ leave:
        ;
 }  /* firm_debug */
 
-/* creates the debugger tables */
 void firm_init_debugger(void)
 {
        char *env;
@@ -1306,9 +1291,6 @@ const char *gdb_node_helper(void *firm_object)
        return buf;
 }
 
-/**
- * A gdb helper function to print tarvals.
- */
 const char *gdb_tarval_helper(void *tv_object)
 {
        static char buf[1024];
index 81aa693..b1310a1 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef FIRM_DEBUG_DEBUGGER_H
 #define FIRM_DEBUG_DEBUGGER_H
 
+#include "firm_types.h"
+
 /** Break into the debugger. */
 void firm_debug_break(void);
 
@@ -42,4 +44,43 @@ void firm_break(const char *cmd);
 /** Creates the debugger tables. */
 void firm_init_debugger(void);
 
+/**
+ * @defgroup external_debug    helper functions for debuggers
+ *
+ * @{
+ */
+
+/**
+ * Returns non-zero, if the debug extension is active
+ */
+int firm_debug_active(void);
+
+/**
+ * Return the content of the debug text buffer.
+ *
+ * To be called from the debugger.
+ */
+const char *firm_debug_text(void);
+
+/**
+ * A gdb helper function to print tarvals.
+ */
+const char *gdb_tarval_helper(void *tv_object);
+
+/**
+ * A gdb helper to print all (new-style-) out edges of a node
+ */
+const char *gdb_out_edge_helper(const ir_node *node);
+
+/**
+ * High level function to use from debugger interface
+ *
+ * See show_commands() for supported commands.
+ */
+void firm_debug(const char *cmd);
+
+/**
+ * @}
+ */
+
 #endif
index bb2e4ea..018ddc4 100644 (file)
@@ -112,7 +112,7 @@ static int set_get_id_strlen(void *handle, ident *id)
 /**
  * Default implementation using libfirm sets.
  */
-void set_finish_ident(void *handle)
+static void set_finish_ident(void *handle)
 {
   set *id_set = handle;
 
index ca68fb3..d0dcf13 100644 (file)
  */
 #include "config.h"
 
-#include "bitset.h"
+#include "irargs_t.h"
 
 #include <ctype.h>
 
+#include "bitset.h"
 #include "lc_printf.h"
 #include "firm_common.h"
 #include "irnode_t.h"
index 18f8826..0e2c5a8 100644 (file)
@@ -1388,18 +1388,6 @@ void set_value(int pos, ir_node *value)
        irg->current_block->attr.block.graph_arr[pos + 1] = value;
 }  /* set_value */
 
-/* Find the value number for a node in the current block.*/
-int find_value(ir_node *value)
-{
-       int i;
-       ir_node *bl = current_ir_graph->current_block;
-
-       for (i = ARR_LEN(bl->attr.block.graph_arr) - 1; i >= 1; --i)
-               if (bl->attr.block.graph_arr[i] == value)
-                       return i - 1;
-       return -1;
-}  /* find_value */
-
 /* get the current store */
 ir_node *get_store(void)
 {
index ca2dbc1..48bf349 100644 (file)
@@ -2068,7 +2068,7 @@ int dump_type_node(FILE *F, ir_type *tp)
 }
 
 
-void dump_entity_node(FILE *F, ir_entity *ent)
+static void dump_entity_node(FILE *F, ir_entity *ent)
 {
        fprintf(F, "node: {title: \"");
        PRINT_ENTID(ent); fprintf(F, "\"");
@@ -3104,7 +3104,7 @@ ir_prog_pass_t *dump_all_ir_graph_pass(const char *name,
  * packed together in one subgraph/box                                            *
  *--------------------------------------------------------------------------------*/
 
-void dump_loops_standalone(FILE *F, ir_loop *loop)
+static void dump_loops_standalone(FILE *F, ir_loop *loop)
 {
        int i = 0, loop_node_started = 0, son_number = 0, first = 0;
        loop_element le;
@@ -3226,7 +3226,7 @@ void dump_callgraph_loop_tree(const char *suffix)
 /* Dumps the firm nodes in the loop tree to a graph along with the loop nodes.*/
 /*----------------------------------------------------------------------------*/
 
-void collect_nodeloop(FILE *F, ir_loop *loop, eset *loopnodes)
+static void collect_nodeloop(FILE *F, ir_loop *loop, eset *loopnodes)
 {
        int i, son_number = 0, node_number = 0;
 
@@ -3245,7 +3245,8 @@ void collect_nodeloop(FILE *F, ir_loop *loop, eset *loopnodes)
        }
 }
 
-void collect_nodeloop_external_nodes(ir_loop *loop, eset *loopnodes, eset *extnodes)
+static void collect_nodeloop_external_nodes(ir_loop *loop, eset *loopnodes,
+                                            eset *extnodes)
 {
        int i, j, start;
 
index 0c1b9ea..e61d3b3 100644 (file)
@@ -645,7 +645,8 @@ static void dump_entity_linkage(FILE *F, const ir_entity *entity)
                fprintf(F, " hidden_user");
 }
 
-void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned verbosity)
+static void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix,
+                                       unsigned verbosity)
 {
        int i, j;
        ir_type *owner, *type;
@@ -941,7 +942,7 @@ void dump_entity_to_file_prefix(FILE *F, ir_entity *ent, char *prefix, unsigned
        }
 }
 
-void    dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity)
+void dump_entity_to_file (FILE *F, ir_entity *ent, unsigned verbosity)
 {
        dump_entity_to_file_prefix (F, ent, "", verbosity);
        fprintf(F, "\n");
index 89e56c4..9a345e7 100644 (file)
 #define SetRangeEmpty(ptr,size)   memset(ptr, 0, (size) * sizeof((ptr)[0]))
 
 #define hashset_init            ir_edgeset_init
+void ir_edgeset_init_size(ir_edgeset_t *self, size_t size);
 #define hashset_init_size       ir_edgeset_init_size
 #define hashset_destroy         ir_edgeset_destroy
 #define hashset_insert          ir_edgeset_insert
 #define hashset_remove          ir_edgeset_remove
+ir_edge_t *ir_edgeset_find(const ir_edgeset_t *self, const ir_edge_t*);
 #define hashset_find            ir_edgeset_find
+size_t ir_edgeset_size(const ir_edgeset_t *self);
 #define hashset_size            ir_edgeset_size
 #define hashset_iterator_init   ir_edgeset_iterator_init
 #define hashset_iterator_next   ir_edgeset_iterator_next
@@ -324,11 +327,6 @@ static inline void vrfy_list_head(ir_node *irn, ir_edge_kind_t kind)
        assert(err == 0);
 }
 
-#ifdef DEBUG_libfirm
-/**
- * Helper function to dump the edge set of a graph,
- * unused in normal code.
- */
 void edges_dump_kind(ir_graph *irg, ir_edge_kind_t kind)
 {
        irg_edge_info_t *info;
@@ -345,7 +343,6 @@ void edges_dump_kind(ir_graph *irg, ir_edge_kind_t kind)
                ir_printf("%+F %d %d\n", e->src, e->pos, e->invalid);
        }
 }
-#endif
 
 /* The edge from (src, pos) -> old_tgt is redirected to tgt */
 void edges_notify_edge_kind(ir_node *src, int pos, ir_node *tgt,
@@ -1077,19 +1074,6 @@ int (get_irn_n_edges_kind)(const ir_node *irn, ir_edge_kind_t kind)
        return _get_irn_n_edges_kind(irn, kind);
 }
 
-void dump_all_out_edges(ir_node *irn)
-{
-       int i;
-       for (i = 0; i < EDGE_KIND_LAST; ++i) {
-               const ir_edge_t *edge;
-
-               printf("kind \"%s\"\n", get_kind_str(i));
-               foreach_out_edge_kind(irn, edge, i) {
-                       ir_printf("\t%+F(%d)\n", edge->src, edge->pos);
-               }
-       }
-}
-
 static void irg_block_edges_walk2(ir_node *bl, irg_walk_func *pre,
                                   irg_walk_func *post, void *env)
 {
index c2b291b..03f3174 100644 (file)
@@ -195,6 +195,12 @@ void edges_init_dbg(int do_dbg);
 
 void edges_invalidate_all(ir_node *irn, ir_graph *irg);
 
+/**
+ * Helper function to dump the edge set of a graph,
+ * unused in normal code.
+ */
+void edges_dump_kind(ir_graph *irg, ir_edge_kind_t kind);
+
 #define get_irn_n_edges_kind(irn, kind)   _get_irn_n_edges_kind(irn, kind)
 #define get_edge_src_irn(edge)            _get_edge_src_irn(edge)
 #define get_edge_src_pos(edge)            _get_edge_src_pos(edge)
index ae4cd28..04c28f8 100644 (file)
@@ -58,6 +58,10 @@ optimization_state_t libFIRM_running = 0;
 /* verbose is always off on default */
 optimization_state_t libFIRM_verb = 0;
 
+/* silence warnings */
+void set_opt_optimize(int value);
+int get_opt_optimize(void);
+
 /* an external flag can be set and get from outside */
 #define E_FLAG(name, value, def)           \
 void set_opt_##name(int flag) {            \
@@ -87,8 +91,7 @@ void set_opt_##name(int flag) {           \
 /* for compatibility reasons */
 void set_optimize(int value)
 {
-       if (value) libFIRM_opt |= irf_optimize;
-       else       libFIRM_opt &= ~irf_optimize;
+       set_opt_optimize(value);
 }
 
 int (get_optimize)(void)
index 3b88631..9535cdb 100644 (file)
@@ -81,7 +81,6 @@ I_FLAG(precise_exc_context                , 15, OFF)
 I_FLAG(fragile_ops                        , 16, OFF)
 
 /** Optimize cast nodes. */
-E_FLAG(optimize_class_casts               , 21, ON)
 E_FLAG(suppress_downcast_optimization     , 22, OFF)
 
 /** Not really an optimization, removes Confirm nodes. */
index 3801f2f..b031bf5 100644 (file)
@@ -105,7 +105,6 @@ static inline firm_verification_t get_node_verification_mode(void)
 #define get_optimize()                           _get_optimize()
 #define get_opt_cse()                            _get_opt_cse()
 #define get_opt_dyn_meth_dispatch()              _get_opt_dyn_meth_dispatch()
-#define get_opt_optimize_class_casts()           _get_opt_optimize_class_casts()
 #define get_opt_suppress_downcast_optimization() _get_opt_suppress_downcast_optimization()
 
 #endif
index 67ab88d..2f9b1c2 100644 (file)
@@ -738,16 +738,6 @@ int get_irg_n_locs(ir_graph *irg)
                return irg->n_loc - 1;
 }
 
-void set_irg_n_loc(ir_graph *irg, int n_loc)
-{
-       if (get_opt_precise_exc_context())
-               irg->n_loc = n_loc + 1 + 1;
-       else
-               irg->n_loc = n_loc + 1;
-}
-
-
-
 /* Returns the obstack associated with the graph. */
 struct obstack *
 (get_irg_obstack)(const ir_graph *irg) {
index ca98317..abb7677 100644 (file)
@@ -122,7 +122,8 @@ static void traverse_block_pre(ir_node *block, block_entry_t *entry, irg_walk_fu
 /**
  * Traverse a block in post order.
  */
-void traverse_block_post(ir_node *block, block_entry_t *entry, irg_walk_func *post, void *env)
+static void traverse_block_post(ir_node *block, block_entry_t *entry,
+                                irg_walk_func *post, void *env)
 {
        int j, n;
 
index cbcdfbe..74aa148 100644 (file)
@@ -51,9 +51,12 @@ static ir_lnk_nodemap_entry_t null_nodemap_entry;
 #define hashset_init            ir_lnk_nodemap_init
 #define hashset_init_size       ir_lnk_nodemap_init_size
 #define hashset_destroy         ir_lnk_nodemap_destroy
-#define hashset_insert          _ir_lnk_nodemap_insert
+ir_lnk_nodemap_entry_t *ir_lnk_nodemap_insert_(ir_lnk_nodemap_t *self, ir_node *node);
+#define hashset_insert          ir_lnk_nodemap_insert_
 #define hashset_remove          ir_lnk_nodemap_remove
-#define hashset_find            _ir_lnk_nodemap_find
+ir_lnk_nodemap_entry_t *ir_lnk_nodemap_find_(const ir_lnk_nodemap_t *self,
+                                             const ir_node *node);
+#define hashset_find            ir_lnk_nodemap_find_
 #define hashset_size            ir_lnk_nodemap_size
 
 #define ADDITIONAL_INIT         INIT_LIST_HEAD(&self->elem_list); INIT_LIST_HEAD(&self->all_iters);
@@ -109,7 +112,7 @@ static void resize(HashSet *self, size_t new_size)
 
 int ir_lnk_nodemap_put(ir_lnk_nodemap_t *nodemap, ir_node *node, void *data)
 {
-       ir_lnk_nodemap_entry_t *entry = _ir_lnk_nodemap_insert(nodemap, node);
+       ir_lnk_nodemap_entry_t *entry = ir_lnk_nodemap_insert_(nodemap, node);
 
        entry->data = data;
        if (entry->list.next == NULL) {
@@ -122,7 +125,7 @@ int ir_lnk_nodemap_put(ir_lnk_nodemap_t *nodemap, ir_node *node, void *data)
 
 void *ir_lnk_nodemap_get(const ir_lnk_nodemap_t *nodemap, const ir_node *node)
 {
-       ir_lnk_nodemap_entry_t *entry = _ir_lnk_nodemap_find(nodemap, node);
+       ir_lnk_nodemap_entry_t *entry = ir_lnk_nodemap_find_(nodemap, node);
        return entry->data;
 }
 
index 8f1b9d8..6c96605 100644 (file)
@@ -51,9 +51,11 @@ static ir_lnk_nodeset_entry_t null_nodeset_entry;
 #define hashset_init            ir_lnk_nodeset_init
 #define hashset_init_size       ir_lnk_nodeset_init_size
 #define hashset_destroy         ir_lnk_nodeset_destroy
-#define hashset_insert          _ir_lnk_nodeset_insert
+ir_lnk_nodeset_entry_t *ir_lnk_nodeset_insert_(ir_lnk_nodeset_t *nodeset, ir_node *node);
+#define hashset_insert          ir_lnk_nodeset_insert_
 #define hashset_remove          ir_lnk_nodeset_remove
-#define hashset_find            _ir_lnk_nodeset_find
+ir_lnk_nodeset_entry_t *ir_lnk_nodeset_find_(const ir_lnk_nodeset_t *nodeset, const ir_node *node);
+#define hashset_find            ir_lnk_nodeset_find_
 #define hashset_size            ir_lnk_nodeset_size
 
 #define ADDITIONAL_INIT         INIT_LIST_HEAD(&self->elem_list); INIT_LIST_HEAD(&self->all_iters);
@@ -110,7 +112,7 @@ static void resize(HashSet *self, size_t new_size)
 /* Inserts a node into a linked nodeset. */
 int ir_lnk_nodeset_insert(ir_lnk_nodeset_t *nodeset, ir_node *node)
 {
-       ir_lnk_nodeset_entry_t *entry = _ir_lnk_nodeset_insert(nodeset, node);
+       ir_lnk_nodeset_entry_t *entry = ir_lnk_nodeset_insert_(nodeset, node);
 
        if (entry->list.next == NULL) {
                /* we have added a new element */
@@ -122,7 +124,7 @@ int ir_lnk_nodeset_insert(ir_lnk_nodeset_t *nodeset, ir_node *node)
 
 int ir_lnk_nodeset_contains(const ir_lnk_nodeset_t *nodeset, const ir_node *node)
 {
-       return _ir_lnk_nodeset_find(nodeset, node) != NULL;
+       return ir_lnk_nodeset_find_(nodeset, node) != NULL;
 }
 
 /**
index 4249a5a..41f1de2 100644 (file)
@@ -39,6 +39,7 @@
 #include "irtools.h"
 #include "array.h"
 #include "error.h"
+#include "pattern_dmp.h"
 
 /** Obstack to hold all modes. */
 static struct obstack modes;
index bc52dab..4d1ef81 100644 (file)
@@ -780,18 +780,6 @@ int (Block_block_visited)(const ir_node *node)
        return _Block_block_visited(node);
 }
 
-ir_node *get_Block_graph_arr(ir_node *node, int pos)
-{
-       assert(is_Block(node));
-       return node->attr.block.graph_arr[pos+1];
-}
-
-void set_Block_graph_arr(ir_node *node, int pos, ir_node *value)
-{
-       assert(is_Block(node));
-       node->attr.block.graph_arr[pos+1] = value;
-}
-
 #ifdef INTERPROCEDURAL_VIEW
 void set_Block_cg_cfgpred_arr(ir_node *node, int arity, ir_node *in[])
 {
@@ -1470,7 +1458,7 @@ ir_node *get_Builtin_mem(const ir_node *node)
        return get_irn_n(node, 0);
 }
 
-void set_Builin_mem(ir_node *node, ir_node *mem)
+void set_Builtin_mem(ir_node *node, ir_node *mem)
 {
        assert(is_Builtin(node));
        set_irn_n(node, 0, mem);
@@ -2829,17 +2817,6 @@ ir_node *skip_Id(ir_node *node)
        }
 }
 
-void skip_Id_and_store(ir_node **node)
-{
-       ir_node *n = *node;
-
-       if (!n || (n->op != op_Id)) return;
-
-       /* Don't use get_Id_pred():  We get into an endless loop for
-          self-referencing Ids. */
-       *node = skip_Id(n);
-}
-
 int (is_strictConv)(const ir_node *node)
 {
        return _is_strictConv(node);
index 5edbd1e..ed1f731 100644 (file)
@@ -719,6 +719,8 @@ static inline int _is_arg_Proj(const ir_node *node)
        return pn_Start_T_args == get_Proj_proj(node) && is_Start(get_Proj_pred(node));
 }
 
+/** initialize ir_node module */
+void init_irnode(void);
 
 /* this section MUST contain all inline functions */
 #define is_ir_node(thing)                     _is_ir_node(thing)
index b47d255..0cddeb2 100644 (file)
@@ -50,12 +50,16 @@ static ir_nodemap_entry_t null_nodemap_entry = { NULL, NULL };
 #define EntryIsEmpty(value)       ((value).node == NULL)
 #define EntryIsDeleted(value)     ((value).node == (ir_node*)-1)
 
-#define hashset_init            _ir_nodemap_init
+void ir_nodemap_init_(ir_nodemap_t *self);
+#define hashset_init            ir_nodemap_init_
 #define hashset_init_size       ir_nodemap_init_size
 #define hashset_destroy         ir_nodemap_destroy
-#define hashset_insert          _ir_nodemap_insert
+ir_nodemap_entry_t *ir_nodemap_insert_(ir_nodemap_t *self, ir_node *node);
+#define hashset_insert          ir_nodemap_insert_
 #define hashset_remove          ir_nodemap_remove
-#define hashset_find            _ir_nodemap_find
+ir_nodemap_entry_t *ir_nodemap_find_(const ir_nodemap_t *self,
+                                     const ir_node *node);
+#define hashset_find            ir_nodemap_find_
 #define hashset_size            ir_nodemap_size
 #define hashset_iterator_init   ir_nodemap_iterator_init
 #define hashset_iterator_next   ir_nodemap_iterator_next
@@ -70,12 +74,12 @@ void ir_nodemap_init(ir_nodemap_t *nodemap)
 
 void *ir_nodemap_get(const ir_nodemap_t *self, const ir_node *node)
 {
-       ir_nodemap_entry_t *entry = _ir_nodemap_find(self, node);
+       ir_nodemap_entry_t *entry = ir_nodemap_find_(self, node);
        return entry->data;
 }
 
 void ir_nodemap_insert(ir_nodemap_t *self, ir_node *node, void *data)
 {
-       ir_nodemap_entry_t *entry = _ir_nodemap_insert(self, node);
+       ir_nodemap_entry_t *entry = ir_nodemap_insert_(self, node);
        entry->data               = data;
 }
index 80417fb..18d8969 100644 (file)
 #define KeysEqual(this,key1,key2) (key1) == (key2)
 #define SetRangeEmpty(ptr,size)   memset(ptr, 0, (size) * sizeof((ptr)[0]))
 
-#define hashset_init            _ir_nodeset_init
+void ir_nodeset_init_(ir_nodeset_t *self);
+#define hashset_init            ir_nodeset_init_
 #define hashset_init_size       ir_nodeset_init_size
 #define hashset_destroy         ir_nodeset_destroy
 #define hashset_insert          ir_nodeset_insert
 #define hashset_remove          ir_nodeset_remove
-#define hashset_find            _ir_nodeset_find
+#define hashset_find            ir_nodeset_contains
 #define hashset_size            ir_nodeset_size
 #define hashset_iterator_init   ir_nodeset_iterator_init
 #define hashset_iterator_next   ir_nodeset_iterator_next
@@ -59,8 +60,3 @@ void ir_nodeset_init(ir_nodeset_t *nodeset)
 {
        ir_nodeset_init_size(nodeset, 16);
 }
-
-int ir_nodeset_contains(const ir_nodeset_t *nodeset, const ir_node *node)
-{
-       return _ir_nodeset_find(nodeset, node);
-}
index 6c68ea1..36c007a 100644 (file)
@@ -160,7 +160,8 @@ void ir_prog_pass_mgr_add_graph_mgr(
 /**
  * Create a suffix for dumping.
  */
-void create_suffix(char *suffix, size_t n, const char *pass_name, unsigned index)
+static void create_suffix(char *suffix, size_t n, const char *pass_name,
+                          unsigned index)
 {
        snprintf(suffix, n, "-%02u_%s", index, pass_name);
 }
index a5f7925..6a7e968 100644 (file)
@@ -52,9 +52,12 @@ static ir_valueset_entry_t null_valueset_entry;
 #define hashset_init            ir_valueset_init
 #define hashset_init_size       ir_valueset_init_size
 #define hashset_destroy         ir_valueset_destroy
-#define hashset_insert          _ir_valueset_insert
+ir_valueset_entry_t *ir_valueset_insert_(ir_valueset_t *self, ir_node *value);
+#define hashset_insert          ir_valueset_insert_
 #define hashset_remove          ir_valueset_remove
-#define hashset_find            _ir_valueset_find
+ir_valueset_entry_t *ir_valueset_find_(const ir_valueset_t *self,
+                                       const ir_node *value);
+#define hashset_find            ir_valueset_find_
 #define hashset_size            ir_valueset_size
 
 #define ADDITIONAL_INIT         INIT_LIST_HEAD(&self->elem_list); INIT_LIST_HEAD(&self->all_iters);
@@ -109,7 +112,7 @@ static void resize(HashSet *self, size_t new_size)
 
 int ir_valueset_insert(ir_valueset_t *valueset, ir_node *value, ir_node *expr)
 {
-       ir_valueset_entry_t *entry = _ir_valueset_insert(valueset, value);
+       ir_valueset_entry_t *entry = ir_valueset_insert_(valueset, value);
 
        if (entry->list.next != NULL) {
                /* this value is already inserted, do nothing */
@@ -125,7 +128,7 @@ int ir_valueset_insert(ir_valueset_t *valueset, ir_node *value, ir_node *expr)
 int ir_valueset_replace(ir_valueset_t *valueset, ir_node *value, ir_node *expr)
 {
        int res = 0;
-       ir_valueset_entry_t *entry = _ir_valueset_insert(valueset, value);
+       ir_valueset_entry_t *entry = ir_valueset_insert_(valueset, value);
 
        if (entry->expr != expr) {
                entry->expr = expr;
@@ -141,7 +144,7 @@ int ir_valueset_replace(ir_valueset_t *valueset, ir_node *value, ir_node *expr)
 
 void *ir_valueset_lookup(const ir_valueset_t *valueset, const ir_node *value)
 {
-       ir_valueset_entry_t *entry = _ir_valueset_find(valueset, value);
+       ir_valueset_entry_t *entry = ir_valueset_find_(valueset, value);
        if (entry != NULL)
                return entry->expr;
        return NULL;
index b272256..55c282b 100644 (file)
@@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
 
 /* Size of default input buffer. */
 #ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
 #define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
 #endif
 
 /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -517,24 +525,23 @@ char *_lc_opt_text;
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include <stdio.h>
 
 #include "lc_parser_t.h"
 #include "lc_config_parser.h"
 
-static int _lc_opt_wrap(void)
-{
-       return 1;
-}
+static int _lc_opt_wrap(void);
 
 
 
 
 
 
-#line 540 "lc_config_lexer.c"
+#line 545 "lc_config_lexer.c"
 
 #define INITIAL 0
 #define LINE_COMMENT 1
@@ -620,7 +627,12 @@ static int input (void );
 
 /* Amount of stuff to slurp up with each read. */
 #ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
 #define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
@@ -628,7 +640,7 @@ static int input (void );
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out )
+#define ECHO do { if (fwrite( _lc_opt_text, _lc_opt_leng, 1, _lc_opt_out )) {} } while (0)
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -654,7 +666,7 @@ static int input (void );
                errno=0; \
                while ( (result = fread(buf, 1, max_size, _lc_opt_in))==0 && ferror(_lc_opt_in)) \
                        { \
-                       if ( errno != EINTR) \
+                       if( errno != EINTR) \
                                { \
                                YY_FATAL_ERROR( "input in flex scanner failed" ); \
                                break; \
@@ -721,10 +733,10 @@ YY_DECL
        register char *yy_cp, *yy_bp;
        register int yy_act;
 
-#line 55 "lc_config_lexer.l"
+#line 52 "lc_config_lexer.l"
 
 
-#line 730 "lc_config_lexer.c"
+#line 740 "lc_config_lexer.c"
 
        if ( !(yy_init) )
                {
@@ -809,65 +821,65 @@ do_action:        /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 57 "lc_config_lexer.l"
+#line 54 "lc_config_lexer.l"
 { BEGIN(BIG_COMMENT); }
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 58 "lc_config_lexer.l"
+#line 55 "lc_config_lexer.l"
 { BEGIN(INITIAL); }
        YY_BREAK
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 59 "lc_config_lexer.l"
+#line 56 "lc_config_lexer.l"
 PMANGLE(linenr)++;
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 60 "lc_config_lexer.l"
+#line 57 "lc_config_lexer.l"
 ;
        YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 62 "lc_config_lexer.l"
+#line 59 "lc_config_lexer.l"
 { BEGIN(LINE_COMMENT); }
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 63 "lc_config_lexer.l"
+#line 60 "lc_config_lexer.l"
 { BEGIN(INITIAL); PMANGLE(linenr)++; }
        YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 64 "lc_config_lexer.l"
+#line 61 "lc_config_lexer.l"
 ;
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 67 "lc_config_lexer.l"
+#line 64 "lc_config_lexer.l"
 { BEGIN(DAT); }
        YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 68 "lc_config_lexer.l"
+#line 65 "lc_config_lexer.l"
 { BEGIN(STR); }
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 69 "lc_config_lexer.l"
+#line 66 "lc_config_lexer.l"
 { BEGIN(DAT_CONT); }
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 70 "lc_config_lexer.l"
+#line 67 "lc_config_lexer.l"
 { _lc_opt_add_to_data_char(PMANGLE(text)[0]); }
        YY_BREAK
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
-#line 71 "lc_config_lexer.l"
+#line 68 "lc_config_lexer.l"
 {
                                                BEGIN(INITIAL);
                                                PMANGLE(linenr)++;
@@ -878,17 +890,17 @@ YY_RULE_SETUP
 case 13:
 /* rule 13 can match eol */
 YY_RULE_SETUP
-#line 77 "lc_config_lexer.l"
+#line 74 "lc_config_lexer.l"
 { BEGIN(DAT); PMANGLE(linenr)++; }
        YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 78 "lc_config_lexer.l"
+#line 75 "lc_config_lexer.l"
 ;
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 81 "lc_config_lexer.l"
+#line 78 "lc_config_lexer.l"
 {
                                                BEGIN(INITIAL);
                                                _lc_opt_add_to_data_char('\0');
@@ -897,43 +909,43 @@ YY_RULE_SETUP
        YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 87 "lc_config_lexer.l"
+#line 84 "lc_config_lexer.l"
 _lc_opt_add_to_data_char('\n');
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 88 "lc_config_lexer.l"
+#line 85 "lc_config_lexer.l"
 _lc_opt_add_to_data_char('\r');
        YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 89 "lc_config_lexer.l"
+#line 86 "lc_config_lexer.l"
 _lc_opt_add_to_data_char('\t');
        YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 90 "lc_config_lexer.l"
+#line 87 "lc_config_lexer.l"
 _lc_opt_add_to_data_char('\b');
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 91 "lc_config_lexer.l"
+#line 88 "lc_config_lexer.l"
 _lc_opt_add_to_data_char('\f');
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 92 "lc_config_lexer.l"
+#line 89 "lc_config_lexer.l"
 _lc_opt_add_to_data_char(_lc_opt_text[1]);
        YY_BREAK
 case 22:
 /* rule 22 can match eol */
 YY_RULE_SETUP
-#line 93 "lc_config_lexer.l"
+#line 90 "lc_config_lexer.l"
 _lc_opt_add_to_data_char(_lc_opt_text[0]);
        YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 95 "lc_config_lexer.l"
+#line 92 "lc_config_lexer.l"
 {
                                                PMANGLE(lval).text.str = PMANGLE(text);
                                                PMANGLE(lval).text.len = PMANGLE(leng);
@@ -942,31 +954,31 @@ YY_RULE_SETUP
        YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 100 "lc_config_lexer.l"
+#line 97 "lc_config_lexer.l"
 { return SEP; }
        YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 102 "lc_config_lexer.l"
+#line 99 "lc_config_lexer.l"
 ;
        YY_BREAK
 case 26:
 /* rule 26 can match eol */
 YY_RULE_SETUP
-#line 103 "lc_config_lexer.l"
+#line 100 "lc_config_lexer.l"
 PMANGLE(linenr)++;
        YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 105 "lc_config_lexer.l"
+#line 102 "lc_config_lexer.l"
 return _lc_opt_text[0];
        YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 107 "lc_config_lexer.l"
+#line 104 "lc_config_lexer.l"
 ECHO;
        YY_BREAK
-#line 972 "lc_config_lexer.c"
+#line 982 "lc_config_lexer.c"
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(LINE_COMMENT):
 case YY_STATE_EOF(BIG_COMMENT):
@@ -1729,8 +1741,8 @@ YY_BUFFER_STATE _lc_opt__scan_string (yyconst char * yystr )
 
 /** Setup the input buffer state to scan the given bytes. The next call to _lc_opt_lex() will
  * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  *
  * @return the newly allocated buffer state object.
  */
@@ -1904,7 +1916,7 @@ int _lc_opt_lex_destroy  (void)
 {
 
     /* Pop the buffer stack, destroying each element. */
-       while (YY_CURRENT_BUFFER){
+       while(YY_CURRENT_BUFFER){
                _lc_opt__delete_buffer(YY_CURRENT_BUFFER  );
                YY_CURRENT_BUFFER_LVALUE = NULL;
                _lc_opt_pop_buffer_state();
@@ -1969,4 +1981,14 @@ void _lc_opt_free (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 107 "lc_config_lexer.l"
+#line 104 "lc_config_lexer.l"
+
+
+
+static int _lc_opt_wrap(void)
+{
+       /* avoid warning */
+       (void) yyunput;
+       (void) input;
+       return 1;
+}
index ec48dce..1902e3e 100644 (file)
 #include "lc_parser_t.h"
 #include "lc_config_parser.h"
 
-static int _lc_opt_wrap(void)
-{
-       return 1;
-}
+static int _lc_opt_wrap(void);
 
 %}
 
@@ -105,3 +102,11 @@ nl              \n
 .                   return yytext[0];
 
 %%
+
+static int _lc_opt_wrap(void)
+{
+       /* avoid warning */
+       (void) yyunput;
+       (void) input;
+       return 1;
+}
index 82f58b6..2fcde9c 100644 (file)
@@ -1,14 +1,15 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -47,7 +46,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.4.1"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
 /* Pure parsers.  */
 #define YYPURE 0
 
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
 /* Using locations.  */
 #define YYLSP_NEEDED 0
 
 /* Substitute the variable and function names.  */
-#define yyparse _lc_opt_parse
-#define yylex   _lc_opt_lex
-#define yyerror _lc_opt_error
-#define yylval  _lc_opt_lval
-#define yychar  _lc_opt_char
-#define yydebug _lc_opt_debug
-#define yynerrs _lc_opt_nerrs
-
-
-/* Tokens.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     SEP = 258,
-     DATA = 259,
-     IDENT = 260
-   };
-#endif
-/* Tokens.  */
-#define SEP 258
-#define DATA 259
-#define IDENT 260
-
-
+#define yyparse         _lc_opt_parse
+#define yylex           _lc_opt_lex
+#define yyerror         _lc_opt_error
+#define yylval          _lc_opt_lval
+#define yychar          _lc_opt_char
+#define yydebug         _lc_opt_debug
+#define yynerrs         _lc_opt_nerrs
 
 
 /* Copy the first part of user declarations.  */
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include <string.h>
 
@@ -126,6 +114,7 @@ int PMANGLE(linenr);
 
 
 
+
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -144,28 +133,41 @@ int PMANGLE(linenr);
 # define YYTOKEN_TABLE 0
 #endif
 
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     SEP = 258,
+     DATA = 259,
+     IDENT = 260
+   };
+#endif
+
+
+
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-
 {
+
+
        text_t text;
        int num;
-}
-/* Line 187 of yacc.c.  */
 
-       YYSTYPE;
+
+
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
-
 /* Copy the second part of user declarations.  */
 
 
-/* Line 216 of yacc.c.  */
-
 
 #ifdef short
 # undef short
@@ -239,13 +241,15 @@ typedef short int yytype_int16;
 #else
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static int YYID(int i)
+static int
+YYID (int yyi)
 #else
-static int YYID(i)
-    int i;
+static int
+YYID (yyi)
+    int yyi;
 #endif
 {
-  return i;
+  return yyi;
 }
 #endif
 
@@ -326,9 +330,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  yytype_int16 yyss;
-  YYSTYPE yyvs;
-  };
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
 
 /* The size of the maximum gap between one aligned stack and the next.  */
 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -362,12 +366,12 @@ union yyalloc
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack)                                       \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                          \
     do                                                                 \
       {                                                                        \
        YYSIZE_T yynewbytes;                                            \
-       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
-       Stack = &yyptr->Stack;                                          \
+       YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+       Stack = &yyptr->Stack_alloc;                                    \
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
       }                                                                        \
@@ -460,7 +464,7 @@ static const yytype_uint8 yyrline[] =
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "SEP", "DATA", "IDENT", "'{'", "'}'",
-  "$accept", "main", "decl", "decls", "dseq", "group", "@1", "option",
+  "$accept", "main", "decl", "decls", "dseq", "group", "$@1", "option",
   "path", 0
 };
 #endif
@@ -664,9 +668,11 @@ do {                                                                         \
 /*ARGSUSED*/
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 #else
-static void yy_symbol_value_print(yyoutput, yytype, yyvaluep)
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
     FILE *yyoutput;
     int yytype;
     YYSTYPE const * const yyvaluep;
@@ -694,9 +700,11 @@ static void yy_symbol_value_print(yyoutput, yytype, yyvaluep)
 
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
 #else
-static void yy_symbol_print(yyoutput, yytype, yyvaluep)
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
     FILE *yyoutput;
     int yytype;
     YYSTYPE const * const yyvaluep;
@@ -718,16 +726,21 @@ static void yy_symbol_print(yyoutput, yytype, yyvaluep)
 
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static void yy_stack_print(yytype_int16 *bottom, yytype_int16 *top)
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 #else
-static void yy_stack_print(bottom, top)
-    yytype_int16 *bottom;
-    yytype_int16 *top;
+static void
+yy_stack_print (yybottom, yytop)
+    yytype_int16 *yybottom;
+    yytype_int16 *yytop;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (; bottom <= top; ++bottom)
-    YYFPRINTF (stderr, " %d", *bottom);
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
   YYFPRINTF (stderr, "\n");
 }
 
@@ -744,9 +757,11 @@ do {                                                               \
 
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static void yy_reduce_print(YYSTYPE *yyvsp, int yyrule)
+static void
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 #else
-static void yy_reduce_print(yyvsp, yyrule)
+static void
+yy_reduce_print (yyvsp, yyrule)
     YYSTYPE *yyvsp;
     int yyrule;
 #endif
@@ -759,11 +774,11 @@ static void yy_reduce_print(yyvsp, yyrule)
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
-      fprintf (stderr, "   $%d = ", yyi + 1);
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
                       &(yyvsp[(yyi + 1) - (yynrhs)])
                                       );
-      fprintf (stderr, "\n");
+      YYFPRINTF (stderr, "\n");
     }
 }
 
@@ -811,9 +826,11 @@ int yydebug;
 /* Return the length of YYSTR.  */
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static YYSIZE_T yystrlen(const char *yystr)
+static YYSIZE_T
+yystrlen (const char *yystr)
 #else
-static YYSIZE_T yystrlen(yystr)
+static YYSIZE_T
+yystrlen (yystr)
     const char *yystr;
 #endif
 {
@@ -833,9 +850,11 @@ static YYSIZE_T yystrlen(yystr)
    YYDEST.  */
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static char *yystpcpy(char *yydest, const char *yysrc)
+static char *
+yystpcpy (char *yydest, const char *yysrc)
 #else
-static char *yystpcpy(yydest, yysrc)
+static char *
+yystpcpy (yydest, yysrc)
     char *yydest;
     const char *yysrc;
 #endif
@@ -859,7 +878,8 @@ static char *yystpcpy(yydest, yysrc)
    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
    null, do not copy; instead, return the length of what the result
    would have been.  */
-static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
 {
   if (*yystr == '"')
     {
@@ -905,7 +925,8 @@ static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
    copied.  As a special case, return 0 if an ordinary "syntax error"
    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
    size calculation.  */
-static YYSIZE_T yysyntax_error(char *yyresult, int yystate, int yychar)
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
 {
   int yyn = yypact[yystate];
 
@@ -1014,9 +1035,11 @@ static YYSIZE_T yysyntax_error(char *yyresult, int yystate, int yychar)
 /*ARGSUSED*/
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 #else
-static void yydestruct(yymsg, yytype, yyvaluep)
+static void
+yydestruct (yymsg, yytype, yyvaluep)
     const char *yymsg;
     int yytype;
     YYSTYPE *yyvaluep;
@@ -1035,10 +1058,8 @@ static void yydestruct(yymsg, yytype, yyvaluep)
        break;
     }
 }
-\f
 
 /* Prevent warnings from -Wmissing-prototypes.  */
-
 #ifdef YYPARSE_PARAM
 #if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
@@ -1054,11 +1075,10 @@ int yyparse ();
 #endif /* ! YYPARSE_PARAM */
 
 
-
-/* The look-ahead symbol.  */
+/* The lookahead symbol.  */
 int yychar;
 
-/* The semantic value of the look-ahead symbol.  */
+/* The semantic value of the lookahead symbol.  */
 YYSTYPE yylval;
 
 /* Number of syntax errors so far.  */
@@ -1066,88 +1086,94 @@ int yynerrs;
 
 
 
-/*----------.
-| yyparse.  |
-`----------*/
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
 
 #ifdef YYPARSE_PARAM
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-int yyparse (void *YYPARSE_PARAM)
+int
+yyparse (void *YYPARSE_PARAM)
 #else
-int yyparse (YYPARSE_PARAM)
+int
+yyparse (YYPARSE_PARAM)
     void *YYPARSE_PARAM;
 #endif
 #else /* ! YYPARSE_PARAM */
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
-int yyparse (void)
+int
+yyparse (void)
 #else
-int yyparse ()
+int
+yyparse ()
 
 #endif
 #endif
 {
 
-  int yystate;
-  int yyn;
-  int yyresult;
-  /* Number of tokens to shift before error messages enabled.  */
-  int yyerrstatus;
-  /* Look-ahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-  /* Three stacks and their tools:
-     `yyss': related to states,
-     `yyvs': related to semantic values,
-     `yyls': related to locations.
 
-     Refer to the stacks thru separate pointers, to allow yyoverflow
-     to reallocate them elsewhere.  */
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
 
-  /* The state stack.  */
-  yytype_int16 yyssa[YYINITDEPTH];
-  yytype_int16 *yyss = yyssa;
-  yytype_int16 *yyssp;
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
 
-  /* The semantic value stack.  */
-  YYSTYPE yyvsa[YYINITDEPTH];
-  YYSTYPE *yyvs = yyvsa;
-  YYSTYPE *yyvsp;
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
 
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
 
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
 
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  YYSIZE_T yystacksize = YYINITDEPTH;
+    YYSIZE_T yystacksize;
 
+  int yyn;
+  int yyresult;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
 
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
   int yylen = 0;
 
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
+
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yystate = 0;
   yyerrstatus = 0;
   yynerrs = 0;
-  yychar = YYEMPTY;            /* Cause a token to be read.  */
+  yychar = YYEMPTY; /* Cause a token to be read.  */
 
   /* Initialize stack pointers.
      Waste one element of value and location stack
      so that they stay on the same level as the state stack.
      The wasted elements are never initialized.  */
-
   yyssp = yyss;
   yyvsp = yyvs;
 
@@ -1177,7 +1203,6 @@ int yyparse ()
        YYSTYPE *yyvs1 = yyvs;
        yytype_int16 *yyss1 = yyss;
 
-
        /* Each stack pointer address is followed by the size of the
           data in use in that stack, in bytes.  This used to be a
           conditional around just the two extra args, but that might
@@ -1185,7 +1210,6 @@ int yyparse ()
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * sizeof (*yyssp),
                    &yyvs1, yysize * sizeof (*yyvsp),
-
                    &yystacksize);
 
        yyss = yyss1;
@@ -1208,9 +1232,8 @@ int yyparse ()
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
        if (! yyptr)
          goto yyexhaustedlab;
-       YYSTACK_RELOCATE (yyss);
-       YYSTACK_RELOCATE (yyvs);
-
+       YYSTACK_RELOCATE (yyss_alloc, yyss);
+       YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 #  undef YYSTACK_RELOCATE
        if (yyss1 != yyssa)
          YYSTACK_FREE (yyss1);
@@ -1221,7 +1244,6 @@ int yyparse ()
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
 
-
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                  (unsigned long int) yystacksize));
 
@@ -1231,6 +1253,9 @@ int yyparse ()
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
   goto yybackup;
 
 /*-----------.
@@ -1239,16 +1264,16 @@ int yyparse ()
 yybackup:
 
   /* Do appropriate processing given the current state.  Read a
-     look-ahead token if we need one and don't already have one.  */
+     lookahead token if we need one and don't already have one.  */
 
-  /* First try to decide what to do without reference to look-ahead token.  */
+  /* First try to decide what to do without reference to lookahead token.  */
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
 
-  /* Not known => get a look-ahead token if don't already have one.  */
+  /* Not known => get a lookahead token if don't already have one.  */
 
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
@@ -1280,20 +1305,16 @@ yybackup:
       goto yyreduce;
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   /* Count tokens shifted since error; after three, turn off error
      status.  */
   if (yyerrstatus)
     yyerrstatus--;
 
-  /* Shift the look-ahead token.  */
+  /* Shift the lookahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
-  /* Discard the shifted token unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
 
   yystate = yyn;
   *++yyvsp = yylval;
@@ -1358,7 +1379,6 @@ yyreduce:
     break;
 
 
-/* Line 1267 of yacc.c.  */
 
       default: break;
     }
@@ -1370,7 +1390,6 @@ yyreduce:
 
   *++yyvsp = yyval;
 
-
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
@@ -1435,7 +1454,7 @@ yyerrlab:
 
   if (yyerrstatus == 3)
     {
-      /* If just tried and failed to reuse look-ahead token after an
+      /* If just tried and failed to reuse lookahead token after an
         error, discard it.  */
 
       if (yychar <= YYEOF)
@@ -1452,7 +1471,7 @@ yyerrlab:
        }
     }
 
-  /* Else will try to reuse look-ahead token after shifting the error
+  /* Else will try to reuse lookahead token after shifting the error
      token.  */
   goto yyerrlab1;
 
@@ -1509,9 +1528,6 @@ yyerrlab1:
       YY_STACK_PRINT (yyss, yyssp);
     }
 
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
   *++yyvsp = yylval;
 
 
@@ -1536,7 +1552,7 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
@@ -1547,7 +1563,7 @@ yyexhaustedlab:
 #endif
 
 yyreturn:
-  if (yychar != YYEOF && yychar != YYEMPTY)
+  if (yychar != YYEMPTY)
      yydestruct ("Cleanup: discarding lookahead",
                 yytoken, &yylval);
   /* Do not reclaim the symbols of the rule which action triggered
index cb1ddd7..a6c237b 100644 (file)
@@ -1,14 +1,15 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
 
 /* Skeleton interface for Bison's Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify
+   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -33,6 +32,7 @@
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
      IDENT = 260
    };
 #endif
-/* Tokens.  */
-#define SEP 258
-#define DATA 259
-#define IDENT 260
-
 
 
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-
 {
+
+
        text_t text;
        int num;
-}
-/* Line 1489 of yacc.c.  */
 
-       YYSTYPE;
+
+
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 extern YYSTYPE _lc_opt_lval;
index 742d4f2..8cd8dae 100644 (file)
@@ -563,7 +563,7 @@ char *lc_opt_value_to_string(char *buf, size_t len, const lc_opt_entry_t *ent)
        return buf;
 }
 
-char *lc_opt_values_to_string(char *buf, size_t len, const lc_opt_entry_t *ent)
+static char *lc_opt_values_to_string(char *buf, size_t len, const lc_opt_entry_t *ent)
 {
        const lc_opt_special_t *s = lc_get_opt_special(ent);
        if (s->dump_vals)
diff --git a/ir/libcore/lc_type.c b/ir/libcore/lc_type.c
deleted file mode 100644 (file)
index 8985c54..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-  libcore: library for basic data structures and algorithms.
-  Copyright (C) 2005  IPD Goos, Universit"at Karlsruhe, Germany
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-#include "config.h"
-
-#include <ctype.h>
-#include "lc_opts_t.h"
-
-int lc_opt_type_scan(void *dest, lc_opt_type_t type, const char *str)
-{
-       static const char *fmts[] = {
-               "", "%s", "%i", "%f"
-       };
-
-       static const struct {
-               const char *str;
-               int val;
-       } bool_vals[] = {
-               { "true", 1 },
-               { "on", 1 },
-               { "yes", 1 },
-               { "false", 0 },
-               { "no", 0 },
-               { "off", 0 }
-       };
-
-       int res = 0;
-
-       switch (type) {
-               case lc_opt_type_int:
-               case lc_opt_type_double:
-               case lc_opt_type_string:
-                       res = sscanf(str, fmts[type], dest);
-                       break;
-               case lc_opt_type_boolean:
-                       {
-                               size_t i, n;
-                               int *data = dest;
-                               char buf[10];
-
-                               strncpy(buf, str, sizeof(buf));
-                               for (i = 0, n = strlen(buf); i < n; ++i)
-                                       buf[i] = tolower(buf[i]);
-
-                               for (i = 0; i < LC_ARRSIZE(bool_vals); ++i) {
-                                       if (strcmp(buf, bool_vals[i].str) == 0) {
-                                               res = 1;
-                                               *data = bool_vals[i].val;
-                                               break;
-                                       }
-                               }
-                       }
-                       break;
-               default:
-                       break;
-       }
-
-       return res;
-}
-
-int lc_opt_type_print(char *buf, size_t n, lc_opt_type_t type, void *data)
-{
-       int res = 0;
-
-       switch (type) {
-               case lc_opt_type_int:
-                       {
-                               int i = *((int *) data);
-                               res = snprintf(buf, n, "%d", i);
-                       }
-                       break;
-               case lc_opt_type_double:
-                       {
-                               double d = *((double *) data);
-                               res = snprintf(buf, n, "%f", d);
-                       }
-                       break;
-               case lc_opt_type_string:
-                       res = snprintf(buf, n, "%s", (const char*) data);
-                       break;
-               case lc_opt_type_boolean:
-                       res = snprintf(buf, n, "%s", *((int *) data) ? "yes" : "no");
-                       break;
-               default:
-                       res = 0;
-       }
-
-       return res;
-}
index d12190a..2db00ee 100644 (file)
@@ -35,6 +35,7 @@
 #include "irnode_t.h"
 #include "irouts.h"
 #include "irpass_t.h"
+#include "lowering.h"
 
 #define foreach_out_irn(irn, i, outirn) for (i = get_irn_n_outs(irn) - 1;\
        i >= 0 && (outirn = get_irn_out(irn, i)); --i)
index 1eea766..6c00531 100644 (file)
@@ -27,6 +27,7 @@
  */
 #include "config.h"
 
+#include "iroptimize.h"
 #include "adt/pdeq.h"
 #include "irnode_t.h"
 #include "irouts.h"
index 0c5dba6..5ee666b 100644 (file)
@@ -27,6 +27,7 @@
  */
 #include "config.h"
 
+#include "iroptimize.h"
 #include "irflag.h"
 #include "irdom.h"
 #include "irouts.h"
index 4ccce69..39df5e5 100644 (file)
@@ -26,6 +26,8 @@
  */
 #include "config.h"
 
+#include "iroptimize.h"
+#include "opt_init.h"
 #include "irnode.h"
 #include "debug.h"
 
@@ -36,9 +38,9 @@
 #include "irouts.h"
 #include "iredges.h"
 #include "irtools.h"
-#include "array_t.h"   /* automatic array */
-#include "beutil.h"            /* get_block */
-#include "irloop_t.h"  /* set_irn_loop*/
+#include "array_t.h"
+#include "beutil.h"
+#include "irloop_t.h"
 #include "irpass.h"
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg);
@@ -253,7 +255,7 @@ static unsigned is_nodesblock_marked(ir_node* node)
 }
 
 /* Returns the number of blocks in a loop. */
-int get_loop_n_blocks(ir_loop *loop)
+static int get_loop_n_blocks(ir_loop *loop)
 {
        int elements, e;
        int blocks = 0;
@@ -568,7 +570,7 @@ static void construct_ssa_n(ir_node *def, ir_node *user)
 /**
  * Construct SSA for all definitions in arr.
  */
-void construct_ssa_foreach(ir_node **arr, int arr_n)
+static void construct_ssa_foreach(ir_node **arr, int arr_n)
 {
        int i;
        for (i = 0; i < arr_n ; ++i) {
@@ -1113,7 +1115,7 @@ static void inversion_walk(out_edge *head_entries)
 }
 
 /* Loop peeling */
-void loop_peeling(void)
+static void loop_peeling(void)
 {
        cur_loop_outs = NEW_ARR_F(out_edge, 0);
        irg_walk_graph( current_ir_graph, get_loop_outs, NULL, NULL );
@@ -1131,7 +1133,7 @@ void loop_peeling(void)
 }
 
 /* Loop inversion */
-void loop_inversion(void)
+static void loop_inversion(void)
 {
        unsigned do_inversion = 1;
 
@@ -1190,7 +1192,7 @@ void loop_inversion(void)
  * Returns last element of linked list of copies by
  * walking the linked list.
  */
-ir_node *get_last_copy(ir_node *node)
+static ir_node *get_last_copy(ir_node *node)
 {
        ir_node *copy, *cur;
        cur = node;
@@ -1203,7 +1205,7 @@ ir_node *get_last_copy(ir_node *node)
 /**
  * Rewire floating copies of the current loop.
  */
-void unrolling_fix_cf(void)
+static void unrolling_fix_cf(void)
 {
        ir_node *loophead = loop_cf_head;
        int headarity =         get_irn_arity(loophead);
@@ -1306,7 +1308,7 @@ static ir_node *add_phi(ir_node *node, int phi_pos)
  * Loop unrolling
  * Could be improved with variable range informations.
  */
-void loop_unrolling(void)
+static void loop_unrolling(void)
 {
        int i, j;
 
index 7ac82ef..e307367 100644 (file)
@@ -27,8 +27,9 @@
  * Two block are congruent, if they contains only equal calculations.
  */
 #include "config.h"
-#include "ircons.h"
+
 #include "iroptimize.h"
+#include "ircons.h"
 #include "irgmod.h"
 #include "irgraph_t.h"
 #include "irnode_t.h"
@@ -650,7 +651,7 @@ static void *live_throughs(const block_t *bl, const ir_node *phi)
  * @param part  the partition
  * @param env   the environment
  */
-void propagate_blocks_live_troughs(partition_t *part, environment_t *env)
+static void propagate_blocks_live_troughs(partition_t *part, environment_t *env)
 {
        const ir_node   *meet_block = part->meet_block;
        block_t         *bl, *next;
@@ -705,7 +706,7 @@ void propagate_blocks_live_troughs(partition_t *part, environment_t *env)
  *
  * @param env    the environment
  */
-void propagate_live_troughs(environment_t *env)
+static void propagate_live_troughs(environment_t *env)
 {
        partition_t *part, *next;
 
index 040e552..fd5c953 100644 (file)
@@ -27,6 +27,7 @@
  */
 #include "config.h"
 
+#include "opt_polymorphy.h"
 #include "iroptimize.h"
 #include "irprog_t.h"
 #include "entity_t.h"
@@ -45,7 +46,7 @@
  *
  * The default implementation hecks for Alloc nodes only.
  */
-ir_type *default_firm_get_Alloc(ir_node *n)
+static ir_type *default_firm_get_Alloc(ir_node *n)
 {
        n = skip_Proj(n);
        if (is_Alloc(n)) {
index a94567c..319a80a 100644 (file)
@@ -25,6 +25,7 @@
  */
 #include "config.h"
 
+#include "iroptimize.h"
 #include "iropt_t.h"
 #include "irnode_t.h"
 #include "irgraph_t.h"
index d8fb9c8..564213d 100644 (file)
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <limits.h>
 
+#include "pattern.h"
 #include "ident.h"
 #include "irnode_t.h"
 #include "irgwalk.h"
index 93691d4..6d2da33 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef FIRM_STAT_PATTERN_H
 #define FIRM_STAT_PATTERN_H
 
+#include "firm_types.h"
+
 /**
  * Calculates the pattern history.
  *