From db14a73606fb85ce85b5408ba384c3839af73325 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Sat, 5 Sep 2009 08:07:32 +0000 Subject: [PATCH] Cleanups. llvm-svn: 81071 --- clang/lib/CodeGen/CGCXX.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index 5095b04ab4b6..7d2866aeaa59 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -1080,7 +1080,7 @@ public: int64_t GenerateVtableForBase(const CXXRecordDecl *RD, bool forPrimary, bool Bottom, bool MorallyVirtual, int64_t Offset, bool ForVirtualBase) { - if (RD && !RD->isDynamicClass()) + if (!RD->isDynamicClass()) return 0; const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD); @@ -1118,8 +1118,7 @@ public: MorallyVirtual, Offset, ForVirtualBase); } - void GenerateVtableForVBases(const CXXRecordDecl *RD, - const CXXRecordDecl *Class) { + void GenerateVtableForVBases(const CXXRecordDecl *RD) { for (CXXRecordDecl::base_class_const_iterator i = RD->bases_begin(), e = RD->bases_end(); i != e; ++i) { const CXXRecordDecl *Base = @@ -1135,7 +1134,7 @@ public: InstallThunks(AP); } if (Base->getNumVBases()) - GenerateVtableForVBases(Base, Class); + GenerateVtableForVBases(Base); } } }; @@ -1165,7 +1164,7 @@ public: std::vector methods; VtableBuilder b(methods, RD, CGM); b.GenerateVtableForBase(RD, true, true, false, 0, false); - b.GenerateVtableForVBases(RD, RD); + b.GenerateVtableForVBases(RD); register_index(RD, b.getIndex()); I = IndexFor.find(RD); } @@ -1195,7 +1194,7 @@ llvm::Value *CodeGenFunction::GenerateVtable(const CXXRecordDecl *RD) { Offset = b.GenerateVtableForBase(RD, true, true, false, 0, false); // then the vtables for all the virtual bases. - b.GenerateVtableForVBases(RD, RD); + b.GenerateVtableForVBases(RD); llvm::Constant *C; llvm::ArrayType *type = llvm::ArrayType::get(Ptr8Ty, methods.size());