[PATCH] D131618: [WIP][Do NOT review] LLD related changes for -ffat-lto-objects support

Arda Unal via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 22 21:36:20 PDT 2022


arda marked 2 inline comments as done.
arda added inline comments.


================
Comment at: lld/ELF/InputFiles.cpp:1721
+    Expected<MemoryBufferRef> fatLTOData = IRObjectFile::findBitcodeInMemBuffer(mb);
+    if (!errorToBool(fatLTOData.takeError()))
+      return make<BitcodeFile>(*fatLTOData, archiveName, offsetInArchive, /*lazy=*/false);
----------------
paulkirth wrote:
> Do we just keep going if there's an error? This is only checking if there's **not** an error, right? or does `takeError` do more than I remember?
We just keep going if there is an error. So we end up using the assembly and not the embedded LTO module when generating the object file if there is no embedded bitcode in the input files.


================
Comment at: lld/test/ELF/fatlto/fatlto.test:28-30
+; RUN: obj2yaml %tfoo-fatLTO > %tfoo-fatLTO.yaml
+; RUN: obj2yaml %tfoo-LTO > %tfoo-LTO.yaml
+; RUN: diff %tfoo-fatLTO.yaml %tfoo-LTO.yaml
----------------
paulkirth wrote:
> Can this test fail given how you generate the linker's inputs and what you're comparing? 
> 
> So, does the diff fail if you don't pass the `-fat-lto-objects` flag on Line 13? 
Yes, it fails.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131618/new/

https://reviews.llvm.org/D131618



More information about the cfe-commits mailing list