+ // Record the number and types of the return values.
+ for (const ISD::OutputArg &Out : Outs) {
+ if (Out.Flags.isZExt())
+ fail(DL, DAG, "WebAssembly hasn't implemented zext results");
+ if (Out.Flags.isSExt())
+ fail(DL, DAG, "WebAssembly hasn't implemented sext results");
+ if (Out.Flags.isInReg())
+ fail(DL, DAG, "WebAssembly hasn't implemented inreg results");
+ if (Out.Flags.isSRet())
+ fail(DL, DAG, "WebAssembly hasn't implemented sret results");
+ if (Out.Flags.isByVal())
+ fail(DL, DAG, "WebAssembly hasn't implemented byval results");
+ if (Out.Flags.isInAlloca())
+ fail(DL, DAG, "WebAssembly hasn't implemented inalloca results");
+ if (Out.Flags.isNest())
+ fail(DL, DAG, "WebAssembly hasn't implemented nest results");
+ if (Out.Flags.isReturned())
+ fail(DL, DAG, "WebAssembly hasn't implemented returned results");
+ if (Out.Flags.isInConsecutiveRegs())
+ fail(DL, DAG, "WebAssembly hasn't implemented cons regs results");
+ if (Out.Flags.isInConsecutiveRegsLast())
+ fail(DL, DAG, "WebAssembly hasn't implemented cons regs last results");
+ if (!Out.IsFixed)
+ fail(DL, DAG, "WebAssembly doesn't support non-fixed results yet");
+ MF.getInfo<WebAssemblyFunctionInfo>()->addResult(Out.VT);
+ }
+