Skip to content

Commit 4744991

Browse files
committed
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.
1 parent c6d6da4 commit 4744991

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

clang/include/clang/CodeGen/CodeGenABITypes.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ const CGFunctionInfo &arrangeCXXMethodType(CodeGenModule &CGM,
7575
const FunctionProtoType *FTP,
7676
const CXXMethodDecl *MD);
7777

78+
const CGFunctionInfo &arrangeCXXMethodCall(CodeGenModule &CGM,
79+
CanQualType returnType,
80+
ArrayRef<CanQualType> argTypes,
81+
FunctionType::ExtInfo info,
82+
RequiredArgs args);
83+
7884
const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM,
7985
CanQualType returnType,
8086
ArrayRef<CanQualType> argTypes,

clang/lib/CodeGen/CodeGenABITypes.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ CodeGen::arrangeCXXMethodType(CodeGenModule &CGM,
5959
return CGM.getTypes().arrangeCXXMethodType(RD, FTP, MD);
6060
}
6161

62+
const CGFunctionInfo &
63+
CodeGen::arrangeCXXMethodCall(CodeGenModule &CGM, CanQualType returnType,
64+
ArrayRef<CanQualType> argTypes,
65+
FunctionType::ExtInfo info, RequiredArgs args) {
66+
return CGM.getTypes().arrangeLLVMFunctionInfo(
67+
returnType, FnInfoOpts::IsInstanceMethod, argTypes, info, {}, args);
68+
}
69+
6270
const CGFunctionInfo &
6371
CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM,
6472
CanQualType returnType,

0 commit comments

Comments
 (0)