[PATCH] Patch for missing debug info of type being explicitly casted to
David Blaikie
dblaikie at gmail.com
Thu Sep 18 09:01:23 PDT 2014
================
Comment at: llvm/tools/clang/test/CodeGen/Debug-info-explicitcast.c:7
@@ +6,3 @@
+void foo(void *p) { ((T)(p))->i++; }
+// CHECK: metadata !{i32 {{.*}}, metadata !{{.*}}, null, metadata !"T", i32 3, i64 0, i64 0, i64 0, i32 0, metadata !{{.*}}} ; [ DW_TAG_typedef ] [T] [line 3, size 0, align 0, offset 0] [from ]
+// CHECK: metadata !{i32 {{.*}}, metadata !{{.*}}, null, metadata !"S", i32 3, i64 32, i64 32, i32 0, i32 0, null, metadata !{{.*}}, i32 0, null, null, null} ; [ DW_TAG_structure_type ] [S] [line 3, size 32, align 32, offset 0] [def] [from ]
----------------
There's no need to check the metadata in this level of detail (especially the block of checks at the end of this file) - it makes the tests particularly brittle to metadata schema changes.
Check out some of the other tests to get a sense of the minimal metadata needing to be checked.
Drop the typedef from the test - since that's not the unedrlying issue, and just test the cast to "struct S*" then in the CHECK, something as simple as:
CHECK: ; [ DW_TAG_structure_type ] [S]
should be sufficient to demonstrate that the type was emitted.
As a side note, given this code /in C++/ (coupled with your change):
struct S { };
void sink(S*);
void foo(void* v) {
sink((S*)v);
}
do we emit the declaration of S? (ie: do we emit S (rather than leaving it out entirely) and do we only emit a declaration (since the full definition of S was never needed)? - arguably we could just avoid emitting it entirely here, since no one ever dereferenced the pointer and we don't need the declaration to describe any other entities... )
http://reviews.llvm.org/D2498
More information about the cfe-commits
mailing list