================
@@ -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:

This does not segregate between "we haven't found the bitstream in the COFF 
object" vs. "there's an error while parsing the object". If the return code is 
`object_error::bitcode_section_not_found` we should fallback on the 
`ObjFile::create` case; whereas any other error should be emitted in the log 
(`Fatal(ctx) << ...`)

https://github.com/llvm/llvm-project/pull/165529
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to