[PATCH] D42514: [ThinLTO/gold] Write empty imports even for modules with symbols

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 11:34:38 PST 2018


vitalybuka marked an inline comment as done.
vitalybuka added inline comments.


================
Comment at: llvm/tools/gold/gold-plugin.cpp:873
+      createLTO([&ObjectFilenames](const std::string &Identifier) {
+        ObjectFilenames.erase(Identifier);
+      });
----------------
tejohnson wrote:
> Thinking through this some more, this seems a little dicey, because it assumes that createLTO will never try to access these filename strings that are owned by this set after the callback. In fact, that doesn't even seem to be the case currently (ModulePath which is a StringRef of the module identifier is passed to EmitImportsFiles after this callback is invoked). Rather than try to fix that, since it would still be fragile, I suggest making this a StringMap and noting in the map whether the file was written.
Oh, I've totally missed "owning" part in the first place.


https://reviews.llvm.org/D42514





More information about the llvm-commits mailing list