[PATCH] D31364: LTO: Reduce memory consumption by creating an in-memory symbol table for InputFiles. NFCI.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 14:35:25 PDT 2017


On Tue, Jun 6, 2017 at 3:26 PM Peter Collingbourne via Phabricator <
reviews at reviews.llvm.org> wrote:

> pcc added inline comments.
>
>
> ================
> Comment at: llvm/include/llvm/Object/IRSymtab.h:123
> +/// Fills in Symtab and Strtab with a valid symbol and string table for
> Mods.
> +Error write(ArrayRef<Module *> Mods, SmallVector<char, 0> &Symtab,
> +            SmallVector<char, 0> &Strtab);
> ----------------
> pcc wrote:
> > tejohnson wrote:
> > > The name "write" here seems unexpected to me, since we aren't writing
> to disk e.g.. The client does a "write" which involves a Writer class,
> followed by a Reader, when together both are needed to essentially "read"
> the symbols from Modules. Maybe "buildSymbolTable" or something like that.
> The Writer is more like a Builder.
> > Renamed to "build" (likewise to "Builder").
> Every time I go into this code it bugs me a little that we have a reader
> and a builder (as opposed to a writer). I hate to bring up a bikeshedding
> topic, and it's not a big deal I guess, but would you mind if I rename this
> back to write/Writer? In support of my position I point to the many Writer
> classes we have in LLVM [1] that are not necessarily writing to disk.


To me a "writer" is doing some sort of serialization while a builder is
constructing structured representation / program entities. There is not
necessarily a disk involved.
So conceptually are you "building a SymTab from a Module" or "Writing a
Module into a SymTab"?

-- 
Mehdi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170607/3bd4c247/attachment.html>


More information about the llvm-commits mailing list