[PATCH] D71823: Support Swift calling convention for WebAssembly targets

Yuta Saito via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 22 17:26:54 PST 2019


kateinoigakukun created this revision.
Herald added subscribers: cfe-commits, sunfish, aheejin, jgravelle-google, sbc100, dschuff.
Herald added a project: clang.

Support Swift calling convention for WebAssembly targets

This adds basic support for the Swift calling convention with WebAssembly targets.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71823

Files:
  clang/lib/Basic/Targets/WebAssembly.h


Index: clang/lib/Basic/Targets/WebAssembly.h
===================================================================
--- clang/lib/Basic/Targets/WebAssembly.h
+++ clang/lib/Basic/Targets/WebAssembly.h
@@ -114,6 +114,16 @@
                ? (IsSigned ? SignedLongLong : UnsignedLongLong)
                : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
   }
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
+    switch (CC) {
+    case CC_C:
+    case CC_Swift:
+      return CCCR_OK;
+    default:
+      return CCCR_Warning;
+    }
+  }
 };
 class LLVM_LIBRARY_VISIBILITY WebAssembly32TargetInfo
     : public WebAssemblyTargetInfo {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71823.235084.patch
Type: text/x-patch
Size: 675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191223/c5e0a347/attachment.bin>


More information about the cfe-commits mailing list