[lld] [lld][WebAssembly] Allow `--trace-symbol` to work with symbols with custom import names (PR #96119)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 17:58:38 PDT 2024


================
@@ -612,10 +623,11 @@ Symbol *SymbolTable::addUndefinedGlobal(StringRef name,
   if (s->traced)
     printTraceSymbolUndefined(name, file);
 
-  if (wasInserted)
+  if (wasInserted) {
+    traceImport(importName, file);
----------------
aheejin wrote:

`traceImport` sounds like telling the program to start tracing the import, which doesn't seem to be the case; it just prints the import. 

By the way, I'm not very familiar with the code structure here so I might be missing something, but should we call `printTraceSymbolUndefined` and `traceImport` separately from several places? Can we do both in one function and preferably one place, when `importName` is not null?

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


More information about the llvm-commits mailing list