[cfe-commits] r79423 - /cfe/trunk/lib/CodeGen/CGCXX.cpp
Mike Stump
mrs at apple.com
Wed Aug 19 07:40:48 PDT 2009
Author: mrs
Date: Wed Aug 19 09:40:47 2009
New Revision: 79423
URL: http://llvm.org/viewvc/llvm-project?rev=79423&view=rev
Log:
Cleanup: fold IndirectPrimary into builder.
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=79423&r1=79422&r2=79423&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Wed Aug 19 09:40:47 2009
@@ -708,6 +708,7 @@
llvm::Type *Ptr8Ty;
const CXXRecordDecl *Class;
const ASTRecordLayout &BLayout;
+ llvm::SmallSet<const CXXRecordDecl *, 32> IndirectPrimary;
llvm::Constant *rtti;
llvm::LLVMContext &VMContext;
CodeGenModule &CGM; // Per-module state.
@@ -766,8 +767,7 @@
bool forPrimary,
bool VBoundary,
int64_t Offset,
- bool ForVirtualBase,
- llvm::SmallSet<const CXXRecordDecl *, 32> &IndirectPrimary) {
+ bool ForVirtualBase) {
llvm::Constant *m = llvm::Constant::getNullValue(Ptr8Ty);
if (RD && !RD->isDynamicClass())
@@ -801,7 +801,7 @@
IndirectPrimary.insert(PrimaryBase);
Top = false;
GenerateVtableForBase(PrimaryBase, true, PrimaryBaseWasVirtual|VBoundary,
- Offset, PrimaryBaseWasVirtual, IndirectPrimary);
+ Offset, PrimaryBaseWasVirtual);
}
if (Top) {
@@ -828,14 +828,13 @@
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
if (Base != PrimaryBase || PrimaryBaseWasVirtual) {
uint64_t o = Offset + Layout.getBaseClassOffset(Base);
- GenerateVtableForBase(Base, true, false, o, false, IndirectPrimary);
+ GenerateVtableForBase(Base, true, false, o, false);
}
}
}
void GenerateVtableForVBases(const CXXRecordDecl *RD,
- const CXXRecordDecl *Class,
- llvm::SmallSet<const CXXRecordDecl *, 32> &IndirectPrimary) {
+ const CXXRecordDecl *Class) {
for (CXXRecordDecl::base_class_const_iterator i = RD->bases_begin(),
e = RD->bases_end(); i != e; ++i) {
const CXXRecordDecl *Base =
@@ -843,10 +842,10 @@
if (i->isVirtual() && !IndirectPrimary.count(Base)) {
// Mark it so we don't output it twice.
IndirectPrimary.insert(Base);
- GenerateVtableForBase(Base, false, true, 0, true, IndirectPrimary);
+ GenerateVtableForBase(Base, false, true, 0, true);
}
if (Base->getNumVBases())
- GenerateVtableForVBases(Base, Class, IndirectPrimary);
+ GenerateVtableForVBases(Base, Class);
}
}
@@ -887,15 +886,13 @@
Offset += LLVMPointerWidth;
Offset += LLVMPointerWidth;
- llvm::SmallSet<const CXXRecordDecl *, 32> IndirectPrimary;
-
ABIBuilder b(methods, RD, CGM);
// First comes the vtables for all the non-virtual bases...
- b.GenerateVtableForBase(RD, true, false, 0, false, IndirectPrimary);
+ b.GenerateVtableForBase(RD, true, false, 0, false);
// then the vtables for all the virtual bases.
- b.GenerateVtableForVBases(RD, RD, IndirectPrimary);
+ b.GenerateVtableForVBases(RD, RD);
llvm::Constant *C;
llvm::ArrayType *type = llvm::ArrayType::get(Ptr8Ty, methods.size());
More information about the cfe-commits
mailing list