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 http://reviews.llvm.org/D17394