Commit 294340bf by Kazu Hirata Committed by Kazu Hirata

Makefile.in (final.o): Depend on vecprim.h.

	* Makefile.in (final.o): Depend on vecprim.h.
	* final.c: Include vecprim.h.
	(insn_addresses_): Change the type to VEC(int,heap)*.
	* insn-addr.h (INSN_ADDRESSES_DEFN): Remove.
	(INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_SIZE,
	INSN_ADDRESSES_NEW): Use VEC instead of VARRAY.

From-SVN: r120177
parent 8aceba8c
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
* doc/invoke.texi (-fforce-mem): Remove. * doc/invoke.texi (-fforce-mem): Remove.
* opts.c (common_handle_option): Don't handle OPT_fforce_mem. * opts.c (common_handle_option): Don't handle OPT_fforce_mem.
* Makefile.in (final.o): Depend on vecprim.h.
* final.c: Include vecprim.h.
(insn_addresses_): Change the type to VEC(int,heap)*.
* insn-addr.h (INSN_ADDRESSES_DEFN): Remove.
(INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_SIZE,
INSN_ADDRESSES_NEW): Use VEC instead of VARRAY.
2006-12-23 Marcin Dalecki <martin@dalecki.de> 2006-12-23 Marcin Dalecki <martin@dalecki.de>
* cgraphunit.c (cgraph_optimize): Fixed obvious thinko in memory * cgraphunit.c (cgraph_optimize): Fixed obvious thinko in memory
......
...@@ -2593,7 +2593,7 @@ final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ ...@@ -2593,7 +2593,7 @@ final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \ insn-config.h $(INSN_ATTR_H) $(FUNCTION_H) output.h hard-reg-set.h \
except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h tree-pass.h \ except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h tree-pass.h \
$(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \ $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h \
$(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) $(TIMEVAR_H) $(CGRAPH_H) $(COVERAGE_H) $(REAL_H) vecprim.h
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \ $(FUNCTION_H) $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) toplev.h output.h reload.h \ $(FLAGS_H) insn-config.h $(INSN_ATTR_H) toplev.h output.h reload.h \
......
...@@ -76,6 +76,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ...@@ -76,6 +76,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "timevar.h" #include "timevar.h"
#include "cgraph.h" #include "cgraph.h"
#include "coverage.h" #include "coverage.h"
#include "vecprim.h"
#ifdef XCOFF_DEBUGGING_INFO #ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h" /* Needed for external data #include "xcoffout.h" /* Needed for external data
...@@ -320,7 +321,7 @@ dbr_sequence_length (void) ...@@ -320,7 +321,7 @@ dbr_sequence_length (void)
static int *insn_lengths; static int *insn_lengths;
varray_type insn_addresses_; VEC(int,heap) *insn_addresses_;
/* Max uid for which the above arrays are valid. */ /* Max uid for which the above arrays are valid. */
static int insn_lengths_max_uid; static int insn_lengths_max_uid;
......
...@@ -19,32 +19,48 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ...@@ -19,32 +19,48 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */ 02110-1301, USA. */
#ifndef GCC_INSN_ADDR_H #ifndef GCC_INSN_ADDR_H
#define GCC_INSN_ADDR_H #define GCC_INSN_ADDR_H
#include "varray.h" #include "vecprim.h"
extern GTY(()) varray_type insn_addresses_; extern VEC(int,heap) *insn_addresses_;
extern int insn_current_address; extern int insn_current_address;
#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_ #define INSN_ADDRESSES(id) (*&(VEC_address (int, insn_addresses_) [id]))
#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id)) #define INSN_ADDRESSES_ALLOC(size) \
#define INSN_ADDRESSES_ALLOC(size) \ do \
VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses") { \
#define INSN_ADDRESSES_FREE() (insn_addresses_ = 0) insn_addresses_ = VEC_alloc (int, heap, size); \
VEC_safe_grow (int, heap, insn_addresses_, size); \
memset (VEC_address (int, insn_addresses_), \
0, sizeof (int) * size); \
} \
while (0)
#define INSN_ADDRESSES_FREE() (VEC_free (int, heap, insn_addresses_))
#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0) #define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
#define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_) #define INSN_ADDRESSES_SIZE() (VEC_length (int, insn_addresses_))
#define INSN_ADDRESSES_NEW(insn, addr) do \
{ \ static inline void
unsigned insn_uid__ = INSN_UID ((insn)); \ insn_addresses_new (rtx insn, int insn_addr)
int insn_addr__ = (addr); \ {
\ unsigned insn_uid = INSN_UID ((insn));
if (INSN_ADDRESSES_SET_P ()) \
{ \ if (INSN_ADDRESSES_SET_P ())
if (INSN_ADDRESSES_SIZE () <= insn_uid__) \ {
VARRAY_GROW (insn_addresses_, insn_uid__ + 1); \ size_t size = INSN_ADDRESSES_SIZE ();
INSN_ADDRESSES (insn_uid__) = insn_addr__; \ if (size <= insn_uid)
} \ {
} \ int *p;
while (0) VEC_safe_grow (int, heap, insn_addresses_, insn_uid + 1);
p = VEC_address (int, insn_addresses_);
memset (&p[size],
0, sizeof (int) * (insn_uid + 1 - size));
}
INSN_ADDRESSES (insn_uid) = insn_addr;
}
}
#define INSN_ADDRESSES_NEW(insn, addr) \
(insn_addresses_new (insn, addr))
#endif /* ! GCC_INSN_ADDR_H */ #endif /* ! GCC_INSN_ADDR_H */
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