[lld] [LLD][COFF] Factor out addObjectFile (PR #206811)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 1 14:49:55 PDT 2026
================
@@ -262,21 +262,27 @@ MemoryBufferRef LinkerDriver::takeBuffer(std::unique_ptr<MemoryBuffer> mb) {
return mbref;
}
-static InputFile *tryCreateFatLTOFile(COFFLinkerContext &ctx,
- MemoryBufferRef mb, StringRef archiveName,
- uint64_t offsetInArchive, bool lazy) {
+InputFile *LinkerDriver::addObjectFile(COFFLinkerContext &ctx,
+ MemoryBufferRef mb,
+ StringRef archiveName,
+ uint64_t offsetInArchive, bool lazy) {
+ std::unique_ptr<COFFObjectFile> coffObj = ObjFile::createCOFFObject(ctx, mb);
+ InputFile *obj = nullptr;
+
if (ctx.config.fatLTOObjects) {
Expected<MemoryBufferRef> fatLTOData =
- IRObjectFile::findBitcodeInMemBuffer(mb);
----------------
mstorsjo wrote:
So the point mentioned in the commit message, is that the previous call to `findBitcodeInMemBuffer` implicitly parsed the object file, but by parsing it ourselves we don't need to parse it again? Can you clarify that in the commit message, that the separate parsing that we get rid of was within `findBitcodeInMemBuffer`?
https://github.com/llvm/llvm-project/pull/206811
More information about the llvm-commits
mailing list