From 50b73317314e889cf39c7b1d6cbf419fa7502f22 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 14 Apr 2012 14:01:31 +0000 Subject: Vendor import of clang trunk r154661: http://llvm.org/svn/llvm-project/cfe/trunk@r154661 --- lib/CodeGen/CGCXX.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'lib/CodeGen/CGCXX.cpp') diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index b5e6e0d..7c08650 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/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(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(); - llvm::FunctionType *fnType = - getTypes().GetFunctionType(*fnInfo, proto->isVariadic()); + llvm::FunctionType *fnType = getTypes().GetFunctionType(*fnInfo); return cast(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(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(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(MD), - Dtor_Complete); - const FunctionProtoType *FPT = MD->getType()->getAs(); - llvm::Type *Ty - = CGM.getTypes().GetFunctionType(*FInfo, FPT->isVariadic()); + const CGFunctionInfo &FInfo = + CGM.getTypes().arrangeCXXDestructor(cast(MD), + Dtor_Complete); + llvm::Type *Ty = CGM.getTypes().GetFunctionType(FInfo); llvm::Value *VTable = CGM.getVTables().GetAddrOfVTable(RD); Ty = Ty->getPointerTo()->getPointerTo(); -- cgit v1.1