diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 14:01:31 +0000 |
commit | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch) | |
tree | be1815eb79b42ff482a8562b13c2dcbf0c5dcbee /lib/CodeGen/CGCXX.cpp | |
parent | dc04cb328508e61aad809d9b53b12f9799a00e7d (diff) | |
download | FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz |
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
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<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(); |