From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Cc: Michael Matz <matz@suse.de>
Subject: [RFC 8/13][odr] Add --odr/--no-odr and --odr-mode=<basic,link> command line options
Date: Tue, 01 Jan 2019 00:00:00 -0000 [thread overview]
Message-ID: <20191210171954.GA13996@delia> (raw)
Hi,
Add optimization options --odr/--no-odr and --odr-mode=<basic|link>, making
the optimization user accessible.
Any comments?
Thanks,
- Tom
[odr] Add --odr/--no-odr and --odr-mode=<basic,link> command line options
2019-12-10 Tom de Vries <tdevries@suse.de>
* dwz.c (dwz_options): Add --odr, --no-odr and --odr-mode entries.
(main): Handle --odr, --no-odr and --odr-mode.
---
dwz.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/dwz.c b/dwz.c
index f16c30e..4a4a346 100644
--- a/dwz.c
+++ b/dwz.c
@@ -184,6 +184,9 @@ static enum die_count_methods die_count_method = estimate;
int odr = 0;
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;
typedef struct
{
@@ -13826,6 +13829,9 @@ static struct option dwz_options[] =
{ "devel-die-count-method",
required_argument, &die_count_method_parsed, 1 },
#endif
+ { "odr", no_argument, &odr_parsed, 1 },
+ { "no-odr", no_argument, &no_odr_parsed, 1 },
+ { "odr-mode", required_argument, &odr_mode_parsed, 1 },
{ NULL, no_argument, 0, 0 }
};
@@ -13917,6 +13923,34 @@ 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;
+ if (strcmp (optarg, "basic") == 0)
+ {
+ odr_mode = ODR_BASIC;
+ break;
+ }
+ if (strcmp (optarg, "link") == 0)
+ {
+ odr_mode = ODR_LINK;
+ break;
+ }
+ error (1, 0, "invalid argument --odr-mode %s",
+ optarg);
+ }
break;
case 'o':
next reply other threads:[~2019-12-10 17:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-01 0:00 Tom de Vries [this message]
2019-01-01 0:00 ` Tom de Vries
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=20191210171954.GA13996@delia \
--to=tdevries@suse.de \
--cc=dwz@sourceware.org \
--cc=jakub@redhat.com \
--cc=matz@suse.de \
/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).