This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Change return type of UnixSignals::GetShortName
ClosedPublic

Authored by bulbazord on Jun 9 2023, 1:49 PM.

Details

Summary

The short names of each signal name and alias only exist as ConstStrings
in this one scenario. For example, GetShortName("SIGHUP") will just give
you "HUP". There's not a good reason the string "HUP" needs to be in the
ConstString StringPool, and that's true for just about every signal
name.

Diff Detail

Event Timeline

bulbazord created this revision.Jun 9 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2023, 1:49 PM
bulbazord requested review of this revision.Jun 9 2023, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2023, 1:49 PM
mib added a comment.Jun 9 2023, 1:54 PM

Don't you need to update the callers as well ? Otherwise LGTM.

Don't you need to update the callers as well ? Otherwise LGTM.

ConstString can be implicitly converted to StringRef which is what's happening here. There are only 2 call sites, both pass in a ConstString.

This revision is now accepted and ready to land.Jun 9 2023, 2:48 PM
mib accepted this revision.Jun 9 2023, 2:48 PM
This revision was automatically updated to reflect the committed changes.