When dumping vtables, dump whether a virtual member function is pure or not.

llvm-svn: 95963
This commit is contained in:
Anders Carlsson 2010-02-12 02:38:13 +00:00
parent 993bd1b7da
commit 09da3372b6
2 changed files with 27 additions and 1 deletions

View File

@ -500,7 +500,6 @@ public:
/// dumpLayout - Dump the vtable layout.
void dumpLayout(llvm::raw_ostream&);
};
void VtableBuilder::layoutSimpleVtable(const CXXRecordDecl *RD) {
@ -593,6 +592,9 @@ void VtableBuilder::dumpLayout(llvm::raw_ostream& Out) {
PredefinedExpr::ComputeName(PredefinedExpr::PrettyFunctionNoVirtual,
MD);
Out << Str;
if (MD->isPure())
Out << " [pure]";
break;
}
@ -600,6 +602,9 @@ void VtableBuilder::dumpLayout(llvm::raw_ostream& Out) {
const CXXDestructorDecl *DD = Component.getDestructorDecl();
Out << DD->getQualifiedNameAsString() << "() [complete]";
if (DD->isPure())
Out << " [pure]";
break;
}
@ -607,6 +612,9 @@ void VtableBuilder::dumpLayout(llvm::raw_ostream& Out) {
const CXXDestructorDecl *DD = Component.getDestructorDecl();
Out << DD->getQualifiedNameAsString() << "() [deleting]";
if (DD->isPure())
Out << " [pure]";
break;
}

View File

@ -39,4 +39,22 @@ struct A {
void A::f() { }
// Another simple vtable dumper test.
// CHECK: Vtable for 'Test2::B' (6 entries).
// CHECK-NEXT: 0 | offset_to_top (0)
// CHECK-NEXT: 1 | Test2::B RTTI
// CHECK-NEXT: -- (Test2::B, 0) vtable address --
// CHECK-NEXT: 2 | void Test2::B::f()
// CHECK-NEXT: 3 | void Test2::B::g() [pure]
// CHECK-NEXT: 4 | Test2::B::~B() [complete] [pure]
// CHECK-NEXT: 5 | Test2::B::~B() [deleting] [pure]
struct B {
virtual void f();
virtual void g() = 0;
virtual ~B() = 0;
};
void B::f() { }
}