[PATCH] D107547: [CodeGen] Align calling convention bit-width to bitcode

Xinglong Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 5 02:47:18 PDT 2021


Xinglong created this revision.
Xinglong added reviewers: rudkx, rjmccall, rsmith.
Xinglong added a project: clang.
Xinglong requested review of this revision.
Herald added a subscriber: cfe-commits.

According to https://reveiws.llvm.org/D13826, bitcode use 10 bits to represent calling convention ID, but for clang codegen, we only have 8 bits. so if we use a calling convention ID greater than 255, clang will truncate it, and bitcode will get an error calling convention ID.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107547

Files:
  clang/include/clang/CodeGen/CGFunctionInfo.h


Index: clang/include/clang/CodeGen/CGFunctionInfo.h
===================================================================
--- clang/include/clang/CodeGen/CGFunctionInfo.h
+++ clang/include/clang/CodeGen/CGFunctionInfo.h
@@ -552,14 +552,14 @@
 
   /// The LLVM::CallingConv to use for this function (as specified by the
   /// user).
-  unsigned CallingConvention : 8;
+  unsigned CallingConvention : 10;
 
   /// The LLVM::CallingConv to actually use for this function, which may
   /// depend on the ABI.
-  unsigned EffectiveCallingConvention : 8;
+  unsigned EffectiveCallingConvention : 10;
 
   /// The clang::CallingConv that this was originally created with.
-  unsigned ASTCallingConvention : 6;
+  unsigned ASTCallingConvention : 10;
 
   /// Whether this is an instance method.
   unsigned InstanceMethod : 1;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107547.364390.patch
Type: text/x-patch
Size: 818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210805/49ce95dd/attachment.bin>


More information about the cfe-commits mailing list