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

Derek Schuff via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 10:32:13 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc5bd3d07262f: Support Swift calling convention for WebAssembly targets (authored by kateinoigakukun, committed by dschuff).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71823/new/

https://reviews.llvm.org/D71823

Files:
  clang/lib/Basic/Targets/WebAssembly.h
  llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp


Index: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -672,7 +672,8 @@
          CallConv == CallingConv::PreserveMost ||
          CallConv == CallingConv::PreserveAll ||
          CallConv == CallingConv::CXX_FAST_TLS ||
-         CallConv == CallingConv::WASM_EmscriptenInvoke;
+         CallConv == CallingConv::WASM_EmscriptenInvoke ||
+         CallConv == CallingConv::Swift;
 }
 
 SDValue
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.240244.patch
Type: text/x-patch
Size: 1272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200124/9b01b42b/attachment.bin>


More information about the cfe-commits mailing list