fixed config.h include
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 2 Dec 2004 16:26:35 +0000 (16:26 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 2 Dec 2004 16:26:35 +0000 (16:26 +0000)
used xmalloc instead of malloc

[r4558]

19 files changed:
ir/ir/ircgcons.c
ir/ir/ircgopt.c
ir/ir/ircons.c
ir/ir/irdump.c
ir/ir/irdumptxt.c
ir/ir/irflag.c
ir/ir/irgmod.c
ir/ir/irgopt.c
ir/ir/irgraph.c
ir/ir/irgwalk.c
ir/ir/irgwalk_blk.c
ir/ir/irmode.c
ir/ir/irnode.c
ir/ir/irop.c
ir/ir/iropt.c
ir/ir/irprintf.c
ir/ir/irprog.c
ir/ir/irreflect.c
ir/ir/irvrfy.c

index 52f0dcd..75a5c81 100644 (file)
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+
 #include <stdbool.h>
 #include "ircgcons.h"
 
index 0fedf23..060fc99 100644 (file)
@@ -16,7 +16,7 @@
  * Aufrufrelation bestimmt.
  */
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include "ircgopt.h"
index f59976f..dd9388f 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
+#endif
+
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
 #endif
 
 # include "irgraph_t.h"
@@ -25,8 +35,6 @@
 # include "iropt_t.h"
 # include "irgmod.h"
 # include "array.h"
-/* memset belongs to string.h */
-# include "string.h"
 # include "irbackedge_t.h"
 # include "irflag_t.h"
 
index 0a55d34..4cb0f13 100644 (file)
@@ -9,10 +9,16 @@
  * Copyright:   (c) 1998-2003 Universität Karlsruhe
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
-
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
 #include <stdarg.h>
 
 #include "firm_common_t.h"
index 3832786..2ed06ed 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Project:     libFIRM
- * File name:   ir/ir/irdump.c
+ * File name:   ir/ir/irdumptxt.c
  * Purpose:     Write vcg representation of firm to file.
  * Author:      Martin Trapp, Christian Schaefer
  * Modified by: Goetz Lindenmaier, Hubert Schmidt
@@ -9,9 +9,17 @@
  * Copyright:   (c) 1998-2003 Universität Karlsruhe
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+
 #include <stdarg.h>
 
 #include "irdump_t.h"
index 9d53b35..f30d0d4 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include "firm_common.h"
index 3de1fa2..39f255c 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 # include "irvrfy.h"
index 27ce6fc..babf9c5 100644 (file)
 
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include <assert.h>
-#include <stdbool.h>
 
 #include "irnode_t.h"
 #include "irgraph_t.h"
@@ -32,6 +31,7 @@
 #include "pset.h"
 #include "eset.h"
 #include "pdeq.h"       /* Fuer code placement */
+#include "xmalloc.h"
 
 #include "irouts.h"
 #include "irloop_t.h"
@@ -907,8 +907,8 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
   arity = get_irn_arity(end_bl);    /* arity = n_exc + n_ret  */
   n_res = get_method_n_ress(get_Call_type(call));
 
-  res_pred = (ir_node **) malloc (n_res * sizeof (ir_node *));
-  cf_pred =  (ir_node **) malloc (arity * sizeof (ir_node *));
+  res_pred = (ir_node **) xmalloc (n_res * sizeof (ir_node *));
+  cf_pred =  (ir_node **) xmalloc (arity * sizeof (ir_node *));
 
   set_irg_current_block(current_ir_graph, post_bl); /* just to make sure */
 
@@ -1039,7 +1039,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
     }
     main_end_bl = get_irg_end_block(current_ir_graph);
     main_end_bl_arity = get_irn_arity(main_end_bl);
-    end_preds =  (ir_node **) malloc ((n_exc + main_end_bl_arity) * sizeof (ir_node *));
+    end_preds =  (ir_node **) xmalloc ((n_exc + main_end_bl_arity) * sizeof (ir_node *));
 
     for (i = 0; i < main_end_bl_arity; ++i)
       end_preds[i] = get_irn_n(main_end_bl, i);
