summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-12-13 22:29:06 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-12-13 22:29:06 +0000
commit831c9927e89859379b2e954b6964cb291f242556 (patch)
treea3d7c3d7971f3a316463219b84d76f1ebbba7db2
parentc7078c228a3f64e47325161879ad7920a8d064d7 (diff)
downloadbcm5719-llvm-831c9927e89859379b2e954b6964cb291f242556.tar.gz
bcm5719-llvm-831c9927e89859379b2e954b6964cb291f242556.zip
Debug Info: Emit vtables pointer members as artificial.
I wasn't sure where to put the test case for this, but this seemed like as good a place as any. I had to reorder the tests here to make them legible while still matching the order of metadata output in the IR file (for some reason making it virtual changed the ordering). Relevant commit to fix up LLVM to actually respect 'artificial' member variables is coming once I write up a test case for it. llvm-svn: 170154
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp2
-rw-r--r--clang/test/CodeGenCXX/debug-info-class.cpp9
2 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index f3468f29c1b..844514be27c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1199,7 +1199,7 @@ CollectVTableInfo(const CXXRecordDecl *RD, llvm::DIFile Unit,
unsigned Size = CGM.getContext().getTypeSize(CGM.getContext().VoidPtrTy);
llvm::DIType VPTR
= DBuilder.createMemberType(Unit, getVTableName(RD), Unit,
- 0, Size, 0, 0, 0,
+ 0, Size, 0, 0, llvm::DIDescriptor::FlagArtificial,
getOrCreateVTablePtrType(Unit));
EltTys.push_back(VPTR);
}
diff --git a/clang/test/CodeGenCXX/debug-info-class.cpp b/clang/test/CodeGenCXX/debug-info-class.cpp
index 062227a0238..131693b21a5 100644
--- a/clang/test/CodeGenCXX/debug-info-class.cpp
+++ b/clang/test/CodeGenCXX/debug-info-class.cpp
@@ -8,6 +8,11 @@ void func(bar *f) { // CHECK: DW_TAG_class_type
union baz;
void func(baz *f) { // CHECK: DW_TAG_union_type
}
+class B { // CHECK: DW_TAG_class_type
+public:
+ virtual ~B();
+// CHECK: metadata !"_vptr$B", {{.*}}, i32 64, metadata !{{.*}}} ; [ DW_TAG_member ]
+};
struct A { // CHECK: DW_TAG_structure_type
int one;
static const int HdrSize = 52; // CHECK: HdrSize
@@ -16,8 +21,8 @@ struct A { // CHECK: DW_TAG_structure_type
int x = 1;
}
};
-class B { // CHECK: DW_TAG_class_type
-};
+
+
int main() {
A a;
B b;
OpenPOWER on IntegriCloud