This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] TypeSystemClang::GetTypeForIdentifier should take a StringRef
ClosedPublic

Authored by bulbazord on Jun 15 2023, 10:33 AM.

Details

Summary

This method just takes its ConstString parameter and gets a StringRef
out of it. Let's just pass in a StringRef directly.

This also cleans up some logic in the callers to be a little easier to
read and to avoid unnecessary ConstString creation.

Diff Detail

Event Timeline

bulbazord created this revision.Jun 15 2023, 10:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 10:33 AM
bulbazord requested review of this revision.Jun 15 2023, 10:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 10:33 AM
aprantl accepted this revision.Jun 15 2023, 10:56 AM
aprantl added inline comments.
lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
76

why not directly pass in "__lldb_autogen_nspair" here?

This revision is now accepted and ready to land.Jun 15 2023, 10:56 AM
bulbazord added inline comments.Jun 15 2023, 11:17 AM
lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
76

It's used below as well, I didn't trust myself to be able to type it correctly twice in a row. :)
It's also nice that we can constexpr the llvm::StringRef and avoid computing the length at runtime, but that's a minor thing.

augusto2112 accepted this revision.Jun 15 2023, 3:44 PM