This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Minor cleanups at callsites of FileSpec::GetFileNameExtension
ClosedPublic

Authored by bulbazord on May 2 2023, 10:53 AM.

Details

Summary

FileSpec::GetFileNameExtension returns a StringRef. In some cases we
are calling it and then storing the result in a local. To prevent
cases where we store the StringRef, mutate the Filespec, and then try to
use the stored StringRef afterwards, I've audited the callsites and made
adjustments to mitigate: Either marking the FileSpec it comes from as
const (to avoid mutations) or by not storing the StringRef in a local if
it makes sense not to.

Diff Detail

Event Timeline

bulbazord created this revision.May 2 2023, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 10:53 AM
bulbazord requested review of this revision.May 2 2023, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 10:53 AM
bulbazord edited the summary of this revision. (Show Details)May 2 2023, 10:54 AM
mib accepted this revision.May 2 2023, 4:48 PM
This revision is now accepted and ready to land.May 2 2023, 4:48 PM