This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] Remove StructuredData::Array::GetItemAtIndexAsString overloads with ConstString
ClosedPublic

Authored by bulbazord on Jun 13 2023, 5:26 PM.

Details

Summary

This is the next step in removing ConstString from StructuredData. There
are StringRef overloads already, let's use those where we can.

Diff Detail

Event Timeline

bulbazord created this revision.Jun 13 2023, 5:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 5:26 PM
Herald added a subscriber: arphaman. · View Herald Transcript
bulbazord requested review of this revision.Jun 13 2023, 5:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 5:26 PM
mib added inline comments.Jun 14 2023, 3:42 PM
lldb/source/Target/DynamicRegisterInfo.cpp
211

I guess m_sets is a vector of char* ... Should we change it to lldb::StringList or llvm::StringSet so we don't have to create a ConstString here ?

bulbazord added inline comments.Jul 6 2023, 9:22 AM
lldb/source/Target/DynamicRegisterInfo.cpp
211

m_sets is a vector of lldb_private::RegisterSet (which contains a const char *). I think it's assumed that they are backed by a ConstString. Because RegisterSet is defined in lldb-private-types.h we'd have to move it somewhere else before we could actually use any types other than const char *, I think?

fdeazeve accepted this revision.Aug 29 2023, 12:06 PM
fdeazeve added a subscriber: fdeazeve.

LGTM!

This revision is now accepted and ready to land.Aug 29 2023, 12:06 PM