summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-06-05 05:32:23 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-06-05 05:32:23 +0000
commite36464c2f64b0b3bf5697bd4f1f0252144dccd98 (patch)
treea8842ff11f018c8c10a0c31971fb82d4131099d5 /clang/test/CodeGenCXX/debug-info.cpp
parent044f783bc0defd0ee5cce411360b795b27b8f595 (diff)
downloadbcm5719-llvm-e36464c2f64b0b3bf5697bd4f1f0252144dccd98.tar.gz
bcm5719-llvm-e36464c2f64b0b3bf5697bd4f1f0252144dccd98.zip
PR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types used via typedefs
In an effort to make -flimit-debug-info more consistent I over-shot the mark & made types used via typedefs never produce definitions in the debug info (even if the type was used in a way that would require a definition). The fix for this is to do exactly what I was hoping to do at some point - plumb the declaration/definition choice through the various layers of "CreateType" in CGDebugInfo. In this way we can produce declarations whenever they are sufficient & definitions otherwise - including when qualifiers are used, for example (discovered in PR14467). This may not be complete (there may be other types/situations where we need to propagate the "declaration/definition" choice) but it lays the basic foundation which we can enhance in future iterations. llvm-svn: 183296
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info.cpp b/clang/test/CodeGenCXX/debug-info.cpp
index b16c564e738..4085b9ad328 100644
--- a/clang/test/CodeGenCXX/debug-info.cpp
+++ b/clang/test/CodeGenCXX/debug-info.cpp
@@ -76,3 +76,27 @@ incomplete (*x)[3];
// CHECK: [[INCARRAY]] = {{.*}}metadata [[INCTYPE:![0-9]*]], metadata {{![0-9]*}}, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 0, align 0, offset 0] [from incomplete]
// CHECK: [[INCTYPE]] = {{.*}} ; [ DW_TAG_structure_type ] [incomplete]{{.*}} [fwd]
}
+
+namespace pr16214 {
+struct a {
+ int i;
+};
+
+typedef a at;
+
+struct b {
+};
+
+typedef b bt;
+
+void func() {
+ at a_inst;
+ bt *b_ptr_inst;
+ const bt *b_cnst_ptr_inst;
+}
+
+// CHECK: metadata [[A_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [a]
+// CHECK: [[A_MEM]] = metadata !{metadata [[A_I:![0-9]*]], metadata !{{[0-9]*}}}
+// CHECK: [[A_I]] = {{.*}} ; [ DW_TAG_member ] [i] {{.*}} [from int]
+// CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}}[fwd]
+}
OpenPOWER on IntegriCloud