[lld] [llvm] WIP: [LLD][COFF] Make unresolved symbol search behavior compliant with MSVC link.exe (PR #85290)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 11:18:19 PDT 2024


================
@@ -562,25 +565,120 @@ std::pair<Symbol *, bool> SymbolTable::insert(StringRef name, InputFile *file) {
   return result;
 }
 
+static LazyIntrusiveNode *lazyNode(Symbol *s) {
+  if (auto *sym = dyn_cast<LazyArchive>(s))
+    return &sym->node;
+  if (auto *sym = dyn_cast<LazyObject>(s))
+    return &sym->node;
+  return nullptr;
+}
+
+static ArchiveFile *lazyParent(InputFile *f) {
+  if (!f)
----------------
sylvain-audi wrote:

This null check feels off, it looks a bit like `if (!this)` and it's a different behavior from the 2 other similar helpers `lazyNode` and `lazyArchive`. I think it should move to the caller.

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


More information about the llvm-commits mailing list