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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 4 11:18:24 PST 2021


rnk added a comment.

Seems reasonable



================
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(
----------------
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.


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

https://reviews.llvm.org/D97941



More information about the cfe-commits mailing list