]> granicus.if.org Git - clang/commitdiff
Run the new vtable builder for construction vtables as well now. Note that we still...
authorAnders Carlsson <andersca@mac.com>
Thu, 11 Mar 2010 05:48:21 +0000 (05:48 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 11 Mar 2010 05:48:21 +0000 (05:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98239 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index 5b9c976d3807ff3f73f863402a34eeec27e8ba5c..b500f4d1130d153abd9dab6a535d07f409ef30bb 100644 (file)
@@ -3429,20 +3429,17 @@ CGVtableInfo::GenerateVtable(llvm::GlobalVariable::LinkageTypes Linkage,
   if (GenerateDefinition) {
     if (LayoutClass == RD) {
       assert(!IsVirtual && 
-             "Can't only have a virtual base in construction vtables!");
-      VtableBuilder Builder(*this, RD, Offset, 
-                            /*MostDerivedClassIsVirtual=*/false,
-                            LayoutClass);
-
-      if (CGM.getLangOptions().DumpVtableLayouts)
-        Builder.dumpLayout(llvm::errs());
-    } else if (CGM.getLangOptions().DumpVtableLayouts) {
-      // We only build construction vtables when dumping vtable layouts for now.
-      VtableBuilder Builder(*this, RD, Offset, 
-                            /*MostDerivedClassIsVirtual=*/IsVirtual,
-                            LayoutClass);
-      Builder.dumpLayout(llvm::errs());
+             "Can only have a virtual base in construction vtables!");
+      assert(!Offset && 
+             "Can only have a base offset in construction vtables!");
     }
+    
+    VtableBuilder Builder(*this, RD, Offset, 
+                          /*MostDerivedClassIsVirtual=*/false,
+                          LayoutClass);
+
+    if (CGM.getLangOptions().DumpVtableLayouts)
+      Builder.dumpLayout(llvm::errs());
   }
 
   llvm::SmallString<256> OutName;