[lld] [ELF] Parallelize input file loading (PR #191690)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 10:56:49 PDT 2026
================
@@ -186,17 +201,20 @@ class LinkerDriver {
private:
Ctx &ctx;
void createFiles(llvm::opt::InputArgList &args);
+ void loadFiles();
void inferMachineType();
template <class ELFT> void link(llvm::opt::InputArgList &args);
template <class ELFT> void compileBitcodeFiles(bool skipLinkedOutput);
- bool tryAddFatLTOFile(MemoryBufferRef mb, StringRef archiveName,
- uint64_t offsetInArchive, bool lazy);
// True if we are in --whole-archive and --no-whole-archive.
bool inWholeArchive = false;
// True if we are in --start-lib and --end-lib.
bool inLib = false;
+ // True inside createFiles(): defers to loadFiles().
+ bool deferLoad = false;
----------------
smithp35 wrote:
Does this have to be a member variable? Just thinking that addFile() could have a deferLoad Parameter that is set to true within createFiles(). It would likely need threading through in a few places, like `addLibrary`.
I usually find local parameters a bit easier to reason about than class state, but if it means a large amount of code churn it may not be worth it.
I could be missing something important.
https://github.com/llvm/llvm-project/pull/191690
More information about the llvm-commits
mailing list