@@ -1083,7 +1083,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
     if (i < get_Block_n_cfgpreds(end_bl)) {
       bl = get_nodes_block(cf_op);
       arity = get_Block_n_cfgpreds(end_bl) + get_Block_n_cfgpreds(bl) - 1;
-      cf_pred = (ir_node **) malloc (arity * sizeof (ir_node *));
+      cf_pred = (ir_node **) xmalloc (arity * sizeof (ir_node *));
       for (j = 0; j < i; j++)
         cf_pred[j] = get_Block_cfgpred(end_bl, j);
       for (j = j; j < i + get_Block_n_cfgpreds(bl); j++)
@@ -1215,7 +1215,7 @@ typedef struct {
 } inline_irg_env;
 
 static inline_irg_env *new_inline_irg_env(void) {
-  inline_irg_env *env = malloc(sizeof(inline_irg_env));
+  inline_irg_env *env = xmalloc(sizeof(inline_irg_env));
   env->n_nodes = -2; /* uncount Start, End */
   env->n_nodes_orig = -2; /* uncount Start, End */
   env->call_nodes = eset_create();
index 2e5c0f5..e33d1ea 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
+#ifdef HAVE_STRING_H
 # include <string.h>
+#endif
 
+# include "xmalloc.h"
 # include "ircons.h"
 # include "irgraph_t.h"
 # include "irprog_t.h"
@@ -86,7 +89,7 @@ new_r_ir_graph (entity *ent, int n_loc)
   ir_node *first_block;
   ir_node *projX;
 
-  res = (ir_graph *) malloc (sizeof (ir_graph));
+  res = (ir_graph *) xmalloc (sizeof (ir_graph));
   memset(res, 0, sizeof (ir_graph));
   res->kind = k_ir_graph;
 
@@ -195,7 +198,7 @@ ir_graph *new_const_code_irg(void) {
   ir_graph *res;
   ir_node *projX;
 
-  res = (ir_graph *) malloc (sizeof(*res));
+  res = (ir_graph *) xmalloc (sizeof(*res));
   memset(res, 0, sizeof(*res));
 
   /* inform statistics here, as blocks will be already build on this graph */
index e34402d..2df2c18 100644 (file)
  */
 
 /**
-* traverse an ir graph
-* - execute the pre function before recursion
-* - execute the post function after recursion
-*/
+ * @file irgwalk.c
+ *
+ * traverse an ir graph
+ * - execute the pre function before recursion
+ * - execute the post function after recursion
+ */
 
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
-#include <stdlib.h>
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
 
 #include "irnode_t.h"
 #include "irgraph_t.h" /* visited flag */
index 413747b..9e04aea 100644 (file)
@@ -10,7 +10,7 @@
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 #include "irnode_t.h"
index de7ed63..d1591e3 100644 (file)
@@ -9,16 +9,18 @@
  * Copyright:   (c) 1998-2003 Universität Karlsruhe
  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
  */
-
-
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
+#ifdef HAVE_STDLIB_H
 # include <stdlib.h>
-# include <stddef.h>
+#endif
+#ifdef HAVE_STRING_H
 # include <string.h>
-# include <stdbool.h>
+#endif
+
+# include <stddef.h>
 
 # include "irmode_t.h"
 # include "ident.h"
index d13d314..ce3d3e6 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
 #endif
-#include <string.h>
 
 #include "ident.h"
 #include "irnode_t.h"
index 8074dc7..da43121 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
+#ifdef HAVE_STRING_H
 # include <string.h>
+#endif
 
 # include "irop_t.h"
 # include "irnode_t.h"
index 2a8df25..6b3e6b4 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
+#endif
+
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
 #endif
 
 # include "irnode_t.h"
index f87fe0c..e6705b5 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
 #include <stdio.h>
 #include <stdarg.h>
-#include <string.h>
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
 
 #include "ident.h"
 #include "irmode_t.h"
index 1e58c68..233b145 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
+#ifdef HAVE_STRING_H
 # include <string.h>
+#endif
 
 # include "irprog_t.h"
 # include "irgraph_t.h"
@@ -58,7 +60,7 @@ INLINE void remove_irp_type_from_list (type *typ) {
 ir_prog *new_ir_prog (void) {
   ir_prog *res;
 
-  res = (ir_prog *) malloc (sizeof(ir_prog));
+  res = (ir_prog *) xmalloc (sizeof(ir_prog));
   memset(res, 0, sizeof(res));
   irp = res;
   /* res->obst      = (struct obstack *) xmalloc (sizeof (struct obstack)); */
index ad211f6..b88aa3c 100644 (file)
@@ -6,10 +6,19 @@
  *
  * $Id$
  */
-
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
 
 #define obstack_chunk_alloc malloc
 #define obstack_chunk_free free
index 44cddfe..a7f3ef3 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 # include "irprog.h"