[PATCH] D15641: [Driver] Pass -O* to the gold plugin via -plugin-opt
James Molloy via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 18 06:39:06 PST 2015
jmolloy added a comment.
Hi Rafael,
Thanks for the review!
> This introduces a meaning to -ON during the link. That normally show up by people passing CFLAGS when linking.
Yes. The rationale is that with -flto, the link is also part of the compile. I think it's more surprising that the compiler isn't called with the -O options than the reverse!
James
================
Comment at: lib/Driver/Tools.cpp:1815
@@ +1814,3 @@
+ } else if (A->getOption().matches(options::OPT_O0)) {
+ CmdArgs.push_back("-plugin-opt=O0");
+ } else {
----------------
rafael wrote:
> Can you refactor these 3 calls to push_back?
Sure!
================
Comment at: lib/Driver/Tools.cpp:1817
@@ +1816,3 @@
+ } else {
+ ToolChain.getDriver().Diag(clang::diag::warn_drv_unused_argument)
+ << A->getAsString(Args);
----------------
rafael wrote:
> Why do you need to manually issue a diagnostic?
>
You're right - I don't. I'll remove this.
Repository:
rL LLVM
http://reviews.llvm.org/D15641
More information about the cfe-commits
mailing list