[PATCH] D11907: LLVM support for -fthinlto option.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 07:59:05 PDT 2015


tejohnson marked 2 inline comments as done.
tejohnson added a comment.

In http://reviews.llvm.org/D11907#224874, @joker.eph wrote:

> It seems a bit intrusive to make the BitcodeWriter aware of LTO. It seems you want it to handle your specific information at the end of a module block right?
>  Can we have a generic hook mechanism? For instance, we might provide a std::function callback instead of this ad-hoc boolean.


Interesting idea. The boolean is passed down from clang (based on the -fthinlto option) when it calls createBitcodeWriterPass. I'm trying to envision how a callback would work - I guess save the bool passed from clang on the WriteBitcodePass object (as it is already done in this patch), and then have a static WriteBitcodePass method that returns the bool value? But then we would need to pass this function into WriteBitcodeToFile as a std::function, and that would have to be passed down to WriteModule (instead of the bool) and invoked there. Am I missing a better way to do this via a callback? It seems like we end up either passing down a bool or a std::function callback.


================
Comment at: include/llvm/Bitcode/BitcodeWriterPass.h:34
@@ -34,1 +33,3 @@
+                                    bool ShouldPreserveUseListOrder = false,
+                                    bool EmitThinLTOIndex = false);
 
----------------
joker.eph wrote:
> Update doxygen?
Will upload new patch in a min that updates doxygen.


http://reviews.llvm.org/D11907





More information about the llvm-commits mailing list