Move includes for alloca() to xmalloc.h, so not everyone and his dog has to use the...
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 2 Apr 2007 17:43:58 +0000 (17:43 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Mon, 2 Apr 2007 17:43:58 +0000 (17:43 +0000)
[r12647]

29 files changed:
ir/adt/array.h
ir/adt/bitset.h
ir/adt/xmalloc.c
ir/adt/xmalloc.h
ir/ana/analyze_irg_args.c
ir/ana/irdom.c
ir/external/read.c
ir/ident/ident.c
ir/ir/ircons.c
ir/ir/iredges.c
ir/ir/iropt.c
ir/lower/lower_calls.c
ir/lower/lower_dw.c
ir/lower/lower_intrinsics.c
ir/opt/cfopt.c
ir/opt/data_flow_scalar_replace.c
ir/opt/gvn_pre.c
ir/opt/ifconv.c
ir/opt/ldstopt.c
ir/opt/loop_unrolling.c
ir/opt/opt_osr.c
ir/opt/proc_cloning.c
ir/opt/return.c
ir/opt/scalar_replace.c
ir/opt/tailrec.c
ir/opt/tropt.c
ir/tv/fltcalc.c
ir/tv/strcalc.c
ir/tv/tv.c

index 18375b7..20b44ad 100644 (file)
 #include <stddef.h>
 #include <obstack.h>
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #include "fourcc.h"
 #include "align.h"
+#include "xmalloc.h"
 
 #define ARR_D_MAGIC    FOURCC('A','R','R','D')
 #define ARR_A_MAGIC    FOURCC('A','R','R','A')
index a3f737e..630ba75 100644 (file)
 #include <assert.h>
 #include <string.h>
 
-#ifdef _WIN32
-#include <malloc.h>
-#else
-#include <alloca.h>
-#endif
-
 #include "xmalloc.h"
 #include "bitfiddle.h"
 
index 07252a6..1f8ea74 100644 (file)
 # 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
index 0400408..d7a6122 100644 (file)
@@ -26,4 +26,14 @@ void free(void *ptr);
 
 #define xfree(ptr)      free(ptr)
 
+
+/* Includes for alloca() */
+#if defined(__FreeBSD__)
+#include <stdlib.h>
+#elif defined(_WIN32)
+#include <malloc.h>
+#else
+#include <alloca.h>
+#endif
+
 #endif /* _XMALLOC_H_ */
index a39750f..0ec10e5 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
@@ -33,6 +27,7 @@
 #include "array.h"
 #include "irprog.h"
 #include "entity_t.h"
+#include "xmalloc.h"
 
 #include "analyze_irg_args.h"
 
index cf47222..b53bb44 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
index f06873c..c98f91b 100644 (file)
 # include "config.h"
 #endif
 
-/* get prototype for alloca somehow */
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
index f735810..668d797 100644 (file)
 #include <stddef.h>
 #include <stdlib.h>
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #ifdef FIRM_ENABLE_WCHAR
 #include <wchar.h>
 #endif
 
 #include "ident_t.h"
 #include "set.h"
+#include "xmalloc.h"
 
 /* for debugging only, not the real implementation */
 struct _ident {
index 24e02ca..e731557 100644 (file)
 # 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 "irprog_t.h"
 #include "irgraph_t.h"
 #include "irnode_t.h"
@@ -41,6 +31,7 @@
 #include "irflag_t.h"
 #include "iredges_t.h"
 #include "irflag_t.h"
+#include "xmalloc.h"
 
 #if USE_EXPLICIT_PHI_IN_STACK
 /* A stack needed for the automatic Phi node construction in constructor
index 963f6a2..1140f23 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #include "irnode_t.h"
 #include "iropt_t.h"
 #include "iredgekinds.h"
@@ -38,6 +31,7 @@
 #include "debug.h"
 #include "set.h"
 #include "bitset.h"
+#include "xmalloc.h"
 
 /**
 * A function that allows for setting an edge.
index ad79fce..58fcd5c 100644 (file)
 # 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
@@ -43,6 +37,7 @@
 #include "opt_polymorphy.h"
 #include "opt_confirms.h"
 #include "irtools.h"
+#include "xmalloc.h"
 
 /* Make types visible to allow most efficient access */
 #include "entity_t.h"
index 9555706..ba4b3be 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #include "irprog_t.h"
 #include "irnode_t.h"
 #include "type_t.h"
@@ -33,6 +26,7 @@
 #include "irtools.h"
 #include "array.h"
 #include "pmap.h"
+#include "xmalloc.h"
 
 /** A type map for def_find_pointer_type. */
 static pmap *type_map;
index 777e24f..681972c 100644 (file)
 # include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
 #ifdef HAVE_STRING_H
 # include <string.h>
 #endif
@@ -47,6 +41,7 @@
 #include "pmap.h"
 #include "pdeq.h"
 #include "irdump.h"
+#include "xmalloc.h"
 
 /** A map from mode to a primitive type. */
 static pmap *prim_types;
index 54abc9d..4d87eba 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #include "irop_t.h"
 #include "irprog_t.h"
 #include "irnode_t.h"
@@ -31,6 +24,7 @@
 #include "trouts.h"
 #include "lower_intrinsics.h"
 #include "pmap.h"
+#include "xmalloc.h"
 
 /** Walker environment */
 typedef struct _walker_env {
index 9c5e95e..19798e8 100644 (file)
 # include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-
 #include <assert.h>
 
 #include "plist.h"
index 7a7ee5e..13af6b4 100644 (file)
 #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
@@ -40,6 +32,7 @@
 #include "irprintf.h"
 #include "compute_loop_info.h"
 #include "irgopt.h"
+#include "xmalloc.h"
 
 #define SET_ENT_VNUM(ent, vnum) set_entity_link(ent, INT_TO_PTR(vnum))
 #define GET_ENT_VNUM(ent)       (unsigned)PTR_TO_INT(get_entity_link(ent))
index 5687189..184e2d3 100644 (file)
 # include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-
 #include <assert.h>
 
 #include "irgraph_t.h"
@@ -37,6 +30,7 @@
 #include "irgmod.h"
 #include "debug.h"
 #include "gvn_pre.h"
+#include "xmalloc.h"
 
 /** The debug module handle. */
 DEBUG_ONLY(static firm_dbg_module_t *dbg;)
index 58f9034..e6acde9 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
 
 #include <assert.h>
 
@@ -35,6 +29,7 @@
 #include "irtools.h"
 #include "return.h"
 #include "array.h"
+#include "xmalloc.h"
 
 // debug
 #include "irdump.h"
index ec09418..be7bd88 100644 (file)
 # 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
@@ -40,6 +34,7 @@
 #include "irtools.h"
 #include "opt_polymorphy.h"
 #include "irmemory.h"
+#include "xmalloc.h"
 
 #ifdef DO_CACHEOPT
 #include "cacheopt/cachesim.h"
index 97c3817..50c1a93 100644 (file)
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
 
 #include "loop_unrolling.h"
 
@@ -42,6 +36,7 @@
 #include "compute_loop_info.h"
 #include "irdump.h"
 #include "irtools.h"
+#include "xmalloc.h"
 
 /* We will unroll maximal 4-times.  */
 #define MAX_UNROLL 4
index 9ae4a3f..101fb54 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
 #include "opt_osr.h"
 #include "irgraph.h"
 #include "ircons.h"
@@ -40,6 +33,7 @@
 #include "irloop_t.h"
 #include "array.h"
 #include "firmstat.h"
+#include "xmalloc.h"
 
 /** The debug handle. */
 DEBUG_ONLY(static firm_dbg_module_t *dbg;)
index 50f91d1..12413ad 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
@@ -50,6 +44,7 @@
 #include "irtools.h"
 #include "irgmod.h"
 #include "array.h"
+#include "xmalloc.h"
 
 /* A macro to iterate sets.*/
 #define ITERATE_SET(set_entries, entry) for(entry = set_first(set_entries); entry; entry = set_next(set_entries))
index 3b5338a..1ff6d11 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
-
 #include "irgraph_t.h"
 #include "ircons_t.h"
 #include "irnode_t.h"
 #include "irgmod.h"
+#include "xmalloc.h"
 
 #define set_bit(n)      (returns[(n) >> 3] |= 1 << ((n) & 7))
 #define get_bit(n)      (returns[(n) >> 3] & (1 << ((n) & 7)))
index 3c82335..293c6f7 100644 (file)
 #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
@@ -38,6 +30,7 @@
 #include "irgmod.h"
 #include "irnode_t.h"
 #include "irtools.h"
+#include "xmalloc.h"
 
 #define SET_VNUM(node, vnum) set_irn_link(node, INT_TO_PTR(vnum))
 #define GET_VNUM(node)       (unsigned)PTR_TO_INT(get_irn_link(node))
index dc94c88..8f32a11 100644 (file)
 # 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
@@ -39,6 +33,7 @@
 #include "scalar_replace.h"
 #include "irouts.h"
 #include "irhooks.h"
+#include "xmalloc.h"
 
 /**
  * the environment for collecting data
index 6ecd952..c072916 100644 (file)
 
 #include <assert.h>
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #include "tropt.h"
 
 #include "irprog.h"
@@ -39,6 +32,7 @@
 #include "ircons.h"
 #include "irgmod.h"
 #include "irflag_t.h"
+#include "xmalloc.h"
 
 /* - statistics ---------------------------------------------- */
 
index 69ba024..c9a189c 100644 (file)
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
 #include <stdio.h>
 #include <assert.h>
 
index 6e45a26..1357206 100644 (file)
 #ifdef HAVE_STDLIB_H
 # include <stdlib.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>  /* memset/memcmp */
 #endif
index 8d07988..68999b8 100644 (file)
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-# include <malloc.h>
-#endif
 
 #include "tv_t.h"
 #include "set.h"            /* to store tarvals in */