]> granicus.if.org Git - clang/commitdiff
Basic: support PreserveMost and PreserveAll on Windows ARM
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 20 Mar 2018 17:33:26 +0000 (17:33 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 20 Mar 2018 17:33:26 +0000 (17:33 +0000)
Do not ignore these calling conventions on Windows ARM.  They are used
by the swift runtime for certain calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328007 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/ARM.cpp
test/CodeGen/preserve-call-conv.c
test/Sema/preserve-call-conv.c

index e946558759a578bc83c656b703b8544462e9e7e9..736c235745b0cf7cdbdca61df78e4144a034b630 100644 (file)
@@ -971,6 +971,8 @@ WindowsARMTargetInfo::checkCallingConvention(CallingConv CC) const {
     return CCCR_Ignore;
   case CC_C:
   case CC_OpenCLKernel:
+  case CC_PreserveMost:
+  case CC_PreserveAll:
     return CCCR_OK;
   default:
     return CCCR_Warning;
index 2dff34e62ddf858acce24bf586f7016ba3e23481..7a84fa2823140153e1d1c147d8803c53c62dc3e1 100644 (file)
@@ -3,6 +3,7 @@
 
 // RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
 // 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
 
 // Check that the preserve_most calling convention attribute at the source level
 // is lowered to the corresponding calling convention attrribute at the LLVM IR
index 6bd049ffdca294dfbf93b2e2b55cfccd39dbf36a..6add3095c667fe5d961ba627a88651c0148ace85 100644 (file)
@@ -2,6 +2,7 @@
 // RUN: %clang_cc1 %s -fsyntax-only -triple arm64-unknown-unknown -verify
 // RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-windows-msvc -verify
 // RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-unknown-windows-msvc -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple thumbv7-unknown-windows-msvc -verify
 
 typedef void typedef_fun_t(int);