martell updated this revision to Diff 32164. martell added a comment. updated to reflect rnk comments
http://reviews.llvm.org/D12034 Files: lib/Basic/Targets.cpp test/Parser/arm-windows-calling-convention-handling.c test/Parser/x64-windows-calling-convention-handling.c Index: test/Parser/x64-windows-calling-convention-handling.c =================================================================== --- /dev/null +++ test/Parser/x64-windows-calling-convention-handling.c @@ -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; +} Index: test/Parser/arm-windows-calling-convention-handling.c =================================================================== --- test/Parser/arm-windows-calling-convention-handling.c +++ test/Parser/arm-windows-calling-convention-handling.c @@ -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; } - Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -4959,6 +4959,19 @@ 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
Index: test/Parser/x64-windows-calling-convention-handling.c =================================================================== --- /dev/null +++ test/Parser/x64-windows-calling-convention-handling.c @@ -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; +} Index: test/Parser/arm-windows-calling-convention-handling.c =================================================================== --- test/Parser/arm-windows-calling-convention-handling.c +++ test/Parser/arm-windows-calling-convention-handling.c @@ -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; } - Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -4959,6 +4959,19 @@ 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
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits