[PATCH] D31921: Object: Factor out the code for creating the irsymtab for an arbitrary bitcode file.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 11:54:24 PDT 2017


pcc added a comment.

In https://reviews.llvm.org/D31921#724520, @tejohnson wrote:

> In https://reviews.llvm.org/D31921#724280, @pcc wrote:
>
> > In https://reviews.llvm.org/D31921#724251, @tejohnson wrote:
> >
> > > In https://reviews.llvm.org/D31921#724231, @pcc wrote:
> > >
> > > > The irsymtab interface lives at a lower layer than IRObjectFile, as the irsymtab interface is specifically designed for IR symbol tables as opposed to the generic object file interface exposed by ObjectFile. I see this function as the layer between the raw irsymtab reader interface and clients such as IRObjectFile (and LTO, etc). So it doesn't seem appropriate for this function to live alongside one specific client, and it doesn't really deserve its own file/namespace, so it might as well live alongside irsymtab.
> > >
> > >
> > > What I don't like is that this is not just parsing the irsymtab structures, but also the modules themselves.
> >
> >
> > True, but that is only an implementation detail. When we start writing the irsymtab to disk, the modules will only be parsed on the "upgrade" code path.
>
>
> Ok, I forgot about that. Looking now at the InputFile class, the comments indicate it only holds what is necessary for symbol resolution, so I guess the idea is that the Mods field will go away (except I guess on the upgrade path) when we have a real IR symbol table on disk? But then currently the Mods field is used when we add the module for regular LTO, where we do need the full module.


We will always need references to the actual modules in the InputFile class as part of the implementation (not only for full LTO but for ThinLTO to read the summaries and the modules themselves in the backends). I see this function as returning the conceptual top-level entities in the bitcode file, i.e. the symbol table as well as references to the modules.


https://reviews.llvm.org/D31921





More information about the llvm-commits mailing list