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

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 13:52:59 PDT 2017


>> * The on disk format has an specific endianness.
>> * A pointer to a mmap area should use something like
>> support::ulittle32_t*.
>> * But it should be read once producing a uint32_t.
>
>
> I agree that the pointers to the mmap area should use something low level
> that exposes the endianness, and that is what I intend the structs that I am
> introducing in this patch to be used for. Although the reader code could
> unpack the data structures manually out of a support::ulittle32_t* pointer,
> I think the structs help with readability.
>
> Essentially the data structures I am adding are the equivalent of the
> definitions in llvm/Object/ELFTypes.h for ELF.

OK. That make sense. The logic for not using values of explicit
endianness types is transitive. We should not in general have a
"support::ulittle32_t X" variable, but we can have a "struct Foo" that
has a "support::ulittle32_t X" member. That just implies that we
should not have a variable of type Foo, just Foo*.

> I guess you're referring to for example how we read fields once from an
> Elf_Sym and copy them into a SymbolBody. If so, that makes perfect sense to
> me.

Correct.

Cheers,
Rafael


More information about the llvm-commits mailing list