r310303 - [AArch64] Ignore stdcall and similar on aarch64/windows
Martin Storsjo via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 7 13:52:04 PDT 2017
Author: mstorsjo
Date: Mon Aug 7 13:52:04 2017
New Revision: 310303
URL: http://llvm.org/viewvc/llvm-project?rev=310303&view=rev
Log:
[AArch64] Ignore stdcall and similar on aarch64/windows
This is similar to what's done on arm and x86_64, where
these calling conventions are silently ignored, as in
SVN r245076.
Differential Revision: https://reviews.llvm.org/D36105
Modified:
cfe/trunk/lib/Basic/Targets/AArch64.cpp
cfe/trunk/lib/Basic/Targets/AArch64.h
cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
Modified: cfe/trunk/lib/Basic/Targets/AArch64.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/AArch64.cpp?rev=310303&r1=310302&r2=310303&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/AArch64.cpp (original)
+++ cfe/trunk/lib/Basic/Targets/AArch64.cpp Mon Aug 7 13:52:04 2017
@@ -458,6 +458,23 @@ MicrosoftARM64TargetInfo::getBuiltinVaLi
return TargetInfo::CharPtrBuiltinVaList;
}
+TargetInfo::CallingConvCheckResult
+MicrosoftARM64TargetInfo::checkCallingConvention(CallingConv CC) const {
+ switch (CC) {
+ case CC_X86StdCall:
+ case CC_X86ThisCall:
+ case CC_X86FastCall:
+ case CC_X86VectorCall:
+ return CCCR_Ignore;
+ case CC_C:
+ case CC_OpenCLKernel:
+ case CC_Win64:
+ return CCCR_OK;
+ default:
+ return CCCR_Warning;
+ }
+}
+
DarwinAArch64TargetInfo::DarwinAArch64TargetInfo(const llvm::Triple &Triple,
const TargetOptions &Opts)
: DarwinTargetInfo<AArch64leTargetInfo>(Triple, Opts) {
Modified: cfe/trunk/lib/Basic/Targets/AArch64.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/AArch64.h?rev=310303&r1=310302&r2=310303&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/AArch64.h (original)
+++ cfe/trunk/lib/Basic/Targets/AArch64.h Mon Aug 7 13:52:04 2017
@@ -105,6 +105,8 @@ public:
MacroBuilder &Builder) const override;
BuiltinVaListKind getBuiltinVaListKind() const override;
+
+ CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
};
class LLVM_LIBRARY_VISIBILITY AArch64beTargetInfo : public AArch64TargetInfo {
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=310303&r1=310302&r2=310303&view=diff
==============================================================================
--- cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c (original)
+++ cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c Mon Aug 7 13:52:04 2017
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple aarch64-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;
More information about the cfe-commits
mailing list