[llvm-commits] [PATCH] PR14471: Debug info for static data members (LLVM part)

Eric Christopher echristo at gmail.com
Fri Jan 4 22:16:05 PST 2013


On Fri, Jan 4, 2013 at 9:27 AM, Robinson, Paul <Paul.Robinson at am.sony.com>wrote:

>
>
>>    This is in enum llvm_dwarf_constants, not enum dwarf_constants.
>> It's one of several mock tags defined for the metadata interface;
>> they are not defined by DWARF.  (If the number of real DWARF tags
>> doubles, we'll have to renumber these to get out of the way.)
>>
>>
>
>  > Yeah, we're looking at getting rid of those, I'm not sure it's needed
> ... (more at the end)
>
>  I made a new subclass for static members because normal members
> currently use DIDerivedType and there are already snippy remarks in the
> commentary about what a hack that is (there's at least one extra field in
> DIDerivedType that's used only for members).  AFAICT the subclasses have to
> be distinguishable by tag, so I invented a new tag.
>
> If a future patch migrates normal members onto the new subclass, and
> there's some other way to distinguish normal and static members within that
> subclass (e.g. a new flag), then the new subclass can be identified using
> DW_TAG_member (which would no longer be valid for DIDerivedType) and we can
> get rid of DW_TAG_CXX_static_member.
>
>
So, I haven't checked with your patches since you think you might be
missing a couple of hunks, however I think that we can still make do this
using createMemberType and merely having a flag for the type that says that
it's a static type and then query that. You wouldn't even need to modify
createMemberType to take any extra variables it could just check for a new
flag on the member.

Also, yes, the fixme in createStaticMemberDIE is correct - it should be
DW_TAG_member.

Also:

+  DIDescriptor GVContext = GV.getContext();
+  (void)getOrCreateContextDIE(GVContext);

this seems weird (that, as in, getting rid of the return value)?

As a note, I'm pretty happy with the patch, just trying to minimize the
amount of large scale changes.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130104/3cf87bf1/attachment.html>


More information about the llvm-commits mailing list