From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5057 invoked by alias); 5 Nov 2019 09:27:06 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 5046 invoked by uid 89); 5 Nov 2019 09:27:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:2222 X-Spam-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx1.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Tue, 01 Jan 2019 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Don't guard dump_die and dump_die calls with '#if DEVEL' Message-ID: <20191105092658.GA14518@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2019-q4/txt/msg00034.txt.bz2 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 * 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) {