From: David Blaikie <dblaikie@gmail.com>
To: "chuanqi.xcq" <yedeng.yd@linux.alibaba.com>
Cc: Iain Sandoe <iain@sandoe.co.uk>,
GCC Development <gcc@gcc.gnu.org>,
Nathan Sidwell <nathanmsidwell@gmail.com>,
Jonathan Wakely <jwakely.gcc@gmail.com>,
"ben.boeckel" <ben.boeckel@kitware.com>
Subject: Re: Naming flag for specifying the output file name for Binary Module Interface files
Date: Wed, 14 Dec 2022 10:39:06 -0800 [thread overview]
Message-ID: <CAENS6Es=5t24iPa2U02toi=fgwaL6miX7ybF9Ht3E3fq6Mdhjg@mail.gmail.com> (raw)
In-Reply-To: <41caec52-1372-4441-b62d-6ce33f3534c6.yedeng.yd@linux.alibaba.com>
On Wed, Dec 14, 2022 at 1:56 AM chuanqi.xcq <yedeng.yd@linux.alibaba.com> wrote:
>
> Hi David,
>
> > I think Nathan might've been asking not only about what currently
> happens, but what we think should happen?
>
> Yes.
>
> > Is that consistent with `-o`? (I assume so, but don't know - I guess
> there aren't many cases where `-o` is unused (maybe `-fsyntax-only`),
> so that behavior might be a bit less well specified)
>
> `-o` wouldn't emit a warning if it is not used. (with `-fsyntax-only` for example).
> Since we want to make the behavior of `-fmodule-output` to be consistent with `-o`.
> I've changed the behavior in https://reviews.llvm.org/D140001.
>
> > This seems surprising/possibly wrong to me - do we have precedent from
> other flags to draw from?
>
> I feel it makes sense since `-fmodule-output=` will provide more information than `-fmodule-output`.
> So it is naturally to me that `-fmodule-output=` has higher priority.
>
> For examples, I don't enumerate all the flags but I find the following cases in minutes:
> - `-fpack-struct=` has higher priority than `-fpack-struct`.
> - `-fsave-optimization-record=` has higher priority than `-fsave-optimization-record=`.
> - `-ftime-report=` has higher priority than `-ftime-report`.
> - `-ftime-trace=` has higher priority than `-ftime-trace`.
>
> So I think the bahavior should be correct.
Fair enough - thanks for the references!
Nathan - is that consistent with your preference/understanding/experience?
>
> Thanks,
> Chuanqi
>
>
> ------------------------------------------------------------------
> From:David Blaikie <dblaikie@gmail.com>
> Send Time:2022年12月13日(星期二) 23:56
> To:chuanqi.xcq <yedeng.yd@linux.alibaba.com>
> Cc:Iain Sandoe <iain@sandoe.co.uk>; GCC Development <gcc@gcc.gnu.org>; Nathan Sidwell <nathanmsidwell@gmail.com>; Jonathan Wakely <jwakely.gcc@gmail.com>; ben.boeckel <ben.boeckel@kitware.com>
> Subject:Re: Naming flag for specifying the output file name for Binary Module Interface files
>
> I think Nathan might've been asking not only about what currently
> happens, but what we think should happen?
>
> On Mon, Dec 12, 2022 at 7:11 PM chuanqi.xcq <yedeng.yd@linux.alibaba.com> wrote:
> >
> > Hi Nathan,
> >
> > > 1) Are these flags silently ignored, if no module output is to be generated? Or is some kind of diagnostic generated?
> >
> > Currently, clang will generate the unused-command-line-argument warning for this case:
> >
> > ```
> > argument unused during compilation: '-fmodule-output' [-Wunused-command-line-argument]
> > ```
>
> Is that consistent with `-o`? (I assume so, but don't know - I guess
> there aren't many cases where `-o` is unused (maybe `-fsyntax-only`),
> so that behavior might be a bit less well specified)
>
> > > 2) what happens if you specify both -- do you get two outputs, a diagnostic, or
> > is one silently selected?
> >
> > If someone specify both `-fmodule-output` and `-fmodule-output=/path`,
> > the `-fmodule-output=/path` will be selected always no matter what the order is.
>
> This seems surprising/possibly wrong to me - do we have precedent from
> other flags to draw from?
>
> > And if multiple `-fmodule-output=/path` are specified, the last one will be selected.
> >
> > > 3) What is the behaviour if compilation fails? Does nothing happen to the file
> > indicated (potentially leaving an older version there), or does the equivalent
> > of 'rm -f $MODULE.pcm' happen?
> >
> > The module file will be deleted. The behavior is the same with `-o`.
> >
> > Thanks,
> > Chuanqi
> >
> >
> > ------------------------------------------------------------------
> > From:Nathan Sidwell <nathan@acm.org>
> > Send Time:2022年12月12日(星期一) 22:30
> > To:Iain Sandoe <iain@sandoe.co.uk>; GCC Development <gcc@gcc.gnu.org>
> > Cc:Nathan Sidwell <nathanmsidwell@gmail.com>; Jonathan Wakely <jwakely.gcc@gmail.com>; David Blaikie <dblaikie@gmail.com>; ben.boeckel <ben.boeckel@kitware.com>; chuanqi.xcq <yedeng.yd@linux.alibaba.com>
> > Subject:Re: Naming flag for specifying the output file name for Binary Module Interface files
> >
> > On 12/9/22 12:33, Iain Sandoe wrote:
> > > Hello all.
> > >
> > >> On 9 Dec 2022, at 01:58, chuanqi.xcq <yedeng.yd@linux.alibaba.com> wrote:
> > >>
> > >> It looks like `-fmodule-file` is better from the discussion. So let's take it. Thanks for everyone here
> > >
> > > So FAOD (after this discussion) Chuanqi's current patchset implements the following in clang:
> > >
> > > -fmodule-output
> > >
> > > - this causes the BMI to be saved in the CWG with the basename of the source file and a suffix of .pcm.
> > >
> > > -fmodule-output=<path>
> > >
> > > - this causes the BMI to be saved at the path specified.
> > >
> >
> > 1) Are these flags silently ignored, if no module output is to be generated? Or
> > is some kind of diagnostic generated?
> >
> > 2) what happens if you specify both -- do you get two outputs, a diagnostic, or
> > is one silently selected?
> >
> > 3) What is the behaviour if compilation fails? Does nothing happen to the file
> > indicated (potentially leaving an older version there), or does the equivalent
> > of 'rm -f $MODULE.pcm' happen?
> >
> > nathan
> >
> > --
> > Nathan Sidwell
> >
> >
>
>
next prev parent reply other threads:[~2022-12-14 18:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 21:03 David Blaikie
2022-12-07 0:35 ` Nathan Sidwell
2022-12-07 1:45 ` Jonathan Wakely
2022-12-07 2:30 ` chuanqi.xcq
2022-12-07 15:23 ` Jonathan Wakely
2022-12-07 15:45 ` ben.boeckel
2022-12-07 16:18 ` Iain Sandoe
2022-12-07 16:29 ` ben.boeckel
2022-12-07 16:52 ` Nathan Sidwell
2022-12-07 16:58 ` Iain Sandoe
2022-12-07 17:00 ` Nathan Sidwell
2022-12-09 1:58 ` chuanqi.xcq
2022-12-09 17:33 ` Iain Sandoe
2022-12-09 17:43 ` David Blaikie
2022-12-12 14:30 ` Nathan Sidwell
2022-12-13 3:10 ` chuanqi.xcq
2022-12-13 15:56 ` David Blaikie
2022-12-14 9:56 ` chuanqi.xcq
2022-12-14 18:39 ` David Blaikie [this message]
2022-12-14 22:29 ` Nathan Sidwell
2022-12-15 5:58 ` chuanqi.xcq
2022-12-15 7:37 ` Iain Sandoe
2022-12-15 13:21 ` ben.boeckel
2022-12-07 16:43 ` Nathan Sidwell
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='CAENS6Es=5t24iPa2U02toi=fgwaL6miX7ybF9Ht3E3fq6Mdhjg@mail.gmail.com' \
--to=dblaikie@gmail.com \
--cc=ben.boeckel@kitware.com \
--cc=gcc@gcc.gnu.org \
--cc=iain@sandoe.co.uk \
--cc=jwakely.gcc@gmail.com \
--cc=nathanmsidwell@gmail.com \
--cc=yedeng.yd@linux.alibaba.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).