diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp index b5e6e0d..7c08650 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp @@ -196,7 +196,8 @@ void CodeGenModule::EmitCXXConstructor(const CXXConstructorDecl *ctor, GlobalDecl(ctor, Ctor_Base))) return; - const CGFunctionInfo &fnInfo = getTypes().getFunctionInfo(ctor, ctorType); + const CGFunctionInfo &fnInfo = + getTypes().arrangeCXXConstructorDeclaration(ctor, ctorType); llvm::Function *fn = cast<llvm::Function>(GetAddrOfCXXConstructor(ctor, ctorType, &fnInfo)); @@ -218,11 +219,10 @@ CodeGenModule::GetAddrOfCXXConstructor(const CXXConstructorDecl *ctor, if (llvm::GlobalValue *existing = GetGlobalValue(name)) return existing; - if (!fnInfo) fnInfo = &getTypes().getFunctionInfo(ctor, ctorType); + if (!fnInfo) + fnInfo = &getTypes().arrangeCXXConstructorDeclaration(ctor, ctorType); - const FunctionProtoType *proto = ctor->getType()->castAs<FunctionProtoType>(); - llvm::FunctionType *fnType = - getTypes().GetFunctionType(*fnInfo, proto->isVariadic()); + llvm::FunctionType *fnType = getTypes().GetFunctionType(*fnInfo); return cast<llvm::Function>(GetOrCreateLLVMFunction(name, fnType, GD, /*ForVTable=*/false)); } @@ -260,7 +260,8 @@ void CodeGenModule::EmitCXXDestructor(const CXXDestructorDecl *dtor, if (dtorType == Dtor_Base && !TryEmitBaseDestructorAsAlias(dtor)) return; - const CGFunctionInfo &fnInfo = getTypes().getFunctionInfo(dtor, dtorType); + const CGFunctionInfo &fnInfo = + getTypes().arrangeCXXDestructor(dtor, dtorType); llvm::Function *fn = cast<llvm::Function>(GetAddrOfCXXDestructor(dtor, dtorType, &fnInfo)); @@ -282,11 +283,9 @@ CodeGenModule::GetAddrOfCXXDestructor(const CXXDestructorDecl *dtor, if (llvm::GlobalValue *existing = GetGlobalValue(name)) return existing; - if (!fnInfo) fnInfo = &getTypes().getFunctionInfo(dtor, dtorType); - - llvm::FunctionType *fnType = - getTypes().GetFunctionType(*fnInfo, false); + if (!fnInfo) fnInfo = &getTypes().arrangeCXXDestructor(dtor, dtorType); + llvm::FunctionType *fnType = getTypes().GetFunctionType(*fnInfo); return cast<llvm::Function>(GetOrCreateLLVMFunction(name, fnType, GD, /*ForVTable=*/false)); } @@ -359,12 +358,10 @@ CodeGenFunction::BuildAppleKextVirtualDestructorCall( // -O does that. But need to support -O0 as well. if (MD->isVirtual() && Type != Dtor_Base) { // Compute the function type we're calling. - const CGFunctionInfo *FInfo = - &CGM.getTypes().getFunctionInfo(cast<CXXDestructorDecl>(MD), - Dtor_Complete); - const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>(); - llvm::Type *Ty - = CGM.getTypes().GetFunctionType(*FInfo, FPT->isVariadic()); + const CGFunctionInfo &FInfo = + CGM.getTypes().arrangeCXXDestructor(cast<CXXDestructorDecl>(MD), + Dtor_Complete); + llvm::Type *Ty = CGM.getTypes().GetFunctionType(FInfo); llvm::Value *VTable = CGM.getVTables().GetAddrOfVTable(RD); Ty = Ty->getPointerTo()->getPointerTo(); |