[PATCH] D46400: Add support for thinlto option to emit import files for thinlink

Rumeet Dhindsa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 12:28:01 PDT 2018


rdhindsa added inline comments.


================
Comment at: lld/ELF/LTO.cpp:102
+  if (Config->ThinLTOEmitImportsFiles) {
+    raw_fd_ostream OS(NewModulePath + ".imports", EC,
+                      sys::fs::OpenFlags::F_None);
----------------
ruiu wrote:
> I don't understand this part of code. I think OS will be closed at end of this `if` block, so I don't think you are writing anything to the file. Is this code correct?
For all the bitcode files, empty import files are generated at first. For the files selected by the linker having summary, lto::createWriteIndexesThinBackend overwrites the imports files . However, for the files which are either not selected by linker or they don't have summary, we don't write anything to .imports file since they don't import anything. These files are required for distributed ThinLTO build file staging.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D46400





More information about the llvm-commits mailing list