diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp index f3ee6e70822..c13dd7a48a7 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp @@ -703,8 +703,12 @@ bool WebAssemblyFastISel::fastLowerArguments() { for (auto const &Arg : F->args()) MFI->addParam(getLegalType(getSimpleType(Arg.getType()))); - if (!F->getReturnType()->isVoidTy()) - MFI->addResult(getLegalType(getSimpleType(F->getReturnType()))); + if (!F->getReturnType()->isVoidTy()) { + MVT::SimpleValueType RetTy = getSimpleType(F->getReturnType()); + if (RetTy == MVT::INVALID_SIMPLE_VALUE_TYPE) + return false; + MFI->addResult(getLegalType(RetTy)); + } return true; } |