diff options
| author | Anders Carlsson <andersca@mac.com> | 2010-01-02 01:01:18 +0000 |
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2010-01-02 01:01:18 +0000 |
| commit | e36a6b3e44915d1305fa578b16ed0d815ec1b19c (patch) | |
| tree | c926efc1be678dc96621d09c6288cc37c87d6083 /clang/lib/CodeGen/CodeGenFunction.cpp | |
| parent | 2e4be2c34042d2f0150a0c92f091043580a8cbaf (diff) | |
| download | bcm5719-llvm-e36a6b3e44915d1305fa578b16ed0d815ec1b19c.tar.gz bcm5719-llvm-e36a6b3e44915d1305fa578b16ed0d815ec1b19c.zip | |
Correctly pass VTT parameters to constructors and destructors. The VTTs aren't yet used in the ctors/dtors, but that will follow.
llvm-svn: 92409
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index f904f043caa..7999721e2ca 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -230,26 +230,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, } } -static bool NeedsVTTParameter(GlobalDecl GD) { - const CXXMethodDecl *MD = cast<CXXMethodDecl>(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<CXXConstructorDecl>(MD) && GD.getCtorType() == Ctor_Base) - return true; - - // Check if we have a base destructor. - if (isa<CXXDestructorDecl>(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<FunctionDecl>(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 = |

