* [committed] Simplify --odr/--no-odr parsing
@ 2020-01-01 0:00 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2020-01-01 0:00 UTC (permalink / raw)
To: dwz, jakub
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 <tdevries@suse.de>
(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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-24 10:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-01 0:00 [committed] Simplify --odr/--no-odr parsing 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).