Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/swift/Basic/RelativePointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ class RelativeDirectPointerIntPair {

// The value is addressed relative to `this`.
uintptr_t absolute = detail::applyRelativeOffset(this, offset);
printf("[katei in RelativeDirectPointerIntPair.getPointer] After applyRelativeOffset\n", offset);
return reinterpret_cast<PointerTy>(absolute);
}

Expand Down
17 changes: 15 additions & 2 deletions lib/SIL/TypeLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2644,12 +2644,25 @@ TypeConverter::checkFunctionForABIDifferences(SILModule &M,
return ABIDifference::NeedsThunk;
}

// There is no ABI compatibility between non-throws and throws on WebAssembly,
// so need thunk.
if (M.getASTContext().LangOpts.Target.isOSBinFormatWasm()) {
if (!fnTy1->hasErrorResult() && fnTy2->hasErrorResult()) {
return ABIDifference::NeedsThunk;
}
}

auto rep1 = fnTy1->getRepresentation(), rep2 = fnTy2->getRepresentation();
if (rep1 != rep2) {
if (rep1 == SILFunctionTypeRepresentation::Thin &&
rep2 == SILFunctionTypeRepresentation::Thick)
rep2 == SILFunctionTypeRepresentation::Thick) {
// There is no ABI compatibility between thin and think on WebAssembly,
// so need thunk.
if (M.getASTContext().LangOpts.Target.isOSBinFormatWasm()) {
return ABIDifference::NeedsThunk;
}
return ABIDifference::ThinToThick;

}
return ABIDifference::NeedsThunk;
}

Expand Down
Loading