[cfe-commits] r167336 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenCXX/debug-info-class.cpp test/CodeGenCXX/debug-info-fwd-ref.cpp

Eric Christopher echristo at gmail.com
Wed Nov 7 10:08:52 PST 2012


Yes, I thought I responded but didn't. This has been on my plate for a long
time, thank you.

-eric


On Tue, Nov 6, 2012 at 10:45 PM, Douglas Gregor <dgregor at apple.com> wrote:

>
> On Nov 2, 2012, at 4:40 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> > Author: dblaikie
> > Date: Fri Nov  2 18:40:00 2012
> > New Revision: 167336
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=167336&view=rev
> > Log:
> > Emit debug info for C++ struct definitions as DW_TAG_structure_type
> (instead of class_type).
>
> Thank you!
>
>         - Doug
>
> > Modified:
> >    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> >    cfe/trunk/test/CodeGenCXX/debug-info-class.cpp
> >    cfe/trunk/test/CodeGenCXX/debug-info-fwd-ref.cpp
> >
> > Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=167336&r1=167335&r2=167336&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> > +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Nov  2 18:40:00 2012
> > @@ -1875,7 +1875,7 @@
> >   // Get overall information about the record type for the debug info.
> >   llvm::DIFile DefUnit = getOrCreateFile(RD->getLocation());
> >   unsigned Line = getLineNumber(RD->getLocation());
> > -  StringRef RDName = RD->getName();
> > +  StringRef RDName = getClassName(RD);
> >
> >   llvm::DIDescriptor RDContext;
> >   if (CGM.getCodeGenOpts().getDebugInfo() ==
> CodeGenOptions::LimitedDebugInfo)
> > @@ -1896,9 +1896,7 @@
> >   if (RD->isUnion())
> >     RealDecl = DBuilder.createUnionType(RDContext, RDName, DefUnit, Line,
> >                                       Size, Align, 0, llvm::DIArray());
> > -  else if (CXXDecl) {
> > -    RDName = getClassName(RD);
> > -
> > +  else if (RD->isClass()) {
> >     // FIXME: This could be a struct type giving a default visibility
> different
> >     // than C++ class type, but needs llvm metadata changes first.
> >     RealDecl = DBuilder.createClassType(RDContext, RDName, DefUnit, Line,
> >
> > Modified: cfe/trunk/test/CodeGenCXX/debug-info-class.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class.cpp?rev=167336&r1=167335&r2=167336&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/test/CodeGenCXX/debug-info-class.cpp (original)
> > +++ cfe/trunk/test/CodeGenCXX/debug-info-class.cpp Fri Nov  2 18:40:00
> 2012
> > @@ -8,7 +8,7 @@
> > union baz;
> > void func(baz *f) { // CHECK: DW_TAG_union_type
> > }
> > -struct A { // FIXME: we're still emitting this as DW_TAG_class_type
> > +struct A { // CHECK: DW_TAG_structure_type
> >   int one;
> >   static const int HdrSize = 52; // CHECK: HdrSize
> >   int two;
> >
> > Modified: cfe/trunk/test/CodeGenCXX/debug-info-fwd-ref.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-fwd-ref.cpp?rev=167336&r1=167335&r2=167336&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/test/CodeGenCXX/debug-info-fwd-ref.cpp (original)
> > +++ cfe/trunk/test/CodeGenCXX/debug-info-fwd-ref.cpp Fri Nov  2 18:40:00
> 2012
> > @@ -16,11 +16,10 @@
> >     return 0;
> > }
> >
> > -// Make sure we have two DW_TAG_class_types for baz and bar and no
> forward
> > +// Make sure we have two DW_TAG_structure_types for baz and bar and no
> forward
> > // references.
> > -// FIXME: These should be struct types to match the declaration.
> > -// CHECK: metadata !{i32 {{.*}}, null, metadata !"bar", metadata !6,
> i32 8, i64 128, i64 64, i32 0, i32 0, null, metadata !18, i32 0, null,
> null} ; [ DW_TAG_class_type ]
> > -// CHECK: metadata !{i32 {{.*}}, null, metadata !"baz", metadata !6,
> i32 3, i64 32, i64 32, i32 0, i32 0, null, metadata !21, i32 0, null, null}
> ; [ DW_TAG_class_type ]
> > -// CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"bar", metadata
> !6, i32 8, i64 0, i64 0, i32 0, i32 4, i32 0, null, i32 0, i32 0} ; [
> DW_TAG_class_type ]
> > -// CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"baz", metadata
> !6, i32 3, i64 0, i64 0, i32 0, i32 4, null, null, i32 0, null, null} ; [
> DW_TAG_class_type ]
> > +// CHECK: metadata !{i32 {{.*}}, null, metadata !"bar", metadata !6,
> i32 8, i64 128, i64 64, i32 0, i32 0, null, metadata !18, i32 0, null,
> null} ; [ DW_TAG_structure_type ]
> > +// CHECK: metadata !{i32 {{.*}}, null, metadata !"baz", metadata !6,
> i32 3, i64 32, i64 32, i32 0, i32 0, null, metadata !21, i32 0, null, null}
> ; [ DW_TAG_structure_type ]
> > +// CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"bar", metadata
> !6, i32 8, i64 0, i64 0, i32 0, i32 4, i32 0, null, i32 0, i32 0} ; [
> DW_TAG_structure_type ]
> > +// CHECK-NOT: metadata !{i32 {{.*}}, null, metadata !"baz", metadata
> !6, i32 3, i64 0, i64 0, i32 0, i32 4, null, null, i32 0, null, null} ; [
> DW_TAG_structure_type ]
> >
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121107/aa78baa3/attachment.html>


More information about the cfe-commits mailing list