This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Ignore stdcall and similar on aarch64/windows
ClosedPublic

Authored by mstorsjo on Jul 31 2017, 12:38 PM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 31 2017, 12:38 PM
rnk added inline comments.Jul 31 2017, 12:41 PM
lib/Basic/Targets/AArch64.cpp
466–467 ↗(On Diff #108977)

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?

mstorsjo added inline comments.Jul 31 2017, 12:45 PM
lib/Basic/Targets/AArch64.cpp
466–467 ↗(On Diff #108977)

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.

mstorsjo added inline comments.Aug 1 2017, 12:24 PM
lib/Basic/Targets/AArch64.cpp
466–467 ↗(On Diff #108977)

@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.

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

mgrang edited edge metadata.Aug 7 2017, 11:42 AM

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

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?

rnk accepted this revision.Aug 7 2017, 12:36 PM

lgtm

This revision is now accepted and ready to land.Aug 7 2017, 12:36 PM
This revision was automatically updated to reflect the committed changes.