[llvm] [WebAssembly] Print type signature and table for call_indirect (PR #179120)
Heejin Ahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 13 20:39:50 PST 2026
================
@@ -59,17 +68,17 @@ void WebAssemblyInstPrinter::printInst(const MCInst *MI, uint64_t Address,
OS << "\t";
OS << getMnemonic(*MI).first;
OS << " ";
-
- assert(MI->getNumOperands() == 2);
- const unsigned TypeOperand = 0;
- const unsigned TableOperand = 1;
if (MI->getOperand(TableOperand).isExpr()) {
- printOperand(MI, TableOperand, OS);
- OS << ", ";
+ if (STI.checkFeatures("+reference-types")) {
+ printOperand(MI, TableOperand, OS);
+ OS << ", ";
+ }
----------------
aheejin wrote:
```suggestion
printOperand(MI, TableOperand, OS);
OS << ", ";
```
You don't need this condition. If reference-types is not enabled, `TableOperand` won't be an expression.
https://github.com/llvm/llvm-project/pull/179120
More information about the llvm-commits
mailing list