This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Pass -O* to the gold plugin via -plugin-opt
ClosedPublic

Authored by jmolloy on Dec 18 2015, 5:53 AM.

Details

Reviewers
jmolloy
joerg
Summary

The gold plugin understands -O0..-O3, but these are not currently being passed to it.

Diff Detail

Repository
rL LLVM

Event Timeline

jmolloy updated this revision to Diff 43224.Dec 18 2015, 5:53 AM
jmolloy retitled this revision from to [Driver] Pass -O* to the gold plugin via -plugin-opt.
jmolloy updated this object.
jmolloy added a reviewer: joerg.
jmolloy set the repository for this revision to rL LLVM.
jmolloy added a subscriber: cfe-commits.
rafael added a subscriber: rafael.

This introduces a meaning to -ON during the link. That normally show up by people passing CFLAGS when linking.

I think that is OK, but would like a second opinion.

lib/Driver/Tools.cpp
1815

Can you refactor these 3 calls to push_back?

1817

Why do you need to manually issue a diagnostic?

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

lib/Driver/Tools.cpp
1815

Sure!

1817

You're right - I don't. I'll remove this.

jmolloy accepted this revision.Dec 21 2015, 2:48 AM
jmolloy added a reviewer: jmolloy.

Hi,

As we got to the bottom of why this is actually needed, I committed this with the changes suggested by Rafael in r256146.

Cheers,

James

This revision is now accepted and ready to land.Dec 21 2015, 2:48 AM
jmolloy closed this revision.Dec 21 2015, 2:48 AM