This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCI] Remove use of ConstString from StructuredDataDarwinLog static functions
ClosedPublic

Authored by bulbazord on May 26 2023, 4:39 PM.

Details

Summary

The strings "DarwinLog" and "log" probably do not need to be in the
ConstString StringPool. We still create ConstStrings from them in some
places (for now) but that's because we don't have an implicit
constructor to convert a StringRef to a ConstString.

Diff Detail

Event Timeline

bulbazord created this revision.May 26 2023, 4:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2023, 4:39 PM
bulbazord requested review of this revision.May 26 2023, 4:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2023, 4:39 PM
JDevlieghere accepted this revision.May 30 2023, 10:49 AM

LGTM

lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
1495–1497

You could get rid of the .str().c_str() if you used LLDB_LOG

This revision is now accepted and ready to land.May 30 2023, 10:49 AM
bulbazord updated this revision to Diff 526768.May 30 2023, 1:24 PM

LLDB_LOGF -> LLDB_LOG to avoid a temporary string construction.