Commit 73612d70 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Move includes for alloca() to xmalloc.h, so not everyone and his dog has to...

Move includes for alloca() to xmalloc.h, so not everyone and his dog has to use the ugly #ifdef macros.

[r12647]
parent 63bea6c0
......@@ -21,15 +21,9 @@
#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')
......
......@@ -15,12 +15,6 @@
#include <assert.h>
#include <string.h>
#ifdef _WIN32
#include <malloc.h>
#else
#include <alloca.h>
#endif
#include "xmalloc.h"
#include "bitfiddle.h"
......
......@@ -17,12 +17,6 @@
# 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
......
......@@ -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_ */
......@@ -17,12 +17,6 @@
#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"
......
......@@ -14,12 +14,6 @@
#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
......
......@@ -17,10 +17,6 @@
# 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
......
......@@ -20,19 +20,13 @@
#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 {
......
......@@ -15,16 +15,6 @@
# 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
......
......@@ -20,13 +20,6 @@
#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.
......
......@@ -14,12 +14,6 @@
# 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"
......
......@@ -13,13 +13,6 @@
#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;
......
......@@ -12,12 +12,6 @@
# 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;
......
......@@ -13,13 +13,6 @@
#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 {
......
......@@ -13,13 +13,6 @@
# 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"
......
......@@ -13,14 +13,6 @@
#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))
......
......@@ -14,13 +14,6 @@
# 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;)
......
......@@ -14,12 +14,6 @@
#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"
......
......@@ -12,12 +12,6 @@
# 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"
......
......@@ -19,12 +19,6 @@
#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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment