[PATCH] D27077: LTO: Port the new LTO API to ModuleSymbolTable.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 11:44:35 PST 2016


pcc added inline comments.


================
Comment at: llvm/include/llvm/LTO/LTO.h:84
+  ModuleSymbolTable SymTab;
+  std::unique_ptr<Module> Mod;
+  MemoryBufferRef MBRef;
----------------
mehdi_amini wrote:
> pcc wrote:
> > mehdi_amini wrote:
> > > It seems there is not much that still requires us to keep `Mod` here, what is fundamentally the remaining issue? 
> > The major ones are:
> > - We need something to own the module
> > - We need to be able to query the source file name
> > - We need it to be able to extract `used` bits in `add*LTO`
> > Essentially we need it to access information that will later be stored in the bitcode symbol table. But until that's ready there's no harm in accessing the module directly.
> Owning the module is only useful for the two other parts right? Technically we could store the source file name directly and extract the "used" early.
> The latter seems overkill to do now considering we're moving to a bitcode symbol table.
An owner is also needed for the GlobalValues stored in ModuleSymbolTable.

But that's just another example of something that can be refactored with the bitcode symbol table.


https://reviews.llvm.org/D27077





More information about the llvm-commits mailing list