[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[committed] Add first_dup macro
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)