[PATCH] D29445: LTO: add a code-model flag

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 17:45:52 PST 2017


martell added a comment.

> I don't think the code model information will be passed correctly from the compiler to the linker in that case. `CMModel` will be the value of the existing `-code-model` flag, which will be `CodeModel::Default` by default (same as the default in `lto::Config`, see http://llvm-cs.pcc.me.uk/include/llvm/CodeGen/CommandFlags.h#81). You can pass it to lld with (e.g.) `-mllvm -code-model=large` or to gold with `-plugin-opt -code-model=large`.

I think I am missing something here. How does `Config->CodeModel = CMModel;` get all the way into the gold plugin for parsing.  I had to add an option to `process_plugin_option` to pull out the string.
Is there something within `cl::opt` that has the magic to check the string against CMModel?
I don't currently see an example of this being used in that manner anywhere.
Hints are very welcome :)


Repository:
  rL LLVM

https://reviews.llvm.org/D29445





More information about the llvm-commits mailing list