[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
Mon Mar 8 12:31:13 PST 2021


eandrews added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:11206-11207
+    } else if (FT->getCallConv() != CC_X86StdCall) {
+      // Default calling convention for WinMain, wWinMain and DllMain is
+      // __stdcall
+      FT = Context.adjustFunctionType(
----------------
rnk wrote:
> This should only be done on 32-bit x86 platforms. I think i686-window-msvc is the more special case platform here, so I would recommend making the helper something like `isDefaultStdCall`, which is true for i686-windows-msvc, false for mingw and non-x86 triples, and false for main/wmain.
Thanks for the review @rnk! I think I made the change you requested. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97941/new/

https://reviews.llvm.org/D97941



More information about the cfe-commits mailing list