[cfe-commits] r93710 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Sun Jan 17 20:45:48 PST 2010
Author: andersca
Date: Sun Jan 17 22:45:46 2010
New Revision: 93710
URL: http://llvm.org/viewvc/llvm-project?rev=93710&view=rev
Log:
Move some common code into BuildVTT.
Modified:
cfe/trunk/lib/CodeGen/CGVtable.cpp
Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=93710&r1=93709&r2=93710&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sun Jan 17 22:45:46 2010
@@ -1367,6 +1367,9 @@
if (RD->getNumVBases() == 0)
return;
+ // Remember the sub-VTT index.
+ SubVTTIndicies[RD] = Inits.size();
+
llvm::Constant *Vtable;
const CXXRecordDecl *VtableClass;
@@ -1403,9 +1406,6 @@
const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
uint64_t BaseOffset = Offset + Layout.getBaseClassOffset(Base);
- // Remember the sub-VTT index.
- SubVTTIndicies[Base] = Inits.size();
-
BuildVTT(Base, BaseOffset, MorallyVirtual);
}
}
@@ -1418,9 +1418,6 @@
const CXXRecordDecl *Base =
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
if (i->isVirtual() && !SeenVBase.count(Base)) {
- // Remember the sub-VTT index.
- SubVTTIndicies[Base] = Inits.size();
-
SeenVBase.insert(Base);
uint64_t BaseOffset = BLayout.getVBaseClassOffset(Base);
BuildVTT(Base, BaseOffset, true);
More information about the cfe-commits
mailing list