[PATCH] D23706: [LTO] Refactor the ThinLTO distributed backend

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 06:15:57 PDT 2016


tejohnson added a comment.

It isn't clear to me why we would want this functionality to live in the clients, rather than providing a set of configurable functionality that different build systems might need inside LTO itself. It means possibly implementing the same functionality required by a single build system in potentially all clients, since the build system is not dependent on a single client linker.


================
Comment at: include/llvm/LTO/LTO.h:262
@@ -251,12 +261,3 @@
 /// where separate processes will invoke the real backends.
-///
-/// To find the path to write the index to, the backend checks if the path has a
-/// prefix of OldPrefix; if so, it replaces that prefix with NewPrefix. It then
-/// appends ".thinlto.bc" and writes the index to that path. If
-/// ShouldEmitImportsFiles is true it also writes a list of imported files to a
-/// similar path with ".imports" appended instead.
-ThinBackend createWriteIndexesThinBackend(std::string OldPrefix,
-                                          std::string NewPrefix,
-                                          bool ShouldEmitImportsFiles,
-                                          std::string LinkedObjectsFile);
+ThinBackend createWriteIndexesThinBackend(WriteIndexFn PerModuleCallback);
 
----------------
Parameter is called AddModule elsewhere.

================
Comment at: tools/gold/gold-plugin.cpp:805
@@ +804,3 @@
+      // Add to the list of emitted objects
+      *LinkedObjectsFile << NewModulePath << '\n';
+      raw_fd_ostream OS(NewModulePath + ".thinlto.bc", EC,
----------------
This may be null


https://reviews.llvm.org/D23706





More information about the llvm-commits mailing list