public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Add first_dup macro
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

Committed to trunk.

Thanks,
- Tom

Add first_dup macro

2019-04-09  Tom de Vries  <tdevries@suse.de>

	* dwz.c (first_dup): New macro.

---
 dwz.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dwz.c b/dwz.c
index eb97feb..8ea7c4d 100644
--- a/dwz.c
+++ b/dwz.c
@@ -794,6 +794,15 @@ die_cu (dw_die_ref die)
   return (dw_cu_ref) die->die_parent;
 }
 
+/* Given a toplevel die DIE, return the first (that is, the reference die) in
+   the duplicate chain.  */
+#define first_dup(die)				\
+  (die->die_dup					\
+   ? die->die_dup				\
+   : (die->die_nextdup				\
+      ? die					\
+      : NULL))
+
 /* Safe variant that check die_toplevel.  Can't be used on LHS.  */
 #define die_safe_dup(die) \
   ((die)->die_toplevel ? (die)->die_dup : (dw_die_ref) NULL)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-09 16:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Add first_dup macro Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).