- changed handling of Mux nodes: these are now optimized using the iropt instead...
[libfirm] / ir / ir / ircgcons.c
index f6596d6..ca32dea 100644 (file)
@@ -25,9 +25,7 @@
  * @date    09.06.2002
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #ifdef INTERPROCEDURAL_VIEW
 
@@ -69,10 +67,9 @@ typedef struct {
   ir_node * except, * except_mem; /* EndExcept and Mem for exception return */
 } irg_data_t;
 
-static irg_data_t * irg_data_create(void) {
-  irg_data_t *data = xmalloc(sizeof(*data));
-  memset(data, 0, sizeof(*data)); /* init */
-  return data;
+static irg_data_t * irg_data_create(void)
+{
+  return XMALLOCZ(irg_data_t);
 }
 
 /** Count the number of callers of each method and mark open methods.
@@ -114,7 +111,7 @@ static void caller_init(int arr_length, ir_entity ** free_methods) {
 }
 
 /*
-static INLINE ir_node * tail(ir_node * node) {
+static inline ir_node * tail(ir_node * node) {
   ir_node * link;
   for (; (link = get_irn_link(node)); node = link) ;
   return node;
@@ -206,6 +203,7 @@ static ir_node * create_Block(int n, ir_node ** in) {
   ir_node * block;
   set_optimize(0);
   block = new_Block(n, in);
+  set_cur_block(block);
   set_optimize(rem_opt);
   return block;
 }
@@ -219,7 +217,7 @@ static void prepare_irg_end_except(ir_graph * irg, irg_data_t * data);
  * cause cycles we don't want to see, as Unknwon is in the Start Block
  * of the procedure. Use unknown of outermost irg where the start
  * block has no predecessors. */
-static INLINE ir_node *get_cg_Unknown(ir_mode *m) {
+static inline ir_node *get_cg_Unknown(ir_mode *m) {
   assert((get_Block_n_cfgpreds(get_irg_start_block(get_irp_main_irg())) == 1) &&
         (get_nodes_block(get_Block_cfgpred(get_irg_start_block(get_irp_main_irg()), 0)) ==
          get_irg_start_block(get_irp_main_irg())));