[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 01:23:08 PDT 2024
================
@@ -828,9 +842,20 @@ bool SymbolTable::getFunctionVariant(Symbol* sym, const WasmSignature *sig,
// Set a flag for --trace-symbol so that we can print out a log message
// if a new symbol with the same name is inserted into the symbol table.
void SymbolTable::trace(StringRef name) {
+ tracingEnabled = true;
symMap.insert({CachedHashStringRef(name), -1});
}
+bool SymbolTable::isTraced(StringRef name) {
+ // Early exit in the default case to avoid symbol hashmap lookup.
+ if (!tracingEnabled)
+ return false;
+ auto it = symMap.find(CachedHashStringRef(name));
+ if (it == symMap.end())
+ return false;
+ return it->second == -1 || symVector[it->second]->traced;
----------------
aheejin wrote:
What does `it->second == -1` mean?
https://github.com/llvm/llvm-project/pull/96119
More information about the llvm-commits
mailing list