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

Thomas Guest via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 08:22:54 PDT 2016


thomasguest added a comment.

In http://reviews.llvm.org/D19015#399467, @joker.eph wrote:

> In http://reviews.llvm.org/D19015#399466, @thomasguest wrote:
>
> > In http://reviews.llvm.org/D19015#399462, @joker.eph wrote:
> >
> > > To put it differently: there is no command line option for LLVM (as a library), only APIs.
> >
> >
> > Yes, what I am really after is a way to configure codegen when using LLVM via the LTO library. At the moment I cannot do so.
>
>
> Yes, apparently no-one had this need till now, submit a patch :)


OK, I can work on that as a separate patch.

> > The lto_codegen_debug_options() function does allow me to pass options in and does result in these options being parsed using cl::ParseCommandLineOptions() -- the problem is, without this patch, these options do not get applied, which I think is an issue for anyone trying to debug LTO.dll using lto_codegen_debug_options().

> 

> 

> Sure.


Given this, I think the patch stands as is. I have changed the title and description to reflect the new intent.


================
Comment at: tools/lto/lto.cpp:387
@@ -386,1 +386,3 @@
+    TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
+    unwrap(cg)->setTargetOptions(Options);
     parsedOptions = true;
----------------
joker.eph wrote:
> Why not doing this directly inside `parseCodeGenDebugOptions()`?
I think this is a good suggestion, thanks, and would make it possible to unit test the change.


http://reviews.llvm.org/D19015





More information about the llvm-commits mailing list