[lld] [LLD][COFF] Move Archive::create call to LinkerDriver::addBuffer (NFC) (PR #194346)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 05:48:10 PDT 2026
================
@@ -150,16 +150,16 @@ static bool fixupDllMain(COFFLinkerContext &ctx, llvm::object::Archive *file,
return false;
}
-ArchiveFile::ArchiveFile(COFFLinkerContext &ctx, MemoryBufferRef m)
- : InputFile(ctx.symtab, ArchiveKind, m) {}
+ArchiveFile::ArchiveFile(COFFLinkerContext &ctx, MemoryBufferRef m,
+ std::unique_ptr<Archive> &f)
+ : InputFile(ctx.symtab, ArchiveKind, m) {
+ file.swap(f);
+}
void ArchiveFile::parse() {
COFFLinkerContext &ctx = symtab.ctx;
SymbolTable *archiveSymtab = &symtab;
- // Parse a MemoryBufferRef as an archive file.
----------------
cjacek wrote:
It's one after another, `parse()` is called by `addFile` and constructing `ArchiveFile` looks like this (in `LinkerDriver::addBuffer`): `addFile(make<ArchiveFile>(ctx, mbref))`.
https://github.com/llvm/llvm-project/pull/194346
More information about the llvm-commits
mailing list