This is an archive of the discontinued LLVM Phabricator instance.

[DWARFYAML] Add helper function getDWARFEmitterByName(). NFC.
ClosedPublic

Authored by Higuoxing on Jul 30 2020, 9:23 AM.

Details

Summary

In this patch, we add a helper function getDWARFEmitterByName(). This
function returns the proper DWARF section emitting method by the name.

Diff Detail

Event Timeline

Higuoxing created this revision.Jul 30 2020, 9:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2020, 9:23 AM
Higuoxing requested review of this revision.Jul 30 2020, 9:23 AM
This comment was removed by Higuoxing.
Higuoxing planned changes to this revision.Jul 30 2020, 9:04 PM
Higuoxing retitled this revision from [DWARFYAML] Refactor emitDebugSections(). NFC. to [DWARFYAML] Add helper function getDWARFEmitterByName(). NFC..Jul 30 2020, 10:46 PM
Higuoxing edited the summary of this revision. (Show Details)

Pull out the changes of adding emitDebug[GNU]Pub[names/types] functions.

jhenderson added inline comments.Jul 31 2020, 1:50 AM
llvm/lib/ObjectYAML/ELFEmitter.cpp
952

I'm not sure this check is really giving us anything. There's a check in the getDWARFEmitterByName that the name is a recognised name (the default case), so I think you can just remove this check here.

953–955
if (Error Err = EmitFunc(*OS, DWARF);
Higuoxing updated this revision to Diff 282176.Jul 31 2020, 3:40 AM
Higuoxing marked an inline comment as done.

Address review comments.

Thanks for reviewing!

This revision is now accepted and ready to land.Jul 31 2020, 3:42 AM