aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-05 20:58:49 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-05 20:58:49 +0000
commit2e32aaef378f9f098c9ce59bc26ddc8876c0199f (patch)
tree16d207c2562518edd4b93d28a74ae0e452348450 /lib/CodeGen/CGVtable.cpp
parentbe58b390ebaf64ffc455916a11fe231bcfa5a648 (diff)
Let the VTT builder pretend that getVtable returns a pointer to the vtable and not to the vtable address point.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90672 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index 6408853df3..e7f170f559 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -1264,7 +1264,7 @@ class VTTBuilder {
VtblClass = RD;
}
- llvm::Constant *vtbl = dyn_cast<llvm::Constant>(init->getOperand(0));
+ llvm::Constant *vtbl = cast<llvm::Constant>(init->getOperand(0));
Inits.push_back(init);
// then the secondary VTTs....
@@ -1316,9 +1316,9 @@ public:
VMContext(cgm.getModule().getContext()) {
// First comes the primary virtual table pointer for the complete class...
- ClassVtbl = CGM.getVtableInfo().getVtable(Class);
- Inits.push_back(ClassVtbl);
- ClassVtbl = dyn_cast<llvm::Constant>(ClassVtbl->getOperand(0));
+ ClassVtbl = cast<llvm::Constant>(CGM.getVtableInfo().getVtable(Class)
+ ->getOperand(0));
+ Inits.push_back(BuildVtablePtr(ClassVtbl, Class, Class, 0));
// then the secondary VTTs...
SecondaryVTTs(Class);