[PATCH] D50475: ELF: Only add libcall symbols to the link if defined in bitcode.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 15:00:49 PDT 2018


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lld/ELF/Driver.cpp:1221
+
+  MemoryBufferRef MB;
+  if (auto *LO = dyn_cast<LazyObject>(Sym))
----------------
pcc wrote:
> ruiu wrote:
> > Is it too expensive or is there any problem if we simply call `Sym->fetch()` and see if the returned value is of BitcodeFile (and if so, add to the symbol table)?
> I don't think that would work because subsequent calls to `fetch` would return nullptr. That means that if the object file actually turns out to be required, we wouldn't end up adding it.
Can you return right here if it is not isLazy?


Repository:
  rL LLVM

https://reviews.llvm.org/D50475





More information about the llvm-commits mailing list