aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
diff options
context:
space:
mode:
authorAndy Wingo <wingo@igalia.com>2021-01-05 11:05:18 +0100
committerAndy Wingo <wingo@igalia.com>2021-01-19 09:32:45 +0100
commit418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1 (patch)
treef3d6011995253f49392ff11db261b3e65910fd4b /llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
parentb86e7ae66cb988dda33445c29fa64f93e7ca9c3c (diff)
downloadllvm-418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1.zip
llvm-418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1.tar.gz
llvm-418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1.tar.bz2
[WebAssembly] call_indirect issues table number relocs
This patch changes to make call_indirect explicitly refer to the corresponding function table, residualizing TABLE_NUMBER relocs against it. With this change, wasm-ld now sees all references to tables, and can link multiple tables. Differential Revision: https://reviews.llvm.org/D90948
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
index 86d59ef..8923ecb 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -161,6 +161,8 @@ MCOperand WebAssemblyMCInstLower::lowerSymbolOperand(const MachineOperand &MO,
report_fatal_error("Global indexes with offsets not supported");
if (WasmSym->isEvent())
report_fatal_error("Event indexes with offsets not supported");
+ if (WasmSym->isTable())
+ report_fatal_error("Table indexes with offsets not supported");
Expr = MCBinaryExpr::createAdd(
Expr, MCConstantExpr::create(MO.getOffset(), Ctx), Ctx);
@@ -259,7 +261,7 @@ void WebAssemblyMCInstLower::lower(const MachineInstr *MI,
// return_call_indirect instructions have the return type of the
// caller
- if (MI->getOpcode() == WebAssembly::RET_CALL_INDIRECT)
+ if (WebAssembly::isRetCallIndirect(MI->getOpcode()))
getFunctionReturns(MI, Returns);
MCOp = lowerTypeIndexOperand(std::move(Returns), std::move(Params));