Skip to content

Commit

Permalink
Merge pull request swiftlang#254 from kateinoigakukun/katei/fix-thin-…
Browse files Browse the repository at this point in the history
…to-thick-thunk

[WASM] Skip thunk generation for throws func
  • Loading branch information
kateinoigakukun authored Feb 27, 2020
2 parents 1f2042b + a4c2dd7 commit e9f0bda
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/IRGen/IRGenSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4756,10 +4756,9 @@ getLoweredFunctionPointer(IRGenSILFunction &IGF, SILValue v) {

void IRGenSILFunction::visitThinToThickFunctionInst(
swift::ThinToThickFunctionInst *i) {

if (IGM.TargetInfo.OutputObjectFormat == llvm::Triple::Wasm) {
auto fn = getLoweredFunctionPointer(*this, i->getCallee());
auto fnTy = i->getCallee()->getType().castTo<SILFunctionType>();
auto fn = getLoweredFunctionPointer(*this, i->getCallee());
auto fnTy = i->getCallee()->getType().castTo<SILFunctionType>();
if (IGM.TargetInfo.OutputObjectFormat == llvm::Triple::Wasm && !fnTy->hasErrorResult()) {
Optional<FunctionPointer> staticFn;
if (fn.isConstant()) staticFn = fn;
auto thunkFn = getThinToThickForwarder(IGM, staticFn, fnTy);
Expand Down

0 comments on commit e9f0bda

Please sign in to comment.