Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit c78bf87

Browse files
zhuoweiMaxDesiatov
authored andcommitted
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 fadd045 commit c78bf87

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
@@ -114,6 +114,16 @@ class LLVM_LIBRARY_VISIBILITY WebAssemblyTargetInfo : public TargetInfo {
114114
? (IsSigned ? SignedLongLong : UnsignedLongLong)
115115
: TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
116116
}
117+
118+
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
119+
switch (CC) {
120+
case CC_C:
121+
case CC_Swift:
122+
return CCCR_OK;
123+
default:
124+
return CCCR_Warning;
125+
}
126+
}
117127
};
118128
class LLVM_LIBRARY_VISIBILITY WebAssembly32TargetInfo
119129
: public WebAssemblyTargetInfo {

0 commit comments

Comments
 (0)