[PATCH] D21230: Do not embed all the cc1 options in bitcode commandline

Steven Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 10 09:16:38 PDT 2016


steven_wu created this revision.
steven_wu added reviewers: rsmith, dexonsmith.
steven_wu added subscribers: cfe-commits, jfb, dschuff.

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

http://reviews.llvm.org/D21230

Files:
  include/clang/Driver/CC1Options.td
  include/clang/Driver/Options.td
  lib/Driver/Tools.cpp
  lib/Driver/Tools.h
  lib/Frontend/CompilerInvocation.cpp
  test/Driver/compress.c
  test/Driver/embed-bitcode.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21230.60363.patch
Type: text/x-patch
Size: 25497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160610/06e2502d/attachment-0001.bin>


More information about the cfe-commits mailing list