* why is sim_addr_range_hit_p tagged inline?
@ 2014-11-13 20:30 DJ Delorie
2014-11-14 10:25 ` Andreas Schwab
0 siblings, 1 reply; 4+ messages in thread
From: DJ Delorie @ 2014-11-13 20:30 UTC (permalink / raw)
To: gdb
In sim/sim-arange.h:
/* Return non-zero if ADDR is in range AR, traversing the entire tree.
If no range is specified, that is defined to mean "everything". */
extern INLINE 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)))
Why is the INLINE there? sim_addr_range_hit_p() is only defined in
sim-arange.c
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: why is sim_addr_range_hit_p tagged inline?
2014-11-13 20:30 why is sim_addr_range_hit_p tagged inline? DJ Delorie
@ 2014-11-14 10:25 ` Andreas Schwab
2014-11-14 20:16 ` DJ Delorie
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2014-11-14 10:25 UTC (permalink / raw)
To: DJ Delorie; +Cc: gdb
DJ Delorie <dj@redhat.com> writes:
> In sim/sim-arange.h:
>
> /* Return non-zero if ADDR is in range AR, traversing the entire tree.
> If no range is specified, that is defined to mean "everything". */
> extern INLINE 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)))
>
> Why is the INLINE there? sim_addr_range_hit_p() is only defined in
> sim-arange.c
Unless HAVE_INLINE is defined.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: why is sim_addr_range_hit_p tagged inline?
2014-11-14 10:25 ` Andreas Schwab
@ 2014-11-14 20:16 ` DJ Delorie
2014-11-15 7:31 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: DJ Delorie @ 2014-11-14 20:16 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb
> Unless HAVE_INLINE is defined.
Ah, ick. I noticed this because I had a report from a Mac user that
they were getting "multiply defined symbols" for that function.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: why is sim_addr_range_hit_p tagged inline?
2014-11-14 20:16 ` DJ Delorie
@ 2014-11-15 7:31 ` Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2014-11-15 7:31 UTC (permalink / raw)
To: DJ Delorie; +Cc: Andreas Schwab, gdb
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
On 14 Nov 2014 15:16, DJ Delorie wrote:
> > Unless HAVE_INLINE is defined.
>
> Ah, ick. I noticed this because I had a report from a Mac user that
> they were getting "multiply defined symbols" for that function.
the sim code base heavily inlines things for the sake of speed. but i'm not
sure what kind of perf difference it makes nowadays on modern systems. would be
worth seeing if we could just drop it all ...
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-11-15 7:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-13 20:30 why is sim_addr_range_hit_p tagged inline? DJ Delorie
2014-11-14 10:25 ` Andreas Schwab
2014-11-14 20:16 ` DJ Delorie
2014-11-15 7:31 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox