[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL310303: [AArch64] Ignore stdcall and similar on 
aarch64/windows (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D36105?vs=108977=110082#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36105

Files:
  cfe/trunk/lib/Basic/Targets/AArch64.cpp
  cfe/trunk/lib/Basic/Targets/AArch64.h
  cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c


Index: cfe/trunk/lib/Basic/Targets/AArch64.cpp
===
--- cfe/trunk/lib/Basic/Targets/AArch64.cpp
+++ cfe/trunk/lib/Basic/Targets/AArch64.cpp
@@ -458,6 +458,23 @@
   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 ,
  const TargetOptions )
 : DarwinTargetInfo(Triple, Opts) {
Index: cfe/trunk/lib/Basic/Targets/AArch64.h
===
--- cfe/trunk/lib/Basic/Targets/AArch64.h
+++ cfe/trunk/lib/Basic/Targets/AArch64.h
@@ -105,6 +105,8 @@
 MacroBuilder ) const override;
 
   BuiltinVaListKind getBuiltinVaListKind() const override;
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
 };
 
 class LLVM_LIBRARY_VISIBILITY AArch64beTargetInfo : public AArch64TargetInfo {
Index: cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
===
--- cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
+++ cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
@@ -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;


Index: cfe/trunk/lib/Basic/Targets/AArch64.cpp
===
--- cfe/trunk/lib/Basic/Targets/AArch64.cpp
+++ cfe/trunk/lib/Basic/Targets/AArch64.cpp
@@ -458,6 +458,23 @@
   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 ,
  const TargetOptions )
 : DarwinTargetInfo(Triple, Opts) {
Index: cfe/trunk/lib/Basic/Targets/AArch64.h
===
--- cfe/trunk/lib/Basic/Targets/AArch64.h
+++ cfe/trunk/lib/Basic/Targets/AArch64.h
@@ -105,6 +105,8 @@
 MacroBuilder ) const override;
 
   BuiltinVaListKind getBuiltinVaListKind() const override;
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
 };
 
 class LLVM_LIBRARY_VISIBILITY AArch64beTargetInfo : public AArch64TargetInfo {
Index: cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
===
--- cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
+++ cfe/trunk/test/Parser/arm-windows-calling-convention-handling.c
@@ -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;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-08-07 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment.

In https://reviews.llvm.org/D36105#834225, @mgrang wrote:

> In https://reviews.llvm.org/D36105#834007, @mstorsjo wrote:
>
> > Ping @mgrang, can you check the above with MSVC? I'd like to move forward 
> > with this in one form or another.
>
>
> Yes, I checked with MSVC for ARM64 and it compiles without any warnings.


Thanks! @rnk - is this ok then?


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-08-07 Thread Mandeep Singh Grang via Phabricator via cfe-commits
mgrang added a comment.

In https://reviews.llvm.org/D36105#834007, @mstorsjo wrote:

> Ping @mgrang, can you check the above with MSVC? I'd like to move forward 
> with this in one form or another.


Yes, I checked with MSVC for ARM64 and it compiles without any warnings.

  cl foo.c -c /W3
  Microsoft (R) C/C++ Optimizing Compiler for ARM64
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  foo.c


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment.

Ping @mgrang, can you check the above with MSVC? I'd like to move forward with 
this in one form or another.


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-08-01 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments.



Comment at: lib/Basic/Targets/AArch64.cpp:466-467
+  case CC_X86ThisCall:
+  case CC_X86FastCall:
+  case CC_X86VectorCall:
+return CCCR_Ignore;

mstorsjo wrote:
> rnk wrote:
> > Do they really ignore __fastcall and __vectorcall on arm64?
> > 
> > I assume __thiscall and __stdcall are all over various Win SDK headers, so 
> > they need to be ignored for compatibility, but I've never seen public 
> > documented APIs using __vectorcall. The STL ifdefs out those overloads, 
> > right?
> I don't have MSVC for arm64 to test with (but @mgrang does so he can check), 
> but I included them for consistency and completeness.
@mgrang - can you check whether this compiles without warnings (with e.g. 
`-W3`) on MSVC?

```
void __stdcall foo(void) {
}

void __fastcall bar(void) {
}

void __vectorcall baz(void) {
}
```

@rnk - FWIW, I checked MSVC for ARM (32 bit), and that one also ignores all of 
them without a warning.


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-07-31 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments.



Comment at: lib/Basic/Targets/AArch64.cpp:466-467
+  case CC_X86ThisCall:
+  case CC_X86FastCall:
+  case CC_X86VectorCall:
+return CCCR_Ignore;

rnk wrote:
> Do they really ignore __fastcall and __vectorcall on arm64?
> 
> I assume __thiscall and __stdcall are all over various Win SDK headers, so 
> they need to be ignored for compatibility, but I've never seen public 
> documented APIs using __vectorcall. The STL ifdefs out those overloads, right?
I don't have MSVC for arm64 to test with (but @mgrang does so he can check), 
but I included them for consistency and completeness.


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-07-31 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments.



Comment at: lib/Basic/Targets/AArch64.cpp:466-467
+  case CC_X86ThisCall:
+  case CC_X86FastCall:
+  case CC_X86VectorCall:
+return CCCR_Ignore;

Do they really ignore __fastcall and __vectorcall on arm64?

I assume __thiscall and __stdcall are all over various Win SDK headers, so they 
need to be ignored for compatibility, but I've never seen public documented 
APIs using __vectorcall. The STL ifdefs out those overloads, right?


https://reviews.llvm.org/D36105



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D36105: [AArch64] Ignore stdcall and similar on aarch64/windows

2017-07-31 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision.
Herald added subscribers: kristof.beyls, javed.absar, rengolin, aemerson.

This is similar to what's done on arm and x86_64, where these calling 
conventions are silently ignored, as in SVN r245076 
(https://reviews.llvm.org/D12034).


https://reviews.llvm.org/D36105

Files:
  lib/Basic/Targets/AArch64.cpp
  lib/Basic/Targets/AArch64.h
  test/Parser/arm-windows-calling-convention-handling.c


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,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;
Index: lib/Basic/Targets/AArch64.h
===
--- lib/Basic/Targets/AArch64.h
+++ lib/Basic/Targets/AArch64.h
@@ -105,6 +105,8 @@
 MacroBuilder ) const override;
 
   BuiltinVaListKind getBuiltinVaListKind() const override;
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
 };
 
 class LLVM_LIBRARY_VISIBILITY AArch64beTargetInfo : public AArch64TargetInfo {
Index: lib/Basic/Targets/AArch64.cpp
===
--- lib/Basic/Targets/AArch64.cpp
+++ lib/Basic/Targets/AArch64.cpp
@@ -458,6 +458,23 @@
   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 ,
  const TargetOptions )
 : DarwinTargetInfo(Triple, Opts) {


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,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;
Index: lib/Basic/Targets/AArch64.h
===
--- lib/Basic/Targets/AArch64.h
+++ lib/Basic/Targets/AArch64.h
@@ -105,6 +105,8 @@
 MacroBuilder ) const override;
 
   BuiltinVaListKind getBuiltinVaListKind() const override;
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
 };
 
 class LLVM_LIBRARY_VISIBILITY AArch64beTargetInfo : public AArch64TargetInfo {
Index: lib/Basic/Targets/AArch64.cpp
===
--- lib/Basic/Targets/AArch64.cpp
+++ lib/Basic/Targets/AArch64.cpp
@@ -458,6 +458,23 @@
   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 ,
  const TargetOptions )
 : DarwinTargetInfo(Triple, Opts) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits