r245076 - Windows ARM: ignore calling conventions as described on MSDN
Martell Malone via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 14 11:00:10 PDT 2015
Author: martell
Date: Fri Aug 14 13:00:09 2015
New Revision: 245076
URL: http://llvm.org/viewvc/llvm-project?rev=245076&view=rev
Log:
Windows ARM: ignore calling conventions as described on MSDN
Summary:
MSDN says that fastcall, stdcall, thiscall, and vectorcall are all
accepted but ignored on ARM and X64.
https://msdn.microsoft.com/en-us/library/984x0h58.aspx
MSDN also says cdecl is also accepted and typically ignored
This patch brings ARM in line with how we ignore them for X64
Reviewers: rnk
Subscribers: compnerd, cfe-commits
Differential Revision: http://reviews.llvm.org/D12034
Added:
cfe/trunk/test/Parser/x64-windows-calling-convention-handling.c
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=245076&r1=245075&r2=245076&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Aug 14 13:00:09 2015
@@ -4959,6 +4959,19 @@ public:
BuiltinVaListKind getBuiltinVaListKind() const override {
return TargetInfo::CharPtrBuiltinVaList;
}
+ CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
+ switch (CC) {
+ case CC_X86StdCall:
+ case CC_X86ThisCall:
+ case CC_X86FastCall:
+ case CC_X86VectorCall:
+ return CCCR_Ignore;
+ case CC_C:
+ return CCCR_OK;
+ default:
+ return CCCR_Warning;
+ }
+ }
};
// Windows ARM + Itanium C++ ABI Target
Modified: cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c?rev=245076&r1=245075&r2=245076&view=diff
==============================================================================
--- cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c (original)
+++ cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c Fri Aug 14 13:00:09 2015
@@ -1,10 +1,9 @@
// RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only -verify %s
-int __cdecl cdecl(int a, int b, int c, int d) { // expected-warning {{calling convention '__cdecl' ignored for this target}}
+int __cdecl cdecl(int a, int b, int c, int d) { // expected-no-diagnostics
return a + b + c + d;
}
-float __stdcall stdcall(float a, float b, float c, float d) { // expected-warning {{calling convention '__stdcall' ignored for this target}}
+float __stdcall stdcall(float a, float b, float c, float d) { // expected-no-diagnostics
return a + b + c + d;
}
-
Added: cfe/trunk/test/Parser/x64-windows-calling-convention-handling.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/x64-windows-calling-convention-handling.c?rev=245076&view=auto
==============================================================================
--- cfe/trunk/test/Parser/x64-windows-calling-convention-handling.c (added)
+++ cfe/trunk/test/Parser/x64-windows-calling-convention-handling.c Fri Aug 14 13:00:09 2015
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple x86_64-windows -fms-compatibility -fsyntax-only -verify %s
+
+int __cdecl cdecl(int a, int b, int c, int d) { // expected-no-diagnostics
+ return a + b + c + d;
+}
+
+float __stdcall stdcall(float a, float b, float c, float d) { // expected-no-diagnostics
+ return a + b + c + d;
+}
More information about the cfe-commits
mailing list