[PATCH] D97941: [Reland] "Do not apply calling conventions to MSVC entry points"

Elizabeth Andrews via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 4 05:48:34 PST 2021


eandrews created this revision.
eandrews added reviewers: rnk, akhuang, dmajor.
Herald added a subscriber: mstorsjo.
eandrews requested review of this revision.

This patch is a second attempt at fixing a link error for MSVC entry points when calling conventions are specified using a flag.

Calling conventions specified using flags should not be applied to MSVC entry points. The default calling convention is set in this case. The default calling convention for MSVC entry points main and wmain is __cdecl. For WinMain, wWinMain and DllMain, the default calling convention is __stdcall.

Explicitly specified calling conventions are applied to MSVC entry points.

For MinGW, the default calling convention for all MSVC entry points is __cdecl.

First attempt: 4cff1b40dacf6 <https://reviews.llvm.org/rG4cff1b40dacf6a5489b09657d94ea4757b8cd3b0> (https://reviews.llvm.org/D87701)
Revert of first attempt: bebfc3b92d5e8 <https://reviews.llvm.org/rGbebfc3b92d5e8dd1b1d75d40d5d03975957eec14>


https://reviews.llvm.org/D97941

Files:
  clang/lib/Sema/SemaDecl.cpp
  clang/test/CodeGenCXX/default_calling_conv.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97941.328137.patch
Type: text/x-patch
Size: 3648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210304/190d113d/attachment-0001.bin>


More information about the cfe-commits mailing list