[PATCH] D72881: [lld][WebAssembly] Use a more meaningful name for stub functions
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 16 14:43:56 PST 2020
sbc100 created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, dschuff.
Herald added a project: LLVM.
sbc100 added a reviewer: ruiu.
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 givesa clue as the what is going on.
See: https://github.com/emscripten-core/emscripten/issues/10226
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72881
Files:
lld/test/wasm/signature-mismatch-export.ll
lld/test/wasm/signature-mismatch.ll
lld/wasm/SymbolTable.cpp
Index: lld/wasm/SymbolTable.cpp
===================================================================
--- lld/wasm/SymbolTable.cpp
+++ lld/wasm/SymbolTable.cpp
@@ -719,7 +719,7 @@
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);
}
}
Index: lld/test/wasm/signature-mismatch.ll
===================================================================
--- lld/test/wasm/signature-mismatch.ll
+++ lld/test/wasm/signature-mismatch.ll
@@ -40,7 +40,7 @@
; 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
Index: lld/test/wasm/signature-mismatch-export.ll
===================================================================
--- lld/test/wasm/signature-mismatch-export.ll
+++ lld/test/wasm/signature-mismatch-export.ll
@@ -22,7 +22,7 @@
; 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72881.238625.patch
Type: text/x-patch
Size: 1746 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200116/3636b4d0/attachment.bin>
More information about the llvm-commits
mailing list