]> granicus.if.org Git - clang/commitdiff
Fix a refacto that broke the clang-on-clang build.
authorAnders Carlsson <andersca@mac.com>
Fri, 12 Feb 2010 18:14:46 +0000 (18:14 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 12 Feb 2010 18:14:46 +0000 (18:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp
test/CodeGenCXX/virtual-function-calls.cpp

index 93153e31b6b7cbfc76b3a2bf5137e3e5c64835ff..16c38002bc349930079146f83899bd8df99b4c2f 100644 (file)
@@ -1924,8 +1924,6 @@ void CGVtableInfo::ComputeMethodVtableIndices(const CXXRecordDecl *RD) {
     if (!MD->isVirtual())
       continue;
 
-    bool ShouldAddEntryForMethod = true;
-    
     // Check if this method overrides a method in the primary base.
     if (const CXXMethodDecl *OverriddenMD = 
           OverridesMethodInPrimaryBase(MD, PrimaryBases)) {
@@ -1948,14 +1946,10 @@ void CGVtableInfo::ComputeMethodVtableIndices(const CXXRecordDecl *RD) {
         }
         
         // We don't need to add an entry for this method.
-        ShouldAddEntryForMethod = false;
-        break;
+        continue;
       }
     }
     
-    if (!ShouldAddEntryForMethod)
-      continue;
-    
     if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) {
       if (MD->isImplicit()) {
         assert(!ImplicitVirtualDtor && 
index 0b3a684301eb216bd97a04ee5dc4c24d2af707ad..46e7b2d37f777eaf3431824b7a08e68a44a414b3 100644 (file)
@@ -1,6 +1,8 @@
 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
 
 // PR5021
+namespace PR5021 {
+
 struct A {
   virtual void f(char);
 };
@@ -16,4 +18,21 @@ struct B : virtual A {
 
 void f(B * b) {
   b->f();
-}
\ No newline at end of file
+}
+
+}
+
+namespace Test1 {
+  struct A { 
+    virtual ~A(); 
+  };
+
+  struct B : A {
+    virtual ~B();
+    virtual void f();
+  };
+
+  void f(B *b) {
+    b->f();
+  }
+}