From c997d4278d329e18891aac9698fb991b2d4622eb Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 2 Jan 2010 01:01:18 +0000 Subject: Correctly pass VTT parameters to constructors and destructors. The VTTs aren't yet used in the ctors/dtors, but that will follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92409 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index f904f043ca..7999721e2c 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -230,26 +230,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, } } -static bool NeedsVTTParameter(GlobalDecl GD) { - const CXXMethodDecl *MD = cast(GD.getDecl()); - - // We don't have any virtual bases, just return early. - if (!MD->getParent()->getNumVBases()) - return false; - - // Check if we have a base constructor. - if (isa(MD) && GD.getCtorType() == Ctor_Base) - return true; - - // Check if we have a base destructor. - if (isa(MD) && GD.getDtorType() == Dtor_Base) - return true; - - return false; -} - -void CodeGenFunction::GenerateCode(GlobalDecl GD, - llvm::Function *Fn) { +void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn) { const FunctionDecl *FD = cast(GD.getDecl()); // Check if we should generate debug info for this function. @@ -271,7 +252,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, Args.push_back(std::make_pair(CXXThisDecl, CXXThisDecl->getType())); // Check if we need a VTT parameter as well. - if (NeedsVTTParameter(GD)) { + if (CGVtableInfo::needsVTTParameter(GD)) { // FIXME: The comment about using a fake decl above applies here too. QualType T = getContext().getPointerType(getContext().VoidPtrTy); CXXVTTDecl = -- cgit v1.2.3-18-g5258