This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] Change return type of DWARFDebugInfoEntry::GetAttributes
ClosedPublic

Authored by bulbazord on May 11 2023, 2:48 PM.

Details

Summary

The purpose of this method is to get the list of attributes of a
DebugInfoEntry. Prior to this change we were passing in a mutable
reference to a DWARFAttributes object and having the method fill it in
for us while returning the size of the filled out list. But
instead of doing that, we can just return a DWARFAttributes object
ourselves since every caller creates a new list before calling
GetAttributes.

Diff Detail

Event Timeline

bulbazord created this revision.May 11 2023, 2:48 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: arphaman. · View Herald Transcript
bulbazord requested review of this revision.May 11 2023, 2:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 2:48 PM
fdeazeve accepted this revision.May 12 2023, 4:34 AM

Thanks for doing this! In particular, all the early returns are very welcome :)

I suspect you already have this in your radar, but ExtractFormValueAtIndex could probably return an optional<DWARFFormValue> to cleanup some code.

This revision is now accepted and ready to land.May 12 2023, 4:34 AM

Thanks for doing this! In particular, all the early returns are very welcome :)

I suspect you already have this in your radar, but ExtractFormValueAtIndex could probably return an optional<DWARFFormValue> to cleanup some code.

Yup, on the radar! :)