[PATCH] D18795: Don't store names in the symbols

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 13:04:00 PDT 2016


> If this is neutral in terms of performance, I wouldn't probably do this, as it feels pretty natural to me to have symbols have names, even though we do not use them often in the linker. It is also useful for debugging and easy to understand.

Fair enough.

> In addition to that, this change seems to make it hard to parallelize file parsing. Currently, most part of file parsing does not interact with other parts of the linker, so we can call them in parallel. However, if you pass Resolve to each parsing function, it is no longer possible.

True. I did try keeping just the offset, but that requires most of the
changes in this patch anyway. Otherwise we compute the size of global
symbols multiple times.

> ================
> Comment at: ELF/InputFiles.h:115
> @@ -113,2 +114,3 @@
>    explicit ObjectFile(MemoryBufferRef M);
> -  void parse(llvm::DenseSet<StringRef> &ComdatGroups);
> +  void parse(llvm::function_ref<void(StringRef, SymbolBody *)> Resolve,
> +             llvm::DenseSet<StringRef> &ComdatGroups);
> ----------------
> Is there any reason to use llvm::function_read instead of std::function?

It is supposed to be faster for when we don't need to store it
somewhere. I confess I don't know the details.

Cheers,
Rafael


More information about the llvm-commits mailing list