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;
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;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits