This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] - Remove unused code.
AbandonedPublic

Authored by grimar on Jul 10 2017, 2:57 AM.

Details

Summary

This was added in D32779, but I think it was unused from begining,
because Name (prev name) variable is never accessed after Obj.mapDebugSectionName() call.
Looks we can remove it.

Diff Detail

Event Timeline

grimar created this revision.Jul 10 2017, 2:57 AM
grimar edited the summary of this revision. (Show Details)
wolfgangp edited edge metadata.Jul 10 2017, 11:07 AM

Yikes, looks like you found a bug. The original idea was to provide a generic mechanism to map platform specific debug section names to DWARF standard names, for example for Mach-O, which limits section names to 16 characters. The Mach-O section name for .debug_str_offsets is debug_str_offs, so I was trying to map this back to debug_str_offsets (all the leading '_' and '.'s are removed at this point). The call should have gone before the "if (StringRef *SectionData =" line a few lines above, otherwise the call the MapSectionToMember() would fail for Mach-O object files with a debug_str_off section. Nobody is generating one yet, so nobody will hit it, but it's there. My bad, of course, for not adding a test for Mach-O in the first place.

Please don't commit this, I will fix it in a different review and add a test for Mach-O.

grimar abandoned this revision.Jul 11 2017, 12:11 AM

Yikes, looks like you found a bug. The original idea was to provide a generic mechanism to map platform specific debug section names to DWARF standard names, for example for Mach-O, which limits section names to 16 characters. The Mach-O section name for .debug_str_offsets is debug_str_offs, so I was trying to map this back to debug_str_offsets (all the leading '_' and '.'s are removed at this point). The call should have gone before the "if (StringRef *SectionData =" line a few lines above, otherwise the call the MapSectionToMember() would fail for Mach-O object files with a debug_str_off section. Nobody is generating one yet, so nobody will hit it, but it's there. My bad, of course, for not adding a test for Mach-O in the first place.

Please don't commit this, I will fix it in a different review and add a test for Mach-O.

Ok, thanks for explanation, I am abandoning this one then.