asukainori added a comment.
I'm sorry to disturb.
But I found this option is conflict with -flto. e.g.
clang-cl -fuse-ld=lld -flto=thin /showFilenames .\test.cpp
will output:
clang-cl: warning: argument unused during compilation: '/showFilenames'
[-Wunused-command-line-argument]
This revision was automatically updated to reflect the committed changes.
Closed by commit rL344234: clang-cl: Add /showFilenames option (PR31957)
(authored by hans, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
hans added inline comments.
Comment at: test/Driver/cl-showfilenames.c:7-8
+// multiple: cl-showfilenames.c
+// multiple-NEXT: wildcard1.c
+// multiple-NEXT: wildcard2.c
rnk wrote:
> I think it'd be nice to have the test show that diagnostics come out
>
rnk accepted this revision.
rnk added a comment.
lgtm
Comment at: lib/Driver/Job.cpp:319
+ if (PrintInputFilenames) {
+for (const char *Arg : InputFilenames)
+ llvm::outs() << llvm::sys::path::filename(Arg) << "\n";
Huh, a -cc1 action can have
hans updated this revision to Diff 168999.
hans added a comment.
Here's a version now using cc1 flags, but printing directly from the driver.
Please take a look.
https://reviews.llvm.org/D52773
Files:
include/clang/Driver/CLCompatOptions.td
include/clang/Driver/Job.h
lib/Driver/Job.cpp
rnk added a comment.
It doesn't address the version skew issue, but my blanket argument against any
new environment variable is the existance of things like `_CL_` and
`CCC_OVERRIDE_OPTIONS`. You can set any compiler flag you want from the
environment, so we should standardize on one way of
zturner added a comment.
In https://reviews.llvm.org/D52773#1255491, @thakis wrote:
> In https://reviews.llvm.org/D52773#1255093, @zturner wrote:
>
> > I agree magic environment variables are bad, but without it we don’t
> > address the only current actual use we have for this, which is making
thakis added a comment.
In https://reviews.llvm.org/D52773#1255093, @zturner wrote:
> I agree magic environment variables are bad, but without it we don’t
> address the only current actual use we have for this, which is making the
> vs integration print filenames. Detecting compiler version
zturner added a subscriber: rnk.
zturner added a comment.
I agree magic environment variables are bad, but without it we don’t
address the only current actual use we have for this, which is making the
vs integration print filenames. Detecting compiler version from inside the
integration is hard,
I agree magic environment variables are bad, but without it we don’t
address the only current actual use we have for this, which is making the
vs integration print filenames. Detecting compiler version from inside the
integration is hard, but with an environment variable it’s very easy to
solve.
hans added a comment.
In https://reviews.llvm.org/D52773#1252584, @zturner wrote:
> Canyou add a test that demonstrates that multiple input files on the command
> line will print all of them?
Will do.
> Also does this really need to be a cc1 arg? Why not just print it in the
> driver?
zturner added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
steveire wrote:
>
steveire added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
zturner wrote:
>
rnk accepted this revision.
rnk added a comment.
I support continuing our practice of being silent by default, and not
implementing anything like the noisy default version banner printing that MSVC
does, or this filename printing. I think setting this flag is something for
cmake or the VS
zturner added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
steveire wrote:
>
zturner added a comment.
Canyou add a test that demonstrates that multiple input files on the command
line will print all of them? Also does this really need to be a cc1 arg? Why
not just print it in the driver?
https://reviews.llvm.org/D52773
thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.
Looks good. If this is passed and we invoke lld-link, should we give that a
similar flag and pass that to lld-link as well? I think link.exe also prints
its outputs.
steveire added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
hans wrote:
>
hans added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
zturner wrote:
>
zturner added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
steveire wrote:
>
steveire added inline comments.
Comment at: lib/Frontend/CompilerInvocation.cpp:792
Opts.MainFileName = Args.getLastArgValue(OPT_main_file_name);
+ if (Args.hasArg(OPT_echo_main_file_name))
+llvm::outs() << Opts.MainFileName << "\n";
I'll have to keep a
hans created this revision.
hans added reviewers: rnk, thakis, zturner, steveire.
Add a /showFilenames option for users who want clang to echo the currently
compiled filename. MSVC does this echoing by default, and it's useful for
showing progress in build systems that doesn't otherwise provide
22 matches
Mail list logo