]> granicus.if.org Git - clang/commitdiff
Let the VTT builder pretend that getVtable returns a pointer to the vtable and not...
authorAnders Carlsson <andersca@mac.com>
Sat, 5 Dec 2009 20:58:49 +0000 (20:58 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 5 Dec 2009 20:58:49 +0000 (20:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90672 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index 6408853df3f3126bb95f3ebecfa3e6fc2e1acfae..e7f170f55962659066252962ee6cbb57567b355a 100644 (file)
@@ -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);