Skip to content

Commit

Permalink
Expose arrangeCXXConstructorCall in CodeGenABITypes.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehme committed Apr 29, 2020
1 parent 5e44138 commit 12f83a2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clang/include/clang/CodeGen/CodeGenABITypes.h
Expand Up @@ -38,6 +38,7 @@ namespace llvm {

namespace clang {
class ASTContext;
class CXXConstructorDecl;
class CXXRecordDecl;
class CXXMethodDecl;
class CodeGenOptions;
Expand Down Expand Up @@ -73,6 +74,11 @@ const CGFunctionInfo &arrangeFreeFunctionCall(CodeGenModule &CGM,
FunctionType::ExtInfo info,
RequiredArgs args);

const CGFunctionInfo &arrangeCXXConstructorCall(CodeGenModule &CGM,
const CXXConstructorDecl *CD,
ArrayRef<CanQualType> argTypes,
FunctionType::ExtInfo info);

/// Returns null if the function type is incomplete and can't be lowered.
llvm::FunctionType *convertFreeFunctionType(CodeGenModule &CGM,
const FunctionDecl *FD);
Expand Down
10 changes: 10 additions & 0 deletions clang/lib/CodeGen/CGCall.cpp
Expand Up @@ -398,6 +398,16 @@ CodeGenTypes::arrangeCXXConstructorCall(const CallArgList &args,
for (const auto &Arg : args)
ArgTypes.push_back(Context.getCanonicalParamType(Arg.Ty));

return arrangeCXXConstructorCall(ArgTypes, D, CtorKind, ExtraPrefixArgs, ExtraSuffixArgs, PassProtoArgs);
}

const CGFunctionInfo &
CodeGenTypes::arrangeCXXConstructorCall(ArrayRef<CanQualType> ArgTypes,
const CXXConstructorDecl *D,
CXXCtorType CtorKind,
unsigned ExtraPrefixArgs,
unsigned ExtraSuffixArgs,
bool PassProtoArgs) {
// +1 for implicit this, which should always be args[0].
unsigned TotalPrefixArgs = 1 + ExtraPrefixArgs;

Expand Down
9 changes: 9 additions & 0 deletions clang/lib/CodeGen/CodeGenABITypes.cpp
Expand Up @@ -63,6 +63,15 @@ CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM,
info, {}, args);
}

const CGFunctionInfo &
CodeGen::arrangeCXXConstructorCall(CodeGenModule &CGM,
const CXXConstructorDecl *CD,
ArrayRef<CanQualType> argTypes,
FunctionType::ExtInfo info) {
return CGM.getTypes().arrangeCXXConstructorCall(argTypes, CD, Ctor_Complete, 0, 0);
}


llvm::FunctionType *
CodeGen::convertFreeFunctionType(CodeGenModule &CGM, const FunctionDecl *FD) {
assert(FD != nullptr && "Expected a non-null function declaration!");
Expand Down
6 changes: 6 additions & 0 deletions clang/lib/CodeGen/CodeGenTypes.h
Expand Up @@ -244,6 +244,12 @@ class CodeGenTypes {
unsigned ExtraPrefixArgs,
unsigned ExtraSuffixArgs,
bool PassProtoArgs = true);
const CGFunctionInfo &arrangeCXXConstructorCall(ArrayRef<CanQualType> ArgTypes,
const CXXConstructorDecl *D,
CXXCtorType CtorKind,
unsigned ExtraPrefixArgs,
unsigned ExtraSuffixArgs,
bool PassProtoArgs = true);

const CGFunctionInfo &arrangeCXXMethodCall(const CallArgList &args,
const FunctionProtoType *type,
Expand Down

0 comments on commit 12f83a2

Please sign in to comment.