This is an archive of the discontinued LLVM Phabricator instance.

[DWARFLinker][NFC] Remove usages of "const object::ObjectFile" from DWARFLinker.
ClosedPublic

Authored by avl on Feb 23 2020, 10:54 PM.

Details

Summary

DWARFContext has all the required information to access source debug info.
It is not necessary to use "const object::ObjectFile" to create DWARFContext.
Thus this patch removes all usages of "const object::ObjectFile"
from DWARFLinker. Instead, already created DWARFContext is passed
to DWARFLinker. The purpose is to not depend on "const object::ObjectFile".

The patch looks big, but most of changes are renamings and movements.

Testing: it passes "check-all" lit testing. MD5 checksum for clang .dSYM bundle
matches for the dsymutil with/without that patch.

Diff Detail

Event Timeline

avl created this revision.Feb 23 2020, 10:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2020, 10:55 PM
Herald added a subscriber: hiraditya. · View Herald Transcript

Seems reasonable. I assume you didn't rename the variable names to limit the churn? How much bigger is the patch if you do?

avl added a comment.Feb 24 2020, 12:46 PM

Seems reasonable. I assume you didn't rename the variable names to limit the churn? How much bigger is the patch if you do?

Other than removing references to object::ObjectFile, this patch renames DwarfLinkerObjFile into DwarfFile. there are 57 places which hit by that renaming.

avl added a comment.Feb 27 2020, 12:40 AM

@JDevlieghere So, Is it OK or do I need to make changes?

In D75029#1894876, @avl wrote:

@JDevlieghere So, Is it OK or do I need to make changes?

I meant the variable names like OF in DwarfFile &OF, which used to make sense for ObjectFile but not so much for DwarfFile. If it doesn't cause too much churn I'd like to rename these as well. The change itself looks good.

avl added a comment.Feb 27 2020, 11:36 AM

I meant the variable names like OF in DwarfFile &OF, which used to make sense for ObjectFile but not so much for DwarfFile. If it doesn't cause too much churn I'd like to rename these as well. The change itself looks good.

Ah, I see. Will rename them.

avl updated this revision to Diff 247089.Feb 27 2020, 1:12 PM

addressed comments(renamed ObjectFile &OF -> DwarfFile &File).

JDevlieghere accepted this revision.Feb 27 2020, 8:49 PM

Thanks! LGTM

This revision is now accepted and ready to land.Feb 27 2020, 8:49 PM
This revision was automatically updated to reflect the committed changes.