[PATCH] D25495: [ThinLTO] Avoid archive member collisions

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 11:36:14 PDT 2016


mehdi_amini added inline comments.


================
Comment at: ELF/InputFiles.cpp:726-727
+  Obj = check(lto::InputFile::create(MemoryBufferRef(
+      MB.getBuffer(), Saver.save(ArchiveName + MB.getBufferIdentifier() +
+                                 utostr(OffsetInArchive)))));
   DenseSet<const Comdat *> KeptComdats;
----------------
pcc wrote:
> davide wrote:
> > ruiu wrote:
> > > Can you use the object address as a unique identifier instead? I mean `utostr((uint64_t)&MB)` is always unique.
> > Maybe, but I'd like to double check with Peter to make sure it's fine on `lib/LTO` side (probably it is).
> I'd prefer not to do that, for a couple of reasons:
> 1) these names are used by `lib/LTO` to form file names for `save-temps`, and it's probably best if that remains deterministic
> 2) eventually I think we will need to plumb the file name and offset into `lib/LTO` so that ThinLTO can use it to reload the input file in another process.
For 2), that would tie us to a "file based" API, I'll look closely at the benefit before going this route.


https://reviews.llvm.org/D25495





More information about the llvm-commits mailing list