[cfe-commits] r120132 - /cfe/trunk/lib/CodeGen/CGVTables.cpp
Anders Carlsson
andersca at mac.com
Wed Nov 24 15:04:03 PST 2010
Author: andersca
Date: Wed Nov 24 17:04:03 2010
New Revision: 120132
URL: http://llvm.org/viewvc/llvm-project?rev=120132&view=rev
Log:
Move code off the primary base info iterator. No functionality change.
Modified:
cfe/trunk/lib/CodeGen/CGVTables.cpp
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=120132&r1=120131&r2=120132&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Wed Nov 24 17:04:03 2010
@@ -2240,6 +2240,19 @@
}
+static void
+CollectPrimaryBases(const CXXRecordDecl *RD, ASTContext &Context,
+ VTableBuilder::PrimaryBasesSetVectorTy &PrimaryBases) {
+ while (RD) {
+ const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
+ const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase();
+ if (PrimaryBase)
+ PrimaryBases.insert(PrimaryBase);
+
+ RD = PrimaryBase;
+ }
+}
+
void CodeGenVTables::ComputeMethodVTableIndices(const CXXRecordDecl *RD) {
// Itanium C++ ABI 2.5.2:
@@ -2268,10 +2281,7 @@
// Collect all the primary bases, so we can check whether methods override
// a method from the base.
VTableBuilder::PrimaryBasesSetVectorTy PrimaryBases;
- for (ASTRecordLayout::primary_base_info_iterator
- I = Layout.primary_base_begin(), E = Layout.primary_base_end();
- I != E; ++I)
- PrimaryBases.insert((*I).getBase());
+ CollectPrimaryBases(RD, CGM.getContext(), PrimaryBases);
const CXXDestructorDecl *ImplicitVirtualDtor = 0;
More information about the cfe-commits
mailing list