From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46921 invoked by alias); 24 Jan 2020 10:45:29 -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 46824 invoked by uid 89); 24 Jan 2020 10:45:16 -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= 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: mx2.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Wed, 01 Jan 2020 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Simplify --odr/--no-odr parsing Message-ID: <20200124104507.GA23839@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: 2020-q1/txt/msg00045.txt Hi, The --odr and --no-odr flags are currently setting odr_parsed and no_odr_parsed variables, which in turn trigger setting the odr variable. Simplify this by having the --odr and --no-odr flags set the odr variable directly. Committed to trunk. Thanks, - Tom Simplify --odr/--no-odr parsing 2020-01-24 Tom de Vries (odr_parsed, no_odr_parsed): Remove variables. (dwz_options): Use odr variable in --odr and --no-odr entries. * dwz.c (main): Remove handling of odr_parsed and no_odr_parsed. --- dwz.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/dwz.c b/dwz.c index 7acbd30..e98310b 100644 --- a/dwz.c +++ b/dwz.c @@ -220,8 +220,6 @@ static enum die_count_methods die_count_method = estimate; int odr = 1; enum odr_mode { ODR_BASIC, ODR_LINK }; enum odr_mode odr_mode = ODR_LINK; -int odr_parsed = 0; -int no_odr_parsed = 0; int odr_mode_parsed = 0; /* Struct to gather statistics. */ @@ -14473,8 +14471,8 @@ static struct option dwz_options[] = required_argument, &die_count_method_parsed, 1 }, { "devel-stats", no_argument, &stats_p, 1 }, #endif - { "odr", no_argument, &odr_parsed, 1 }, - { "no-odr", no_argument, &no_odr_parsed, 1 }, + { "odr", no_argument, &odr, 1 }, + { "no-odr", no_argument, &odr, 0 }, { "odr-mode", required_argument, &odr_mode_parsed, 1 }, { NULL, no_argument, 0, 0 } }; @@ -14781,18 +14779,6 @@ main (int argc, char *argv[]) error (1, 0, "invalid argument --devel-die-count-method %s", optarg); } - if (odr_parsed) - { - assert (!no_odr_parsed); - odr = 1; - odr_parsed = 0; - } - if (no_odr_parsed) - { - assert (!odr_parsed); - odr = 0; - no_odr_parsed = 0; - } if (odr_mode_parsed) { odr_mode_parsed = 0;