[PATCH] [dwarfdump] Print the name for referenced specification of abstract_origin DIEs.

Frederic Riss friss at apple.com
Tue Sep 23 11:55:09 PDT 2014


================
Comment at: lib/DebugInfo/DWARFDebugInfoEntry.cpp:129
@@ +128,3 @@
+      formValue.getForm() != DW_FORM_ref_sig8) {
+    uint32_t Ref = formValue.getAsReference(u).getValue();
+    DWARFDebugInfoEntryMinimal DIE;
----------------
samsonov wrote:
> instead of manually checking for DW_FORM_ref_sig8, can you check it like
>   formValue.getAsReference(u).hasValue()
> ?
I'm not exactly sure what you're suggesting, but the issue is not that there might be no value, but that the value returned for DW_FORM_ref_sig8 attributes is non-sensical in this context (For ref_sig8 attributes, the returned value is a hash of the referenced DIE tree).
I've in fact been through a few iterations about this, because I don't find this check very elegant. In one of these, I created a new FormClass - FC_Signature - and thus I had the sig8 attributes return None for getAsReference(). This made the code above a bit nicer, but I didn't like that something that's explicitly named a reference (*ref*_sig8) would not be in the FC_Reference FormClass.

http://reviews.llvm.org/D5466






More information about the llvm-commits mailing list