aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-05 21:02:25 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-05 21:02:25 +0000
commit4282edfe696a0c15bb8656f3e13dd6643fd3057d (patch)
tree48cfa83c73972a9454da2a81e14a39b8cbd108d5 /lib/CodeGen/CGVtable.cpp
parent2e32aaef378f9f098c9ce59bc26ddc8876c0199f (diff)
Simplify BuildVTT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index e7f170f559..b01f4cf97b 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -1251,27 +1251,26 @@ class VTTBuilder {
if (RD->getNumVBases() == 0 && !MorallyVirtual)
return;
- llvm::Constant *init;
- const CXXRecordDecl *VtblClass;
+ llvm::Constant *Vtable;
+ const CXXRecordDecl *VtableClass;
// First comes the primary virtual table pointer...
if (MorallyVirtual) {
- init = BuildVtablePtr(ClassVtbl, Class, RD, Offset);
- VtblClass = Class;
+ Vtable = ClassVtbl;
+ VtableClass = Class;
} else {
- init = CGM.getVtableInfo().getCtorVtable(Class, RD, Offset);
- init = BuildVtablePtr(init, RD, RD, Offset);
-
- VtblClass = RD;
+ Vtable = CGM.getVtableInfo().getCtorVtable(Class, RD, Offset);
+ VtableClass = RD;
}
- llvm::Constant *vtbl = cast<llvm::Constant>(init->getOperand(0));
- Inits.push_back(init);
+
+ llvm::Constant *Init = BuildVtablePtr(Vtable, VtableClass, RD, Offset);
+ Inits.push_back(Init);
// then the secondary VTTs....
SecondaryVTTs(RD, Offset, MorallyVirtual);
// and last the secondary vtable pointers.
- Secondary(RD, vtbl, VtblClass, Offset, MorallyVirtual);
+ Secondary(RD, Vtable, VtableClass, Offset, MorallyVirtual);
}
/// SecondaryVTTs - Add the secondary VTTs to Inits. The secondary VTTs are