[clang] [lld] [llvm] Add FatLTO support for COFF (PR #165529)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 08:10:29 PST 2025


================
@@ -256,6 +257,23 @@ MemoryBufferRef LinkerDriver::takeBuffer(std::unique_ptr<MemoryBuffer> mb) {
   return mbref;
 }
 
+InputFile *LinkerDriver::tryCreateFatLTOFile(MemoryBufferRef mb,
+                                             StringRef archiveName,
+                                             uint64_t offsetInArchive,
+                                             bool lazy) {
+  if (!ctx.config.fatLTOObjects)
+    return nullptr;
+
+  Expected<MemoryBufferRef> fatLTOData =
+      IRObjectFile::findBitcodeInMemBuffer(mb);
+
+  if (errorToBool(fatLTOData.takeError()))
----------------
aganea wrote:

It is true that any COFF error will be handled later by `ObjFile::create`. I am wondering if `IRObjectFile::findBitcodeInMemBuffer` could return other errors while looking for the FAT LTO buffer.

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


More information about the llvm-commits mailing list