[lld] [LLD][COFF] Detect weak reference cycles. (PR #104463)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 03:28:38 PDT 2024


================
@@ -126,9 +127,14 @@ DefinedImportThunk::DefinedImportThunk(COFFLinkerContext &ctx, StringRef name,
 
 Defined *Undefined::getWeakAlias() {
   // A weak alias may be a weak alias to another symbol, so check recursively.
-  for (Symbol *a = weakAlias; a; a = cast<Undefined>(a)->weakAlias)
+  SmallSet<Symbol *, 4> weakChain;
----------------
mstorsjo wrote:

So DenseMap is better here, than using DenseSet?

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


More information about the llvm-commits mailing list