public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Don't guard dump_die and dump_die calls with '#if DEVEL'
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20191105092658.GA14518@delia> (raw)

Hi,

I've used this pattern to enable the --devel-dump-dies code:
...
  #if DEVEL
  static int dump_dies_p;
  #else
  #define dump_dies_p 0
  #endif

  #if DEVEL
    if (dump_dies_p)
      dump_dies (...);
  #endif
...
but the second '#if DEVEL' is not required.

Without -DDEVEL, the call evaluates to:
...
    if (0)
      dump_dies (...);
...
which will be optimized out, as well as the dump_dies function itself.

Drop the '#if DEVEL' guard dump_dies and dump_dies calls.

Committed to trunk.

Thanks,
- Tom

Don't guard dump_die and dump_die calls with '#if DEVEL'

2019-11-05  Tom de Vries  <tdevries@suse.de>

	* dwz.c (dump_dies): Don't guard with '#if DEVEL'.
	(read_debug_info): Don't guard calls to dump_dies with '#if DEVEL'.

---
 dwz.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/dwz.c b/dwz.c
index 6b95216..7593f68 100644
--- a/dwz.c
+++ b/dwz.c
@@ -3984,7 +3984,6 @@ find_dups_fi (dw_die_ref parent)
   return 0;
 }
 
-#if DEVEL
 /* Debugging helper function to dump hash values to stdout.  */
 static void
 dump_dies (int depth, dw_die_ref die)
@@ -3998,7 +3997,6 @@ dump_dies (int depth, dw_die_ref die)
   for (child = die->die_child; child; child = child->die_sib)
     dump_dies (depth + 1, child);
 }
-#endif
 
 /* Hash table for .debug_str.  Depending on multifile optimization
    phase this hash table has 3 different hash/equality functions.
@@ -4943,11 +4941,9 @@ read_debug_info (DSO *dso, int kind)
 	      for (cu = cuf; cu; cu = cu->cu_next)
 		checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
 
-#if DEVEL
 	      if (dump_dies_p)
 		for (cu = cuf; cu; cu = cu->cu_next)
 		  dump_dies (0, cu->cu_die);
-#endif
 
 	      for (cu = cuf; cu; cu = cu->cu_next)
 		if (find_dups (cu->cu_die))
@@ -5364,10 +5360,8 @@ read_debug_info (DSO *dso, int kind)
 	    goto fail;
 	  checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
 
-#if DEVEL
 	  if (dump_dies_p)
 	    dump_dies (0, cu->cu_die);
-#endif
 
 	  if (find_dups (cu->cu_die))
 	    goto fail;
@@ -5436,11 +5430,9 @@ read_debug_info (DSO *dso, int kind)
       for (cu = first_cu; cu; cu = cu->cu_next)
 	checksum_ref_die (cu, NULL, cu->cu_die, NULL, NULL);
 
-#if DEVEL
       if (dump_dies_p)
 	for (cu = first_cu; cu; cu = cu->cu_next)
 	  dump_dies (0, cu->cu_die);
-#endif
 
       if (rd_multifile)
 	{

                 reply	other threads:[~2019-11-05  9:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191105092658.GA14518@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).