summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2019-04-29 21:09:44 +0000
committerDan Gohman <dan433584@gmail.com>2019-04-29 21:09:44 +0000
commit8306cb5702b3f3b74cafafd95dda9122e456976f (patch)
treea1f56a2deff25d94732892cede6d161a2861e1e9 /llvm/lib/Target/WebAssembly
parent728e139700889dca8378fd02cd72b6e826ca6362 (diff)
downloadbcm5719-llvm-8306cb5702b3f3b74cafafd95dda9122e456976f.tar.gz
bcm5719-llvm-8306cb5702b3f3b74cafafd95dda9122e456976f.zip
[WebAssembly] Define the signature for __stack_chk_fail
The WebAssembly backend needs to know the signatures of all runtime libcall functions. This adds the signature for __stack_chk_fail which was previously missing. Also, make the error message for a missing libcall include the name of the function. Differential Revision: https://reviews.llvm.org/D59521 Reviewed By: sbc100 llvm-svn: 359505
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
index fbdf9c576a9..215c63c1233 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
@@ -309,6 +309,9 @@ struct RuntimeLibcallSignatureTable {
Table[RTLIB::MEMSET] = iPTR_func_iPTR_i32_iPTR;
Table[RTLIB::MEMMOVE] = iPTR_func_iPTR_iPTR_iPTR;
+ // __stack_chk_fail
+ Table[RTLIB::STACKPROTECTOR_CHECK_FAIL] = func;
+
// Element-wise Atomic memory
// TODO: Fix these when we implement atomic support
Table[RTLIB::MEMCPY_ELEMENT_UNORDERED_ATOMIC_1] = unsupported;
@@ -837,6 +840,11 @@ void llvm::getLibcallSignature(const WebAssemblySubtarget &Subtarget,
SmallVectorImpl<wasm::ValType> &Params) {
auto &Map = LibcallNameMap->Map;
auto Val = Map.find(Name);
- assert(Val != Map.end() && "unexpected runtime library name");
+#ifndef NDEBUG
+ if (Val == Map.end()) {
+ errs() << "runtime library name: " << Name << "\n";
+ llvm_unreachable("unexpected runtime library name");
+ }
+#endif
return getLibcallSignature(Subtarget, Val->second, Rets, Params);
}
OpenPOWER on IntegriCloud