Commit 6c165ecb authored by Michael Beck's avatar Michael Beck
Browse files

fixed config.h include

used xmalloc instead of malloc

[r4553]
parent c6f33d8e
...@@ -9,8 +9,16 @@ ...@@ -9,8 +9,16 @@
* Copyright: (c) 2004 Universitt Karlsruhe * Copyright: (c) 2004 Universitt Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. * 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 <stdlib.h>
#include "callgraph.h" #include "callgraph.h"
#include "irloop_t.h" #include "irloop_t.h"
......
...@@ -18,13 +18,17 @@ ...@@ -18,13 +18,17 @@
* *
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include "config.h"
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif #endif
#include <stdlib.h>
#include "cgana.h" #include "cgana.h"
#include "rta.h" #include "rta.h"
#include "xmalloc.h"
#include "irnode_t.h" #include "irnode_t.h"
#include "irmode_t.h" #include "irmode_t.h"
#include "irprog_t.h" #include "irprog_t.h"
...@@ -832,7 +836,7 @@ void cgana(int *length, entity ***free_methods) { ...@@ -832,7 +836,7 @@ void cgana(int *length, entity ***free_methods) {
/* Convert the flexible array to an array that can be handled /* Convert the flexible array to an array that can be handled
by standard C. */ by standard C. */
p = (entity **)malloc(sizeof(*p) * ARR_LEN(free_meths)); p = (entity **)xmalloc(sizeof(*p) * ARR_LEN(free_meths));
memcpy(p, free_meths, ARR_LEN(free_meths) * sizeof(*p)); memcpy(p, free_meths, ARR_LEN(free_meths) * sizeof(*p));
*length = ARR_LEN(free_meths); *length = ARR_LEN(free_meths);
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* Copyright: (c) 2004 Universitt Karlsruhe * Copyright: (c) 2004 Universitt Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "execution_frequency.h" #include "execution_frequency.h"
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "interval_analysis.h" #include "interval_analysis.h"
......
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef HAVE_STRING_H
#include <string.h> #include <string.h>
#endif
#include "irloop_t.h" #include "irloop_t.h"
#include "irnode_t.h" #include "irnode_t.h"
......
...@@ -14,8 +14,13 @@ ...@@ -14,8 +14,13 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "irouts.h" #include "irouts.h"
#include "xmalloc.h"
#include "irgwalk.h" #include "irgwalk.h"
#include "irdom_t.h" #include "irdom_t.h"
#include "irgraph_t.h" /* To access state field. */ #include "irgraph_t.h" /* To access state field. */
...@@ -181,7 +186,8 @@ void compute_doms(ir_graph *irg) { ...@@ -181,7 +186,8 @@ void compute_doms(ir_graph *irg) {
irg_block_walk(get_irg_end(current_ir_graph), count_and_init_blocks, NULL, &n_blocks); irg_block_walk(get_irg_end(current_ir_graph), count_and_init_blocks, NULL, &n_blocks);
/* Memory for temporary information. */ /* Memory for temporary information. */
tdi_list = (tmp_dom_info *) calloc(n_blocks, sizeof(tmp_dom_info)); tdi_list = xmalloc(n_blocks * sizeof(tmp_dom_info));
memset(tdi_list, 0, n_blocks * sizeof(tmp_dom_info));
/* We need the out datastructure. */ /* We need the out datastructure. */
if (current_ir_graph->outs_state != outs_consistent) if (current_ir_graph->outs_state != outs_consistent)
......
...@@ -19,17 +19,20 @@ ...@@ -19,17 +19,20 @@
* Authors: Goetz Lindenmaier * Authors: Goetz Lindenmaier
*/ */
/* $Id$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif /* defined HAVE_CONFIG_H */ #endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "xmalloc.h"
#include "irouts.h" #include "irouts.h"
#include "irnode_t.h" #include "irnode_t.h"
#include "irgraph_t.h" #include "irgraph_t.h"
#include "irprog_t.h" #include "irprog_t.h"
#include "irgwalk.h" #include "irgwalk.h"
#include "string.h"
#ifdef DEBUG_libfirm #ifdef DEBUG_libfirm
/* Note: ir_node.out_valid and ir_graph.n_outs are only present when DEBUG_libfirm is defined */ /* Note: ir_node.out_valid and ir_graph.n_outs are only present when DEBUG_libfirm is defined */
...@@ -467,7 +470,7 @@ void compute_ip_outs(void) { ...@@ -467,7 +470,7 @@ void compute_ip_outs(void) {
} }
global_count = n_out_edges = count_ip_outs(); global_count = n_out_edges = count_ip_outs();
out_edges = (ir_node **) malloc (n_out_edges * sizeof(ir_node *)); out_edges = (ir_node **) xmalloc (n_out_edges * sizeof(ir_node *));
set_irp_ip_outedges(out_edges); set_irp_ip_outedges(out_edges);
set_ip_outs(); set_ip_outs();
} }
......
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef HAVE_STRING_H
#include <string.h> #include <string.h>
#endif
#include <stdlib.h>
#include "irloop_t.h" #include "irloop_t.h"
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include "config.h"
#endif #endif
#include "rta.h" #include "rta.h"
...@@ -531,6 +531,10 @@ void rta_report (void) ...@@ -531,6 +531,10 @@ void rta_report (void)
/* /*
* $Log$ * $Log$
* Revision 1.30 2004/12/02 16:16:11 beck
* fixed config.h include
* used xmalloc instead of malloc
*
* Revision 1.29 2004/11/11 13:28:08 goetz * Revision 1.29 2004/11/11 13:28:08 goetz
* made pseudo irg aware * made pseudo irg aware
* *
......
Markdown is supported
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