[cfe-commits] r95994 - in /cfe/trunk: lib/CodeGen/CGVtable.cpp test/CodeGenCXX/virtual-function-calls.cpp
Anders Carlsson
andersca at mac.com
Fri Feb 12 10:14:47 PST 2010
Author: andersca
Date: Fri Feb 12 12:14:46 2010
New Revision: 95994
URL: http://llvm.org/viewvc/llvm-project?rev=95994&view=rev
Log:
Fix a refacto that broke the clang-on-clang build.
Modified:
cfe/trunk/lib/CodeGen/CGVtable.cpp
cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp
Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=95994&r1=95993&r2=95994&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Fri Feb 12 12:14:46 2010
@@ -1924,8 +1924,6 @@
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 @@
}
// 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 &&
Modified: cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp?rev=95994&r1=95993&r2=95994&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virtual-function-calls.cpp Fri Feb 12 12:14:46 2010
@@ -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 @@
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();
+ }
+}
More information about the cfe-commits
mailing list