[PATCH] D20171: Support for MSVS default calling convention options (/Gd, /Gz, /Gv, /Gr)

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 08:48:12 PDT 2016


rnk added inline comments.

================
Comment at: include/clang/Basic/LangOptions.def:220
@@ -218,3 +219,3 @@
 
 LANGOPT(MRTD , 1, 0, "-mrtd calling convention")
 BENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing")
----------------
Let's get rid of this and have it use a single DefaultCallingConv LangOpt.

================
Comment at: include/clang/Driver/CC1Options.td:613
@@ -612,1 +612,3 @@
   HelpText<"Allow function arguments and returns of type half">;
+def fms_ms_default_calling_conv_EQ : Joined<["-"], "fms-default-calling-conv=">,
+  HelpText<"Set default MS calling convention">;
----------------
Let's unify the -cc1 layer with -mrtd, and just have a single -fdefault-calling-convention=stdcall/etc flag.

================
Comment at: lib/AST/ASTContext.cpp:8610
@@ -8609,2 +8609,3 @@
 
-  return Target->getDefaultCallingConv(TargetInfo::CCMT_Unknown);
+  if (LangOpts.MSVCCompat) {
+    switch (LangOpts.getDefaultMSCallingConv()) {
----------------
I don't think we need to guard this on MSVCCompat, it'll be unset usually. It will also help us avoid a special path for MRTD.

================
Comment at: lib/AST/ASTContext.cpp:8616-8619
@@ +8615,6 @@
+      return CC_C;
+    case LangOptions::DCC_FastCall:
+      return CC_X86FastCall;
+    case LangOptions::DCC_StdCall:
+      return CC_X86StdCall;
+    case LangOptions::DCC_VectorCall:
----------------
Neither fastcall nor stdcall can be applied to variadic functions.


http://reviews.llvm.org/D20171





More information about the cfe-commits mailing list