[PATCH] D19015: [LTO] ensure lto_codegen_debug_options() are passed on to LLVM

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 08:42:35 PDT 2016


On 13 April 2016 at 11:38, Thomas Guest <thomas_guest at sn.scee.net> wrote:
> thomasguest added a comment.
>
> In http://reviews.llvm.org/D19015#399821, @probinson wrote:
>
>> Let me point out that the gold plugin works exactly this way (pass in cl options as a string).
>>  It might not be ideal but it's what we have today.
>>  LLVM-as-library doesn't really have another way to conjure up TargetOptions (I *think* clang creates one directly, sorry can't check right now, but that seems even more fragile).
>
>
> Thanks for the information @probinson
> I was imagining the way to configure codegen via the C API would be to add a new function: lto_codegen_configure(lto_codegen_t cg, char ** argv, int argc);

No, you should not expose argv for anything other than debug.

As it was pointed out, if you want to programmatically  set an option,
you should do something like what clang does.

Cheers,
Rafael


More information about the llvm-commits mailing list