[PATCH] D25204: Register Calling Convention, Clang changes

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 09:50:40 PDT 2016


rnk added inline comments.


================
Comment at: include/clang/Basic/AttrDocs.td:1263
+On x86 targets, this attribute changes the calling convention to
+__regcall convention. This convention aims to pass as many arguments
+as possible in registers. It also tries to utilize registers for the
----------------
If you want `__regcall` to appear as a link, you want to put backticks and around it and underscore after it, like is done for __fastcall above:
  `__regcall`_


================
Comment at: include/clang/Basic/AttrDocs.td:1265
+as possible in registers. It also tries to utilize registers for the
+return value whenever it is possible.'
+
----------------
I don't think you need this trailing single quote.


================
Comment at: lib/AST/MicrosoftMangle.cpp:2006
   //                      ::= J # __export __fastcall
   //                      ::= Q # __vectorcall
   // The 'export' calling conventions are from a bygone era
----------------
Update the EBNF comment


================
Comment at: lib/CodeGen/TargetInfo.cpp:3324
+  for (const auto *FD : RT->getDecl()->fields()) {
+    if (FD->getType()->isStructureType()) {
+      if (classifyRegCallStructTypeImpl(FD->getType(), NeededInt, NeededSSE)
----------------
This will return false for class fields, which I don't think you want. You probably want to do this for record types that aren't unions.


================
Comment at: lib/CodeGen/TargetInfo.cpp:3396
 
-    unsigned neededInt, neededSSE;
-    it->info = classifyArgumentType(it->type, freeIntRegs, neededInt,
-                                    neededSSE, IsNamedArg);
+    if (IsRegCall && it->type->isStructureType())
+      it->info = classifyRegCallStructType(it->type, NeededInt, NeededSSE);
----------------
You probably wanted isRecordType().


https://reviews.llvm.org/D25204





More information about the cfe-commits mailing list