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

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 11:34:18 PDT 2016


pcc 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;
----------------
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.


https://reviews.llvm.org/D25495





More information about the llvm-commits mailing list