https://github.com/hjyamauchi created https://github.com/llvm/llvm-project/pull/111597
In MSVC, the calling conventions for free functions and C++ instance methods could be different, it makes sense to have this variant there. >From 7be9488cc36596788ea6a1b979cb028e3c28e961 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi <hjyamau...@gmail.com> Date: Tue, 8 Oct 2024 15:16:06 -0700 Subject: [PATCH] Add arrangeCXXMethodCall to the CodeGenABITypes interface. In MSVC, the calling conventions for free functions and C++ instance methods could be different, it makes sense to have this variant there. --- clang/include/clang/CodeGen/CodeGenABITypes.h | 6 ++++++ clang/lib/CodeGen/CodeGenABITypes.cpp | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/clang/include/clang/CodeGen/CodeGenABITypes.h b/clang/include/clang/CodeGen/CodeGenABITypes.h index 9cbc5a8a2a3f41..3d29c45cf0cf1b 100644 --- a/clang/include/clang/CodeGen/CodeGenABITypes.h +++ b/clang/include/clang/CodeGen/CodeGenABITypes.h @@ -75,6 +75,12 @@ const CGFunctionInfo &arrangeCXXMethodType(CodeGenModule &CGM, const FunctionProtoType *FTP, const CXXMethodDecl *MD); +const CGFunctionInfo &arrangeCXXMethodCall(CodeGenModule &CGM, + CanQualType returnType, + ArrayRef<CanQualType> argTypes, + FunctionType::ExtInfo info, + RequiredArgs args); + const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM, CanQualType returnType, ArrayRef<CanQualType> argTypes, diff --git a/clang/lib/CodeGen/CodeGenABITypes.cpp b/clang/lib/CodeGen/CodeGenABITypes.cpp index a6073e1188d6fa..283aa8425867ab 100644 --- a/clang/lib/CodeGen/CodeGenABITypes.cpp +++ b/clang/lib/CodeGen/CodeGenABITypes.cpp @@ -59,6 +59,17 @@ CodeGen::arrangeCXXMethodType(CodeGenModule &CGM, return CGM.getTypes().arrangeCXXMethodType(RD, FTP, MD); } +const CGFunctionInfo & +CodeGen::arrangeCXXMethodCall(CodeGenModule &CGM, + CanQualType returnType, + ArrayRef<CanQualType> argTypes, + FunctionType::ExtInfo info, + RequiredArgs args) { + return CGM.getTypes().arrangeLLVMFunctionInfo(returnType, + FnInfoOpts::IsInstanceMethod, + argTypes, info, {}, args); +} + const CGFunctionInfo & CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM, CanQualType returnType, _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits