aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-arange.h
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2019-03-28 06:40:30 +0900
committerStafford Horne <shorne@gmail.com>2019-03-28 06:40:30 +0900
commitef9866970ce6683d40465fb7c3168f87a1dcd1b7 (patch)
tree1a7929efbdea522520c1ba5fbeca66cf95c5c554 /sim/common/sim-arange.h
parent20dc7e9b059edff1d0fab3bd197c460c11cc7a06 (diff)
downloadgdb-ef9866970ce6683d40465fb7c3168f87a1dcd1b7.zip
gdb-ef9866970ce6683d40465fb7c3168f87a1dcd1b7.tar.gz
gdb-ef9866970ce6683d40465fb7c3168f87a1dcd1b7.tar.bz2
sim/common: convert sim-arange to use sim-inline
This fixes a TODO item and also fixes an error which we get when building with no optimizations (-O0) in at least gcc 8.2.1. Tested with sims that use cgen code lm32, or1k, cris, m32r and inlining is working corretly. Reference Error: gcc -DHAVE_CONFIG_H -DWITH_DEFAULT_MODEL='"or1200"' -DWITH_ALIGNMENT=STRICT_ALIGNMENT \ -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_TARGET_ADDRESS_BITSIZE=32 \ -DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG -DDEFAULT_INLINE=0 -DWITH_SCACHE=16384 \ -I. -I../../../binutils-gdb/sim/or1k -I../common -I../../../binutils-gdb/sim/or1k/../common \ -I../../include -I../../../binutils-gdb/sim/or1k/../../include -I../../bfd \ -I../../../binutils-gdb/sim/or1k/../../bfd -I../../opcodes -I../../../binutils-gdb/sim/or1k/../../opcodes \ -g -o run nrun.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a ../../libiberty/libiberty.a \ -ldl -lz -lm /usr/bin/ld: libsim.a(mloop.o): in function `extract': /home/shorne/work/openrisc/gdb-musl/sim/or1k/mloop.c:82: undefined reference to `sim_addr_range_hit_p' /usr/bin/ld: /home/shorne/work/openrisc/gdb-musl/sim/or1k/mloop.c:83: undefined reference to `sim_addr_range_hit_p' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:305: run] Error 1 sim/common/ChangeLog: * Make-common.in (sim-arange_h): Remove sim-arange.c * sim-arange.c: Remove SIM_ARANGE_C. Add ifdef for _SIM_ARANGE_C_. Include "sim-arange.h". Remove include for unused "sim-assert.h". Remove DEFINE_INLINE_P. Remove DEFINE_NON_INLINE_P. (sim_addr_range_add): Declare as INLINE_SIM_ARANGE. (sim_addr_range_delete): Declare as INLINE_SIM_ARANGE. (sim_addr_range_hit_p): Change from SIM_ARANGE_INLINE to INLINE_SIM_ARANGE. * sim-arange.h (sim_addr_range_add): Declare as INLINE_SIM_ARANGE. (sim_addr_range_delete): Declare as INLINE_SIM_ARANGE. (sim_addr_range_hit_p) Declare as INLINE_SIM_ARANGE. Remove definition of SIM_ARANGE_INLINE. Remove [HAVE_INLINE]. Wrap include "sim-arange.c" in H_REVEALS_MODULE_P. * sim-base.h: Include "sim-arange.h" * sim-basics.h: Remove include of "sim-arange.h" * sim-inline.c: Include "sim-arange.c" * sim-inline.h: Define INLINE_SIM_ARANGE. Define SIM_ARANGE_INLINE. Define EXTERN_SIM_ARANGE_P. Define STATIC_INLINE_SIM_ARANGE. Define STATIC_SIM_ARANGE.
Diffstat (limited to 'sim/common/sim-arange.h')
-rw-r--r--sim/common/sim-arange.h30
1 files changed, 9 insertions, 21 deletions
diff --git a/sim/common/sim-arange.h b/sim/common/sim-arange.h
index f2ac595..529d165 100644
--- a/sim/common/sim-arange.h
+++ b/sim/common/sim-arange.h
@@ -51,36 +51,24 @@ typedef struct _addr_range {
} ADDR_RANGE;
/* Add address range START,END to AR. */
-extern void sim_addr_range_add (ADDR_RANGE * /*ar*/,
- address_word /*start*/,
- address_word /*end*/);
+INLINE_SIM_ARANGE (void) sim_addr_range_add (ADDR_RANGE * /*ar*/,
+ address_word /*start*/,
+ address_word /*end*/);
/* Delete address range START,END from AR. */
-extern void sim_addr_range_delete (ADDR_RANGE * /*ar*/,
- address_word /*start*/,
- address_word /*end*/);
-
-/* TODO: This should get moved into sim-inline.h. */
-#ifdef HAVE_INLINE
-#ifdef SIM_ARANGE_C
-#define SIM_ARANGE_INLINE INLINE
-#else
-#define SIM_ARANGE_INLINE EXTERN_INLINE
-#endif
-#else
-#define SIM_ARANGE_INLINE extern
-#endif
+INLINE_SIM_ARANGE (void) sim_addr_range_delete (ADDR_RANGE * /*ar*/,
+ address_word /*start*/,
+ address_word /*end*/);
/* Return non-zero if ADDR is in range AR, traversing the entire tree.
If no range is specified, that is defined to mean "everything". */
-SIM_ARANGE_INLINE int
-sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/);
+INLINE_SIM_ARANGE (int) sim_addr_range_hit_p (ADDR_RANGE * /*ar*/,
+ address_word /*addr*/);
#define ADDR_RANGE_HIT_P(ar, addr) \
((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr)))
-#ifdef HAVE_INLINE
+#if H_REVEALS_MODULE_P (SIM_ARANGE_INLINE)
#include "sim-arange.c"
#endif
-#define SIM_ARANGE_C_INCLUDED
#endif /* SIM_ARANGE_H */