diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-18 04:45:46 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-18 04:45:46 +0000 |
commit | 7a2132a5d2fead49f6fddc39137e1c14b70c0193 (patch) | |
tree | ec738e56ea6f7336ebb3a204bab53f647cdad189 /lib/CodeGen/CGVtable.cpp | |
parent | 20314fffcf5d97bab58686cdcb914637b453a166 (diff) |
Move some common code into BuildVTT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93710 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 67b2b3dcb6..2f5681e181 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -1367,6 +1367,9 @@ class VTTBuilder { if (RD->getNumVBases() == 0) return; + // Remember the sub-VTT index. + SubVTTIndicies[RD] = Inits.size(); + llvm::Constant *Vtable; const CXXRecordDecl *VtableClass; @@ -1403,9 +1406,6 @@ class VTTBuilder { 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 @@ class VTTBuilder { 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); |