[cfe-commits] r166056 - in /cfe/trunk: lib/AST/VTableBuilder.cpp test/CodeGenCXX/vtable-layout.cpp
David Blaikie
dblaikie at gmail.com
Tue Oct 16 13:25:33 PDT 2012
Author: dblaikie
Date: Tue Oct 16 15:25:33 2012
New Revision: 166056
URL: http://llvm.org/viewvc/llvm-project?rev=166056&view=rev
Log:
Note deleted functions when dumping vtables.
Modified:
cfe/trunk/lib/AST/VTableBuilder.cpp
cfe/trunk/test/CodeGenCXX/vtable-layout.cpp
Modified: cfe/trunk/lib/AST/VTableBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=166056&r1=166055&r2=166056&view=diff
==============================================================================
--- cfe/trunk/lib/AST/VTableBuilder.cpp (original)
+++ cfe/trunk/lib/AST/VTableBuilder.cpp Tue Oct 16 15:25:33 2012
@@ -1891,6 +1891,9 @@
if (MD->isPure())
Out << " [pure]";
+ if (MD->isDeleted())
+ Out << " [deleted]";
+
ThunkInfo Thunk = VTableThunks.lookup(I);
if (!Thunk.isEmpty()) {
// If this function pointer has a return adjustment, dump it.
Modified: cfe/trunk/test/CodeGenCXX/vtable-layout.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-layout.cpp?rev=166056&r1=166055&r2=166056&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-layout.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-layout.cpp Tue Oct 16 15:25:33 2012
@@ -43,6 +43,7 @@
// RUN: FileCheck --check-prefix=CHECK-42 %s < %t
// RUN: FileCheck --check-prefix=CHECK-43 %s < %t
// RUN: FileCheck --check-prefix=CHECK-44 %s < %t
+// RUN: FileCheck --check-prefix=CHECK-45 %s < %t
// For now, just verify this doesn't crash.
namespace test0 {
@@ -1727,3 +1728,23 @@
void *B::foo() { return 0; }
}
+
+namespace Test39 {
+ struct A {
+ virtual void foo() = delete;
+ };
+
+ // CHECK-45: Vtable for 'Test39::B' (4 entries).
+ // CHECK-45-NEXT: 0 | offset_to_top (0)
+ // CHECK-45-NEXT: 1 | Test39::B RTTI
+ // CHECK-45-NEXT: -- (Test39::A, 0) vtable address --
+ // CHECK-45-NEXT: -- (Test39::B, 0) vtable address --
+ // CHECK-45-NEXT: 2 | void Test39::A::foo() [deleted]
+ // CHECK-45-NEXT: 3 | void Test39::B::foo2()
+ struct B: A {
+ virtual void foo2();
+ };
+
+ void B::foo2() {
+ }
+}
More information about the cfe-commits
mailing list