aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-09-30 18:28:58 -0700
committerSam Clegg <sbc@chromium.org>2022-10-03 08:31:52 -0700
commit664a5c6d03f33e69e4a7d98d9bc51017877b61ad (patch)
treeccb1a99f6db5943e7078c84adf3b9e1b8c52384d /llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
parentf8d081c1a51c53f356c1871d3fdb499a4fd5bbdf (diff)
downloadllvm-664a5c6d03f33e69e4a7d98d9bc51017877b61ad.zip
llvm-664a5c6d03f33e69e4a7d98d9bc51017877b61ad.tar.gz
llvm-664a5c6d03f33e69e4a7d98d9bc51017877b61ad.tar.bz2
[WebAssembly] Fix return type of __builtin_return_address under wasm64
Differential Revision: https://reviews.llvm.org/D135005
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
index 0b3e534..4fe339c 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
@@ -71,6 +71,7 @@ enum RuntimeLibcallSignature {
i64_i64_func_i64_i64_i64_i64_iPTR,
i64_i64_i64_i64_func_i64_i64_i64_i64,
i64_i64_func_i64_i64_i32,
+ iPTR_func_i32,
iPTR_func_iPTR_i32_iPTR,
iPTR_func_iPTR_iPTR_iPTR,
f32_func_f32_f32_f32,
@@ -329,7 +330,7 @@ struct RuntimeLibcallSignatureTable {
Table[RTLIB::STACKPROTECTOR_CHECK_FAIL] = func;
// Return address handling
- Table[RTLIB::RETURN_ADDRESS] = i32_func_i32;
+ Table[RTLIB::RETURN_ADDRESS] = iPTR_func_i32;
// Element-wise Atomic memory
// TODO: Fix these when we implement atomic support
@@ -785,6 +786,10 @@ void llvm::getLibcallSignature(const WebAssemblySubtarget &Subtarget,
Params.push_back(wasm::ValType::I64);
Params.push_back(wasm::ValType::I32);
break;
+ case iPTR_func_i32:
+ Rets.push_back(PtrTy);
+ Params.push_back(wasm::ValType::I32);
+ break;
case iPTR_func_iPTR_i32_iPTR:
Rets.push_back(PtrTy);
Params.push_back(PtrTy);