Skip to content
This repository was archived by the owner on Oct 24, 2019. It is now read-only.

Commit 55d8886

Browse files
committed
WebAssembly: allow swiftcall attribute
This removes the warning when attempting to compile a swiftcall function. I'm not sure why https://reviews.llvm.org/D19414 didn't add this...
1 parent f40cbaa commit 55d8886

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Basic/Targets/WebAssembly.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyTargetInfo : public TargetInfo {
116116
? (IsSigned ? SignedLongLong : UnsignedLongLong)
117117
: TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
118118
}
119+
120+
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
121+
switch (CC) {
122+
case CC_C:
123+
case CC_Swift:
124+
return CCCR_OK;
125+
default:
126+
return CCCR_Warning;
127+
}
128+
}
119129
};
120130
class LLVM_LIBRARY_VISIBILITY WebAssembly32TargetInfo
121131
: public WebAssemblyTargetInfo {

0 commit comments

Comments
 (0)