[llvm] [lld] [ThinLTO] Add module names to ThinLTO final objects (PR #74160)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 09:53:53 PST 2023


================
@@ -351,23 +351,65 @@ std::vector<InputFile *> BitcodeCompiler::compile() {
   if (!config->thinLTOCacheDir.empty())
     pruneCache(config->thinLTOCacheDir, config->thinLTOCachePolicy, files);
 
-  if (!config->ltoObjPath.empty()) {
-    saveBuffer(buf[0], config->ltoObjPath);
-    for (unsigned i = 1; i != maxTasks; ++i)
-      saveBuffer(buf[i], config->ltoObjPath + Twine(i));
-  }
+  auto doSaveBuffer = [&](const StringRef Arg, const StringRef Suffix = "") {
----------------
teresajohnson wrote:

I wonder if some of this should be moved to saveBuffer which is in a common library and invoked from non-ELF as well? Or at least parts of this?

https://github.com/llvm/llvm-project/pull/74160


More information about the llvm-commits mailing list