Page MenuHomePhabricator

Do not embed all the cc1 options in bitcode commandline

Authored by steven_wu on Jun 10 2016, 9:16 AM.



Previously, all the cc1 options are passed to both compile stage and codegen
stage and almost all of them are embedded in the commandline section in the
object file when using embedded bitcode.
In reality, the most of the options are not needed for codegen phase. Some of
them are useless, for example, include paths, warning flags. Some of them are
included in the bitcode, for example, PIC mode.
This fixes the issue by removing unnecessary opts from both codegen cc1 command
and the commandline embedded in object file. This is achieved by adding all the
necessary cc1 options to a specific group. I also plan to extend this group
to driver flags so clang can issue warnings when using these options with LTO
because they are likely to get dropped in the process.
The list of the cc1 options are created from the options that will affect the
TargetMachine created in clang FrontendInvocation. I also make sure none of
these options are actually turned into an attribute in CGCall.

Note: This is an alternative to

Diff Detail

Event Timeline

steven_wu updated this revision to Diff 60363.Jun 10 2016, 9:16 AM
steven_wu retitled this revision from to Do not embed all the cc1 options in bitcode commandline.
steven_wu updated this object.
steven_wu added reviewers: rsmith, dexonsmith.
steven_wu added subscribers: cfe-commits, jfb, dschuff.
steven_wu abandoned this revision.Dec 10 2018, 11:01 AM

This is upstreamed by Saleem already