[PATCH] D116434: [lld-link] Replace LazyObjFile with lazy ObjFile/BitcodeFile

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 14:09:26 PST 2022


MaskRay added inline comments.


================
Comment at: lld/COFF/SymbolTable.cpp:42
+    if (auto *f = dyn_cast<BitcodeFile>(file))
+      f->parseLazy();
+    else
----------------
rnk wrote:
> If `parse` is virtual, should `parseLazy` be virtual as well? Doing O(objects) virtual calls shouldn't matter for performance, it's the O(symbols) actions that matter.
The virtual dispatch cost doesn't matter.

If `parseLazy` is made virtual, `virtual void InputFile::parseLazy() = 0;` will be needed as many file kinds don't have reasonable `parseLazy` semantics. That may not be clearer than open coding the two possible file kinds here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116434



More information about the llvm-commits mailing list