This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Return StringRef from PluginInterface::GetPluginName
ClosedPublic

Authored by labath on Oct 15 2021, 4:21 AM.

Details

Summary

There is no reason why this function should be returning a ConstString.

While modifying these files, I also fixed several instances where
GetPluginName and GetPluginNameStatic were returning different strings.

I am not changing the return type of GetPluginNameStatic in this patch, as that
would necessitate additional changes, and this patch is big enough as it is.

Diff Detail

Event Timeline

labath created this revision.Oct 15 2021, 4:21 AM
labath requested review of this revision.Oct 15 2021, 4:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2021, 4:21 AM
teemperor accepted this revision.Oct 15 2021, 6:41 AM

I'm wondering if some of those should be std::string instead, but this is in any case a step in the right direction so LGTM

This revision is now accepted and ready to land.Oct 15 2021, 6:41 AM

I hope we don't have to go through this renaming any time soon. I think that any plugin that does not want to return a constant string here could just store it in a std::string internally. I actually found exactly one plugin (PlatformAppleSimulator) which does that already.