Support the Swift calling convention on Windows ARM and AArch64. Both
of these conform to the AAPCS, AAPCS64 calling convention, and LLVM has
been adjusted to account for the register usage. Ensure that the
frontend passes this into the backend. This allows the swift runtime to
be built for Windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348454
91177308-0d34-0410-b5e6-
96231b3b80d8
case CC_OpenCLKernel:
case CC_PreserveMost:
case CC_PreserveAll:
+ case CC_Swift:
case CC_Win64:
return CCCR_OK;
default:
case CC_OpenCLKernel:
case CC_PreserveMost:
case CC_PreserveAll:
+ case CC_Swift:
return CCCR_OK;
default:
return CCCR_Warning;
--- /dev/null
+// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
+
+// REQUIRES: aarch64-registered-target,arm-registered-target,x86-registered-target
+
+void __attribute__((__swiftcall__)) f(void) {}
+// CHECK-LABEL: define dso_local swiftcc void @f()
+
--- /dev/null
+// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fsyntax-only %s -verify
+// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -fsyntax-only %s -verify
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fsyntax-only %s -verify
+
+// expected-no-diagnostics
+
+void __attribute__((__swiftcall__)) f(void) {}