Skip to content

Commit 1c7101f

Browse files
committed
Add arrangeCXXMethodCall to the CodeGenABITypes interface.
Also add ExtParameterInfos to the argument list of arrangeFreeFunctionCall.
1 parent 99c8557 commit 1c7101f

File tree

2 files changed

+37
-12
lines changed

2 files changed

+37
-12
lines changed

clang/include/clang/CodeGen/CodeGenABITypes.h

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

78-
const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM,
79-
CanQualType returnType,
80-
ArrayRef<CanQualType> argTypes,
81-
FunctionType::ExtInfo info,
82-
RequiredArgs args);
78+
const CGFunctionInfo &arrangeCXXMethodCall(
79+
CodeGenModule &CGM, CanQualType returnType, ArrayRef<CanQualType> argTypes,
80+
FunctionType::ExtInfo info,
81+
ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos,
82+
RequiredArgs args);
83+
84+
const CGFunctionInfo &arrangeFreeFunctionCall(
85+
CodeGenModule &CGM, CanQualType returnType, ArrayRef<CanQualType> argTypes,
86+
FunctionType::ExtInfo info,
87+
ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos,
88+
RequiredArgs args);
89+
90+
// An overload with an empty `paramInfos`
91+
inline const CGFunctionInfo &arrangeFreeFunctionCall(
92+
CodeGenModule &CGM, CanQualType returnType, ArrayRef<CanQualType> argTypes,
93+
FunctionType::ExtInfo info,
94+
RequiredArgs args) {
95+
return arrangeFreeFunctionCall(CGM, returnType, argTypes, info, {}, args);
96+
}
8397

8498
/// Returns the implicit arguments to add to a complete, non-delegating C++
8599
/// constructor call.

clang/lib/CodeGen/CodeGenABITypes.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,24 @@ CodeGen::arrangeCXXMethodType(CodeGenModule &CGM,
6060
}
6161

6262
const CGFunctionInfo &
63-
CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM,
64-
CanQualType returnType,
65-
ArrayRef<CanQualType> argTypes,
66-
FunctionType::ExtInfo info,
67-
RequiredArgs args) {
68-
return CGM.getTypes().arrangeLLVMFunctionInfo(returnType, FnInfoOpts::None,
69-
argTypes, info, {}, args);
63+
CodeGen::arrangeCXXMethodCall(
64+
CodeGenModule &CGM, CanQualType returnType, ArrayRef<CanQualType> argTypes,
65+
FunctionType::ExtInfo info,
66+
ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos,
67+
RequiredArgs args) {
68+
return CGM.getTypes().arrangeLLVMFunctionInfo(
69+
returnType, FnInfoOpts::IsInstanceMethod, argTypes, info, paramInfos,
70+
args);
71+
}
72+
73+
const CGFunctionInfo &
74+
CodeGen::arrangeFreeFunctionCall(
75+
CodeGenModule &CGM, CanQualType returnType, ArrayRef<CanQualType> argTypes,
76+
FunctionType::ExtInfo info,
77+
ArrayRef<FunctionProtoType::ExtParameterInfo> paramInfos,
78+
RequiredArgs args) {
79+
return CGM.getTypes().arrangeLLVMFunctionInfo(
80+
returnType, FnInfoOpts::None, argTypes, info, paramInfos, args);
7081
}
7182

7283
ImplicitCXXConstructorArgs

0 commit comments

Comments
 (0)