[lld] 51b521c - [lld][WebAssembly] Use a more meaningful name for stub functions
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 14:55:50 PST 2020
Author: Sam Clegg
Date: 2020-01-16T14:55:37-08:00
New Revision: 51b521c07a7a784d087d6a4c176b132cc4e36db7
URL: https://github.com/llvm/llvm-project/commit/51b521c07a7a784d087d6a4c176b132cc4e36db7
DIFF: https://github.com/llvm/llvm-project/commit/51b521c07a7a784d087d6a4c176b132cc4e36db7.diff
LOG: [lld][WebAssembly] Use a more meaningful name for stub functions
When we generate these stub functions on signature mismatches give
them a more meaningful name so that when people see this in stack
traces is gives a clue as the what is going on.
See: https://github.com/emscripten-core/emscripten/issues/10226
Differential Revision: https://reviews.llvm.org/D72881
Added:
Modified:
lld/test/wasm/signature-mismatch-export.ll
lld/test/wasm/signature-mismatch.ll
lld/wasm/SymbolTable.cpp
Removed:
################################################################################
diff --git a/lld/test/wasm/signature-mismatch-export.ll b/lld/test/wasm/signature-mismatch-export.ll
index 7e4d3a6a95b4..55ca66ba81bd 100644
--- a/lld/test/wasm/signature-mismatch-export.ll
+++ b/lld/test/wasm/signature-mismatch-export.ll
@@ -22,7 +22,7 @@ entry:
; CHECK-NEXT: Name: name
; CHECK-NEXT: FunctionNames:
; CHECK-NEXT: - Index: 0
-; CHECK-NEXT: Name: 'unreachable:ret32'
+; CHECK-NEXT: Name: 'signature_mismatch:ret32'
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: Name: _start
; CHECK-NEXT: - Index: 2
diff --git a/lld/test/wasm/signature-mismatch.ll b/lld/test/wasm/signature-mismatch.ll
index 878ca53bb46c..116d81823ab0 100644
--- a/lld/test/wasm/signature-mismatch.ll
+++ b/lld/test/wasm/signature-mismatch.ll
@@ -40,7 +40,7 @@ declare i32 @ret32(i32, i64, i32) local_unnamed_addr
; YAML-NEXT: Name: name
; YAML-NEXT: FunctionNames:
; YAML-NEXT: - Index: 0
-; YAML-NEXT: Name: 'unreachable:ret32'
+; YAML-NEXT: Name: 'signature_mismatch:ret32'
; YAML-NEXT: - Index: 1
; YAML-NEXT: Name: _start
; YAML-NEXT: - Index: 2
diff --git a/lld/wasm/SymbolTable.cpp b/lld/wasm/SymbolTable.cpp
index 598859d3c987..3c1acbd2c68f 100644
--- a/lld/wasm/SymbolTable.cpp
+++ b/lld/wasm/SymbolTable.cpp
@@ -719,7 +719,7 @@ void SymbolTable::handleSymbolVariants() {
if (symbol != defined) {
auto *f = cast<FunctionSymbol>(symbol);
reportFunctionSignatureMismatch(symName, f, defined, false);
- StringRef debugName = saver.save("unreachable:" + toString(*f));
+ StringRef debugName = saver.save("signature_mismatch:" + toString(*f));
replaceWithUnreachable(f, *f->signature, debugName);
}
}
More information about the llvm-commits
mailing list